Package io.micronaut.data.model.query
Interface Criteria
-
- All Known Subinterfaces:
QueryModel
- All Known Implementing Classes:
AssociationQuery,DefaultQuery
public interface CriteriaInterface 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CriteriaallEq(java.util.Map<java.lang.String,java.lang.Object> propertyValues)Apply an "equals" constraint to each property in the key set of a Map.Criteriaand(Criteria other)Creates a logical conjunction.Criteriabetween(java.lang.String propertyName, java.lang.Object start, java.lang.Object finish)Restricts the results by the given property value range (inclusive).Criteriacontains(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings containing with the given value.CriteriaendsWith(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings ending with the given value.Criteriaeq(java.lang.String propertyName, java.lang.Object parameter)Creates an "equals" Criterion based on the specified property name and value.CriteriaeqAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is equals to all the given returned values.CriteriaeqProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be equal to a specified other property.Criteriage(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be greater than or equal to the given value.CriteriageAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.CriteriageProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be greater than or equal to a specified other property.CriteriageSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values.Criteriagt(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be greater than or equal to the given value.CriteriagtAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values.Criteriagte(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be greater than or equal to the given value.CriteriagtProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be greater than a specified other property.CriteriagtSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than some of the given values.CriteriaidEq(java.lang.Object parameter)Creates an "equals" Criterion based on the specified property name and value.Criteriailike(java.lang.String propertyName, java.lang.Object parameter)Creates an ilike Criterion based on the specified property name and value.CriteriainList(java.lang.String propertyName, QueryModel subquery)Creates an "in" Criterion using a subquery.CriteriainList(java.lang.String propertyName, java.lang.Object parameter)Creates an "in" Criterion based on the specified property name and list of values.CriteriaisEmpty(java.lang.String propertyName)Creates a criterion that asserts the given property is empty (such as a blank string).CriteriaisFalse(java.lang.String propertyName)Creates a criterion that asserts the given property is false.CriteriaisNotEmpty(java.lang.String propertyName)Creates a criterion that asserts the given property is not empty.CriteriaisNotNull(java.lang.String propertyName)Creates a criterion that asserts the given property is not null.CriteriaisNull(java.lang.String propertyName)Creates a criterion that asserts the given property is null.CriteriaisTrue(java.lang.String propertyName)Creates a criterion that asserts the given property is true.Criteriale(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be less than or equal to the given value.CriterialeAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than or equal to all the given returned values.CriterialeProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be less than or equal to a specified other property.CriterialeSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than or equal to some of the given values.Criterialike(java.lang.String propertyName, java.lang.Object parameter)Creates a like Criterion based on the specified property name and value.Criterialt(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be less than or equal to the given value.CriterialtAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values.Criterialte(java.lang.String property, java.lang.Object parameter)Used to restrict a value to be less than or equal to the given value.CriterialtProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be less than a specified other property.CriterialtSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than some of the given values.Criteriane(java.lang.String propertyName, java.lang.Object parameter)Creates a "not equals" Criterion based on the specified property name and value.CriterianeProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be not equal to a specified other property.Criterianot(Criteria other)Creates a logical negation.CriterianotIn(java.lang.String propertyName, QueryModel subquery)Creates a negated "in" Criterion using a subquery.Criteriaor(Criteria other)Creates a logical disjunction.Criteriarlike(java.lang.String propertyName, java.lang.Object parameter)Creates an rlike Criterion based on the specified property name and value.CriteriasizeEq(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property by size.CriteriasizeGe(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be greater than or equal to the given size.CriteriasizeGt(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be greater than the given size.CriteriasizeLe(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be less than or equal to the given size.CriteriasizeLt(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be less than to the given size.CriteriasizeNe(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be not equal to the given size.CriteriastartsWith(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings starting with the given value.CriteriaversionEq(java.lang.Object parameter)Creates that restricts the version to the given value.
-
-
-
Method Detail
-
idEq
@NonNull Criteria idEq(java.lang.Object parameter)
Creates an "equals" Criterion based on the specified property name and value.- Parameters:
parameter- The parameter that provides the value- Returns:
- The criteria
-
versionEq
@NonNull Criteria versionEq(java.lang.Object parameter)
Creates that restricts the version to the given value.- Parameters:
parameter- The parameter that provides the value- Returns:
- The criteria
-
isEmpty
@NonNull Criteria isEmpty(@NonNull java.lang.String propertyName)
Creates a criterion that asserts the given property is empty (such as a blank string).- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isNotEmpty
@NonNull Criteria isNotEmpty(@NonNull java.lang.String propertyName)
Creates a criterion that asserts the given property is not empty.- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isNull
@NonNull Criteria isNull(@NonNull java.lang.String propertyName)
Creates a criterion that asserts the given property is null.- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isTrue
@NonNull Criteria isTrue(@NonNull java.lang.String propertyName)
Creates a criterion that asserts the given property is true.- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isFalse
@NonNull Criteria isFalse(@NonNull java.lang.String propertyName)
Creates a criterion that asserts the given property is false.- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isNotNull
@NonNull Criteria isNotNull(java.lang.String propertyName)
Creates a criterion that asserts the given property is not null.- Parameters:
propertyName- The property name- Returns:
- The criteria
-
eq
@NonNull Criteria eq(java.lang.String propertyName, java.lang.Object parameter)
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
@NonNull Criteria ne(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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 java.lang.String propertyName, @NonNull java.lang.Object start, @NonNull java.lang.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
@NonNull Criteria gte(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria ge(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria gt(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria lte(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria le(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria lt(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
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
@NonNull Criteria like(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria startsWith(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria endsWith(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria contains(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria ilike(@NonNull java.lang.String propertyName, @NonNull java.lang.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 nameparameter- The parameter that provides the value- Returns:
- The criteria
-
rlike
@NonNull Criteria rlike(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria and(@NonNull Criteria other)
Creates a logical conjunction.- Parameters:
other- The other criteria- Returns:
- This criteria
-
or
@NonNull Criteria or(@NonNull Criteria other)
Creates a logical disjunction.- Parameters:
other- The other criteria- Returns:
- This criteria
-
not
@NonNull Criteria not(@NonNull Criteria other)
Creates a logical negation.- Parameters:
other- The other criteria- Returns:
- This criteria
-
inList
@NonNull Criteria inList(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Creates an "in" Criterion using a subquery.- Parameters:
propertyName- The property namesubquery- The subquery- Returns:
- The criteria
-
inList
@NonNull Criteria inList(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
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
@NonNull Criteria notIn(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Creates a negated "in" Criterion using a subquery.- Parameters:
propertyName- The property namesubquery- The subquery- Returns:
- The criteria
-
sizeEq
@NonNull Criteria sizeEq(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Creates a Criterion that constrains a collection property by size.- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeGt
@NonNull Criteria sizeGt(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
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
@NonNull Criteria sizeGe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
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
@NonNull Criteria sizeLe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
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
@NonNull Criteria sizeLt(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
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
@NonNull Criteria sizeNe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
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
@NonNull Criteria eqProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Constrains a property to be equal to a specified other property.- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
neProperty
@NonNull Criteria neProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Constrains a property to be not equal to a specified other property.- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
gtProperty
@NonNull Criteria gtProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Constrains a property to be greater than a specified other property.- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
geProperty
@NonNull Criteria geProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
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
@NonNull Criteria ltProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Constrains a property to be less than a specified other property.- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
leProperty
@NonNull Criteria leProperty(java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
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
@NonNull Criteria allEq(@NonNull java.util.Map<java.lang.String,java.lang.Object> propertyValues)
Apply an "equals" constraint to each property in the key set of a Map.- Parameters:
propertyValues- a map from property names to values- Returns:
- Criterion
-
eqAll
@NonNull Criteria eqAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
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
@NonNull Criteria gtAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
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
@NonNull Criteria ltAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
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
@NonNull Criteria geAll(@NonNull java.lang.String propertyName, @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 namepropertyValue- A subquery- Returns:
- This criterion instance
-
leAll
@NonNull Criteria leAll(@NonNull java.lang.String propertyName, @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 namepropertyValue- A subquery- Returns:
- This criterion instance
-
gtSome
@NonNull Criteria gtSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
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
@NonNull Criteria geSome(@NonNull java.lang.String propertyName, @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 namepropertyValue- The property value- Returns:
- This Criteria instance
-
ltSome
@NonNull Criteria ltSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
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
@NonNull Criteria leSome(@NonNull java.lang.String propertyName, @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 namepropertyValue- The property value- Returns:
- This Criteria instance
-
-