Package org.hibernate.query.range
Interface Range<U>
- Type Parameters:
U
- The type of the value being restricted
Specifies an allowed set or range of values for a value being restricted.
A parameter of a finder method may be declared with type Range<T>
where T
is the type of the matching field or property of the entity.
- Since:
- 7.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Comparable<U>>
Range<U>closed
(U lowerBound, U upperBound) A closed range containing all values greater than or equal to the given lower bound, and less than or equal to the given upper bound.containing
(String substring) A range containing all strings which contain the given substring, with case-sensitivity.containing
(String substring, boolean caseSensitive) A range containing all strings which contain the given substring, with case-sensitivity specified explicitly.static <U> Range<U>
An empty range containing no values.static <U> Range<U>
A complete range containing all values of the given type.getType()
The Java class of the values belonging to this range.static <U extends Comparable<U>>
Range<U>greaterThan
(U bound) A range containing all values strictly greater than the given lower bound.static <U extends Comparable<U>>
Range<U>greaterThanOrEqualTo
(U bound) A range containing all values greater than or equal to the given lower bound.static <U extends Comparable<U>>
Range<U>lessThan
(U bound) A range containing all values strictly less than the given upper bound.static <U extends Comparable<U>>
Range<U>lessThanOrEqualTo
(U bound) A range containing all values less than or equal to the given upper bound.static <U> Range<U>
A range containing all allowed values of the given type exceptnull
.static <U extends Comparable<U>>
Range<U>open
(U lowerBound, U upperBound) An open range containing all values strictly greater than the given lower bound, and strictly less than the given upper bound.A range containing all strings which match the given pattern, with case-sensitivity.A range containing all strings which match the given pattern, with case-sensitivity specified explicitly.A range containing all strings which match the given pattern, with case-sensitivity specified explicitly.A range containing all strings which begin with the given prefix, with case-sensitivity.A range containing all strings which begin with the given prefix, with case-sensitivity specified explicitly.singleCaseInsensitiveValue
(String value) A range containing all strings which are equal to the given string, ignoring case.static <U> Range<U>
singleValue
(U value) A range containing a single value.A range containing all strings which end with the given suffix, with case-sensitivity.A range containing all strings which end with the given suffix, with case-sensitivity specified explicitly.toPredicate
(Path<? extends U> path, CriteriaBuilder builder) Return a JPA CriteriaPredicate
constraining the given attribute of the given root entity to this domain of allowed values.static <U> Range<U>
A range containing all values belonging to the given list.
-
Method Details
-
getType
The Java class of the values belonging to this range. -
toPredicate
Return a JPA CriteriaPredicate
constraining the given attribute of the given root entity to this domain of allowed values. -
singleValue
A range containing a single value. -
singleCaseInsensitiveValue
A range containing all strings which are equal to the given string, ignoring case. -
valueList
A range containing all values belonging to the given list. -
greaterThan
A range containing all values strictly greater than the given lower bound. -
greaterThanOrEqualTo
A range containing all values greater than or equal to the given lower bound. -
lessThan
A range containing all values strictly less than the given upper bound. -
lessThanOrEqualTo
A range containing all values less than or equal to the given upper bound. -
open
An open range containing all values strictly greater than the given lower bound, and strictly less than the given upper bound. -
closed
A closed range containing all values greater than or equal to the given lower bound, and less than or equal to the given upper bound. -
pattern
A range containing all strings which match the given pattern, with case-sensitivity specified explicitly. The pattern must be expressed in terms of the default wildcard characters_
and%
.- Parameters:
pattern
- A pattern involving the default wildcard characterscaseSensitive
-true
if matching is case-sensitive
-
pattern
static Range<String> pattern(String pattern, boolean caseSensitive, char charWildcard, char stringWildcard) A range containing all strings which match the given pattern, with case-sensitivity specified explicitly. The pattern must be expressed in terms of the given single-character and multi-character wildcards.- Parameters:
pattern
- A pattern involving the given wildcard characterscaseSensitive
-true
if matching is case-sensitivecharWildcard
- A wildcard character which matches any single characterstringWildcard
- A wildcard character which matches any string of characters
-
pattern
A range containing all strings which match the given pattern, with case-sensitivity. The pattern must be expressed in terms of the default wildcard characters_
and%
. -
prefix
A range containing all strings which begin with the given prefix, with case-sensitivity specified explicitly. -
suffix
A range containing all strings which end with the given suffix, with case-sensitivity specified explicitly. -
containing
A range containing all strings which contain the given substring, with case-sensitivity specified explicitly. -
prefix
A range containing all strings which begin with the given prefix, with case-sensitivity. -
suffix
A range containing all strings which end with the given suffix, with case-sensitivity. -
containing
A range containing all strings which contain the given substring, with case-sensitivity. -
empty
An empty range containing no values. -
full
A complete range containing all values of the given type. -
notNull
A range containing all allowed values of the given type exceptnull
.
-