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 SummaryModifier and TypeMethodDescription@NonNull CriteriaApply an "equals" constraint to each property in the key set of aMap.@NonNull CriteriaCreates a logical conjunction.@NonNull CriteriaRestricts the results by the given property value range (inclusive).@NonNull CriteriaRestricts the property match to strings containing with the given value.@NonNull CriteriaRestricts the property match to strings ending with the given value.@NonNull CriteriaCreates an "equals" Criterion based on the specified property name and value.@NonNull CriteriaCreates a subquery criterion that ensures the given property is equals to all the given returned values.@NonNull CriteriaeqProperty(String propertyName, String otherPropertyName) Constrains a property to be equal to a specified other property.@NonNull CriteriaUsed to restrict a value to be greater than or equal to the given value.@NonNull CriteriaCreates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.@NonNull CriteriageProperty(String propertyName, String otherPropertyName) Constrains a property to be greater than or equal to a specified other property.@NonNull CriteriaCreates a subquery criterion that ensures the given property is greater than or equal to some of the given values.@NonNull CriteriaUsed to restrict a value to be greater than or equal to the given value.@NonNull CriteriaCreates a subquery criterion that ensures the given property is greater than all the given returned values.@NonNull CriteriaUsed to restrict a value to be greater than or equal to the given value.@NonNull CriteriagtProperty(String propertyName, String otherPropertyName) Constrains a property to be greater than a specified other property.@NonNull CriteriaCreates a subquery criterion that ensures the given property is greater than some of the given values.@NonNull CriteriaCreates an "equals" Criterion based on the specified property name and value.@NonNull CriteriaCreates an ilike Criterion based on the specified property name and value.@NonNull CriteriainList(@NonNull String propertyName, @NonNull QueryModel subquery) Creates an "in" Criterion using a subquery.@NonNull CriteriaCreates an "in" Criterion based on the specified property name and list of values.@NonNull CriteriaCreates a criterion that asserts the given property is empty (such as a blank string).@NonNull CriteriaCreates a criterion that asserts the given property is false.@NonNull CriteriaisNotEmpty(@NonNull String propertyName) Creates a criterion that asserts the given property is not empty.@NonNull CriteriaCreates a criterion that asserts the given property is not null.@NonNull CriteriaCreates a criterion that asserts the given property is null.@NonNull CriteriaCreates a criterion that asserts the given property is true.@NonNull CriteriaUsed to restrict a value to be less than or equal to the given value.@NonNull CriteriaCreates a subquery criterion that ensures the given property is less than or equal to all the given returned values.@NonNull CriterialeProperty(String propertyName, String otherPropertyName) Constrains a property to be less than or equal to a specified other property.@NonNull CriteriaCreates a subquery criterion that ensures the given property is less than or equal to some of the given values.@NonNull CriteriaCreates a like Criterion based on the specified property name and value.@NonNull CriteriaUsed to restrict a value to be less than or equal to the given value.@NonNull CriteriaCreates a subquery criterion that ensures the given property is less than all the given returned values.@NonNull CriteriaUsed to restrict a value to be less than or equal to the given value.@NonNull CriterialtProperty(String propertyName, String otherPropertyName) Constrains a property to be less than a specified other property.@NonNull CriteriaCreates a subquery criterion that ensures the given property is less than some of the given values.@NonNull CriteriaCreates a "not equals" Criterion based on the specified property name and value.@NonNull CriterianeProperty(String propertyName, String otherPropertyName) Constrains a property to be not equal to a specified other property.@NonNull CriteriaCreates a logical negation.@NonNull CriterianotIn(@NonNull String propertyName, @NonNull QueryModel subquery) Creates a negated "in" Criterion using a subquery.@NonNull CriteriaCreates a logical disjunction.@NonNull CriteriaCreates an rlike Criterion based on the specified property name and value.@NonNull CriteriaCreates a Criterion that constrains a collection property by size.@NonNull CriteriaCreates a Criterion that constrains a collection property to be greater than or equal to the given size.@NonNull CriteriaCreates a Criterion that constrains a collection property to be greater than the given size.@NonNull CriteriaCreates a Criterion that constrains a collection property to be less than or equal to the given size.@NonNull CriteriaCreates a Criterion that constrains a collection property to be less than to the given size.@NonNull CriteriaCreates a Criterion that constrains a collection property to be not equal to the given size.@NonNull CriteriastartsWith(@NonNull String propertyName, @NonNull Object parameter) Restricts the property match to strings starting with the given value.@NonNull CriteriaCreates that restricts the version to the given value.
- 
Method Details- 
idEqCreates an "equals" Criterion based on the specified property name and value.- Parameters:
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
versionEqCreates that restricts the version to the given value.- Parameters:
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
isEmptyCreates a criterion that asserts the given property is empty (such as a blank string).- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
isNotEmptyCreates a criterion that asserts the given property is not empty.- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
isNullCreates a criterion that asserts the given property is null.- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
isTrueCreates a criterion that asserts the given property is true.- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
isFalseCreates a criterion that asserts the given property is false.- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
isNotNullCreates a criterion that asserts the given property is not null.- Parameters:
- propertyName- The property name
- Returns:
- The criteria
 
