Package io.micronaut.data.model.query
Interface Criteria
- All Known Subinterfaces:
QueryModel
- All Known Implementing Classes:
AssociationQuery
,DefaultQuery
public interface Criteria
Interface used for the construction of queries at compilation time an implementation may optionally
provide an implementation of this at runtime.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionApply an "equals" constraint to each property in the key set of aMap
.Creates a logical conjunction.Restricts the results by the given property value range (inclusive).Restricts the property match to strings containing with the given value.Restricts the property match to strings ending with the given value.Creates an "equals" Criterion based on the specified property name and value.Creates a subquery criterion that ensures the given property is equals to all the given returned values.eqProperty
(String propertyName, String otherPropertyName) Constrains a property to be equal to a specified other property.Used to restrict a value to be greater than or equal to the given value.Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.geProperty
(String propertyName, String otherPropertyName) Constrains a property to be greater than or equal to a specified other property.Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.Used to restrict a value to be greater than or equal to the given value.Creates a subquery criterion that ensures the given property is greater than all the given returned values.Used to restrict a value to be greater than or equal to the given value.gtProperty
(String propertyName, String otherPropertyName) Constrains a property to be greater than a specified other property.Creates a subquery criterion that ensures the given property is greater than some of the given values.Creates an "equals" Criterion based on the specified property name and value.Creates an ilike Criterion based on the specified property name and value.inList
(String propertyName, QueryModel subquery) Creates an "in" Criterion using a subquery.Creates an "in" Criterion based on the specified property name and list of values.Creates a criterion that asserts the given property is empty (such as a blank string).Creates a criterion that asserts the given property is false.isNotEmpty
(String propertyName) Creates a criterion that asserts the given property is not empty.Creates a criterion that asserts the given property is not null.Creates a criterion that asserts the given property is null.Creates a criterion that asserts the given property is true.Used to restrict a value to be less than or equal to the given value.Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.leProperty
(String propertyName, String otherPropertyName) Constrains a property to be less than or equal to a specified other property.Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.Creates a like Criterion based on the specified property name and value.Used to restrict a value to be less than or equal to the given value.Creates a subquery criterion that ensures the given property is less than all the given returned values.Used to restrict a value to be less than or equal to the given value.ltProperty
(String propertyName, String otherPropertyName) Constrains a property to be less than a specified other property.Creates a subquery criterion that ensures the given property is less than some of the given values.Creates a "not equals" Criterion based on the specified property name and value.neProperty
(String propertyName, String otherPropertyName) Constrains a property to be not equal to a specified other property.Creates a logical negation.notIn
(String propertyName, QueryModel subquery) Creates a negated "in" Criterion using a subquery.Creates a logical disjunction.Creates an rlike Criterion based on the specified property name and value.Creates a Criterion that constrains a collection property by size.Creates a Criterion that constrains a collection property to be greater than or equal to the given size.Creates a Criterion that constrains a collection property to be greater than the given size.Creates a Criterion that constrains a collection property to be less than or equal to the given size.Creates a Criterion that constrains a collection property to be less than to the given size.Creates a Criterion that constrains a collection property to be not equal to the given size.startsWith
(String propertyName, Object parameter) Restricts the property match to strings starting with the given value.Creates that restricts the version to the given value.
-
Method Details
-
idEq
Creates an "equals" Criterion based on the specified property name and value.- Parameters:
parameter
- The parameter that provides the value- Returns:
- The criteria
-
versionEq
Creates that restricts the version to the given value.- Parameters:
parameter
- The parameter that provides the value- Returns:
- The criteria
-
isEmpty
Creates a criterion that asserts the given property is empty (such as a blank string).- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
isNotEmpty
Creates a criterion that asserts the given property is not empty.- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
isNull
Creates a criterion that asserts the given property is null.- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
isTrue
Creates a criterion that asserts the given property is true.- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
isFalse
Creates a criterion that asserts the given property is false.- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
isNotNull
Creates a criterion that asserts the given property is not null.- Parameters:
propertyName
- The property name- Returns:
- The criteria
-
eq
Creates an "equals" Criterion based on the specified property name and value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
ne
Creates a "not equals" Criterion based on the specified property name and value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
between
@NonNull Criteria between(@NonNull String propertyName, @NonNull Object start, @NonNull Object finish) Restricts the results by the given property value range (inclusive).- Parameters:
propertyName
- The property namestart
- The start of the rangefinish
- The end of the range- Returns:
- The criteria
-
gte
Used to restrict a value to be greater than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
ge
Used to restrict a value to be greater than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
gt
Used to restrict a value to be greater than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
lte
Used to restrict a value to be less than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
le
Used to restrict a value to be less than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
lt
Used to restrict a value to be less than or equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The Criterion instance
-
like
Creates a like Criterion based on the specified property name and value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
startsWith
Restricts the property match to strings starting with the given value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
endsWith
Restricts the property match to strings ending with the given value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
contains
Restricts the property match to strings containing with the given value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
ilike
Creates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
rlike
Creates an rlike Criterion based on the specified property name and value.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
and
Creates a logical conjunction.- Parameters:
other
- The other criteria- Returns:
- This criteria
-
or
Creates a logical disjunction.- Parameters:
other
- The other criteria- Returns:
- This criteria
-
not
Creates a logical negation.- Parameters:
other
- The other criteria- Returns:
- This criteria
-
inList
Creates an "in" Criterion using a subquery.- Parameters:
propertyName
- The property namesubquery
- The subquery- Returns:
- The criteria
-
inList
Creates an "in" Criterion based on the specified property name and list of values.- Parameters:
propertyName
- The property nameparameter
- The parameter that provides the value- Returns:
- The criteria
-
notIn
Creates a negated "in" Criterion using a subquery.- Parameters:
propertyName
- The property namesubquery
- The subquery- Returns:
- The criteria
-
sizeEq
Creates a Criterion that constrains a collection property by size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
sizeGt
Creates a Criterion that constrains a collection property to be greater than the given size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
sizeGe
Creates a Criterion that constrains a collection property to be greater than or equal to the given size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
sizeLe
Creates a Criterion that constrains a collection property to be less than or equal to the given size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
sizeLt
Creates a Criterion that constrains a collection property to be less than to the given size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
sizeNe
Creates a Criterion that constrains a collection property to be not equal to the given size.- Parameters:
propertyName
- The property namesize
- The size to constrain by- Returns:
- This criteria
-
eqProperty
Constrains a property to be equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
neProperty
Constrains a property to be not equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
gtProperty
Constrains a property to be greater than a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
geProperty
Constrains a property to be greater than or equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
ltProperty
Constrains a property to be less than a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
leProperty
Constrains a property to be less than or equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criteria
-
allEq
Apply an "equals" constraint to each property in the key set of aMap
.- Parameters:
propertyValues
- a map from property names to values- Returns:
- Criterion
-
eqAll
Creates a subquery criterion that ensures the given property is equals to all the given returned values.- Parameters:
propertyName
- The property namepropertyValue
- A subquery- Returns:
- This criterion instance
-
gtAll
Creates a subquery criterion that ensures the given property is greater than all the given returned values.- Parameters:
propertyName
- The property namepropertyValue
- A subquery- Returns:
- This criterion instance
-
ltAll
Creates a subquery criterion that ensures the given property is less than all the given returned values.- Parameters:
propertyName
- The property namepropertyValue
- A subquery- Returns:
- This criterion instance
-
geAll
Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.- Parameters:
propertyName
- The property namepropertyValue
- A subquery- Returns:
- This criterion instance
-
leAll
Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.- Parameters:
propertyName
- The property namepropertyValue
- A subquery- Returns:
- This criterion instance
-
gtSome
Creates a subquery criterion that ensures the given property is greater than some of the given values.- Parameters:
propertyName
- The property namepropertyValue
- The property value- Returns:
- This Criteria instance
-
geSome
Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.- Parameters:
propertyName
- The property namepropertyValue
- The property value- Returns:
- This Criteria instance
-
ltSome
Creates a subquery criterion that ensures the given property is less than some of the given values.- Parameters:
propertyName
- The property namepropertyValue
- The property value- Returns:
- This Criteria instance
-
leSome
Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.- Parameters:
propertyName
- The property namepropertyValue
- The property value- Returns:
- This Criteria instance
-