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 afinder method may be declared with typeRange<T> whereT is the type of the matching field or property of the entity.
Method Summary
Modifier and TypeMethodDescriptionstatic <U extendsComparable<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 extendsComparable<U>>
Range<U>greaterThan(U bound) A range containing all values strictly greater than the given lower bound.static <U extendsComparable<U>>
Range<U>greaterThanOrEqualTo(U bound) A range containing all values greater than or equal to the given lower bound.static <U extendsComparable<U>>
Range<U>lessThan(U bound) A range containing all values strictly less than the given upper bound.static <U extendsComparable<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 extendsComparable<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<? extendsU> path,CriteriaBuilder builder) Return a JPA CriteriaPredicateconstraining 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 CriteriaPredicateconstraining 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-trueif 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-trueif 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.