- 
eqCreates an "equals" Criterion based on the specified property name and value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
ne@NonNull @NonNull Criteria ne(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Creates a "not equals" Criterion based on the specified property name and value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
between@NonNull @NonNull Criteria between(@NonNull @NonNull String propertyName, @NonNull @NonNull Object start, @NonNull @NonNull Object finish) Restricts the results by the given property value range (inclusive).- Parameters:
- propertyName- The property name
- start- The start of the range
- finish- The end of the range
- Returns:
- The criteria
 
- 
gte@NonNull @NonNull Criteria gte(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be greater than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
ge@NonNull @NonNull Criteria ge(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be greater than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
gt@NonNull @NonNull Criteria gt(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be greater than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
lte@NonNull @NonNull Criteria lte(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be less than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
le@NonNull @NonNull Criteria le(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be less than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
lt@NonNull @NonNull Criteria lt(@NonNull @NonNull String property, @NonNull @NonNull Object parameter) Used to restrict a value to be less than or equal to the given value.- Parameters:
- property- The property
- parameter- The parameter that provides the value
- Returns:
- The Criterion instance
 
- 
like@NonNull @NonNull Criteria like(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Creates a like Criterion based on the specified property name and value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
startsWith@NonNull @NonNull Criteria startsWith(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Restricts the property match to strings starting with the given value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
endsWith@NonNull @NonNull Criteria endsWith(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Restricts the property match to strings ending with the given value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
contains@NonNull @NonNull Criteria contains(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Restricts the property match to strings containing with the given value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
ilike@NonNull @NonNull Criteria ilike(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Creates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
rlike@NonNull @NonNull Criteria rlike(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Creates an rlike Criterion based on the specified property name and value.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
andCreates a logical conjunction.- Parameters:
- other- The other criteria
- Returns:
- This criteria
 
- 
orCreates a logical disjunction.- Parameters:
- other- The other criteria
- Returns:
- This criteria
 
- 
notCreates a logical negation.- Parameters:
- other- The other criteria
- Returns:
- This criteria
 
- 
inList@NonNull @NonNull Criteria inList(@NonNull @NonNull String propertyName, @NonNull @NonNull QueryModel subquery) Creates an "in" Criterion using a subquery.- Parameters:
- propertyName- The property name
- subquery- The subquery
- Returns:
- The criteria
 
- 
inList@NonNull @NonNull Criteria inList(@NonNull @NonNull String propertyName, @NonNull @NonNull Object parameter) Creates an "in" Criterion based on the specified property name and list of values.- Parameters:
- propertyName- The property name
- parameter- The parameter that provides the value
- Returns:
- The criteria
 
- 
notIn@NonNull @NonNull Criteria notIn(@NonNull @NonNull String propertyName, @NonNull @NonNull QueryModel subquery) Creates a negated "in" Criterion using a subquery.- Parameters:
- propertyName- The property name
- subquery- The subquery
- Returns:
- The criteria
 
- 
sizeEq@NonNull @NonNull Criteria sizeEq(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property by size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
sizeGt@NonNull @NonNull Criteria sizeGt(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property to be greater than the given size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
sizeGe@NonNull @NonNull Criteria sizeGe(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property to be greater than or equal to the given size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
sizeLe@NonNull @NonNull Criteria sizeLe(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property to be less than or equal to the given size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
sizeLt@NonNull @NonNull Criteria sizeLt(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property to be less than to the given size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
sizeNe@NonNull @NonNull Criteria sizeNe(@NonNull @NonNull String propertyName, @NonNull @NonNull Object size) Creates a Criterion that constrains a collection property to be not equal to the given size.- Parameters:
- propertyName- The property name
- size- The size to constrain by
- Returns:
- This criteria
 
- 
eqProperty@NonNull @NonNull Criteria eqProperty(@NonNull String propertyName, @NonNull String otherPropertyName) Constrains a property to be equal to a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
neProperty@NonNull @NonNull Criteria neProperty(@NonNull String propertyName, @NonNull String otherPropertyName) Constrains a property to be not equal to a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
gtProperty@NonNull @NonNull Criteria gtProperty(@NonNull String propertyName, @NonNull String otherPropertyName) Constrains a property to be greater than a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
geProperty@NonNull @NonNull Criteria geProperty(@NonNull String propertyName, @NonNull String otherPropertyName) Constrains a property to be greater than or equal to a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
ltProperty@NonNull @NonNull Criteria ltProperty(@NonNull String propertyName, @NonNull String otherPropertyName) Constrains a property to be less than a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
lePropertyConstrains a property to be less than or equal to a specified other property.- Parameters:
- propertyName- The property
- otherPropertyName- The other property
- Returns:
- This criteria
 
- 
allEqApply an "equals" constraint to each property in the key set of aMap.- Parameters:
- propertyValues- a map from property names to values
- Returns:
- Criterion
 
- 
eqAll@NonNull @NonNull Criteria eqAll(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is equals to all the given returned values.- Parameters:
- propertyName- The property name
- propertyValue- A subquery
- Returns:
- This criterion instance
 
- 
gtAll@NonNull @NonNull Criteria gtAll(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is greater than all the given returned values.- Parameters:
- propertyName- The property name
- propertyValue- A subquery
- Returns:
- This criterion instance
 
- 
ltAll@NonNull @NonNull Criteria ltAll(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is less than all the given returned values.- Parameters:
- propertyName- The property name
- propertyValue- A subquery
- Returns:
- This criterion instance
 
- 
geAll@NonNull @NonNull Criteria geAll(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.- Parameters:
- propertyName- The property name
- propertyValue- A subquery
- Returns:
- This criterion instance
 
- 
leAll@NonNull @NonNull Criteria leAll(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.- Parameters:
- propertyName- The property name
- propertyValue- A subquery
- Returns:
- This criterion instance
 
- 
gtSome@NonNull @NonNull Criteria gtSome(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is greater than some of the given values.- Parameters:
- propertyName- The property name
- propertyValue- The property value
- Returns:
- This Criteria instance
 
- 
geSome@NonNull @NonNull Criteria geSome(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.- Parameters:
- propertyName- The property name
- propertyValue- The property value
- Returns:
- This Criteria instance
 
- 
ltSome@NonNull @NonNull Criteria ltSome(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is less than some of the given values.- Parameters:
- propertyName- The property name
- propertyValue- The property value
- Returns:
- This Criteria instance
 
- 
leSome@NonNull @NonNull Criteria leSome(@NonNull @NonNull String propertyName, @NonNull @NonNull Criteria propertyValue) Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.- Parameters:
- propertyName- The property name
- propertyValue- The property value
- Returns:
- This Criteria instance
 
 
-