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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Criteria
allEq(java.util.Map<java.lang.String,java.lang.Object> propertyValues)
Apply an "equals" constraint to each property in the key set of a Map.Criteria
and(Criteria other)
Creates a logical conjunction.Criteria
between(java.lang.String propertyName, java.lang.Object start, java.lang.Object finish)
Restricts the results by the given property value range (inclusive).Criteria
contains(java.lang.String propertyName, java.lang.Object parameter)
Restricts the property match to strings containing with the given value.Criteria
endsWith(java.lang.String propertyName, java.lang.Object parameter)
Restricts the property match to strings ending with the given value.Criteria
eq(java.lang.String propertyName, java.lang.Object parameter)
Creates an "equals" Criterion based on the specified property name and value.Criteria
eqAll(java.lang.String propertyName, Criteria propertyValue)
Creates a subquery criterion that ensures the given property is equals to all the given returned values.Criteria
eqProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be equal to a specified other property.Criteria
ge(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be greater than or equal to the given value.Criteria
geAll(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.Criteria
geProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be greater than or equal to a specified other property.Criteria
geSome(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.Criteria
gt(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be greater than or equal to the given value.Criteria
gtAll(java.lang.String propertyName, Criteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than all the given returned values.Criteria
gte(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be greater than or equal to the given value.Criteria
gtProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be greater than a specified other property.Criteria
gtSome(java.lang.String propertyName, Criteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than some of the given values.Criteria
idEq(java.lang.Object parameter)
Creates an "equals" Criterion based on the specified property name and value.Criteria
ilike(java.lang.String propertyName, java.lang.Object parameter)
Creates an ilike Criterion based on the specified property name and value.Criteria
inList(java.lang.String propertyName, QueryModel subquery)
Creates an "in" Criterion using a subquery.Criteria
inList(java.lang.String propertyName, java.lang.Object parameter)
Creates an "in" Criterion based on the specified property name and list of values.Criteria
isEmpty(java.lang.String propertyName)
Creates a criterion that asserts the given property is empty (such as a blank string).Criteria
isFalse(java.lang.String propertyName)
Creates a criterion that asserts the given property is false.Criteria
isNotEmpty(java.lang.String propertyName)
Creates a criterion that asserts the given property is not empty.Criteria
isNotNull(java.lang.String propertyName)
Creates a criterion that asserts the given property is not null.Criteria
isNull(java.lang.String propertyName)
Creates a criterion that asserts the given property is null.Criteria
isTrue(java.lang.String propertyName)
Creates a criterion that asserts the given property is true.Criteria
le(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be less than or equal to the given value.Criteria
leAll(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.Criteria
leProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be less than or equal to a specified other property.Criteria
leSome(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.Criteria
like(java.lang.String propertyName, java.lang.Object parameter)
Creates a like Criterion based on the specified property name and value.Criteria
lt(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be less than or equal to the given value.Criteria
ltAll(java.lang.String propertyName, Criteria propertyValue)
Creates a subquery criterion that ensures the given property is less than all the given returned values.Criteria
lte(java.lang.String property, java.lang.Object parameter)
Used to restrict a value to be less than or equal to the given value.Criteria
ltProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be less than a specified other property.Criteria
ltSome(java.lang.String propertyName, Criteria propertyValue)
Creates a subquery criterion that ensures the given property is less than some of the given values.Criteria
ne(java.lang.String propertyName, java.lang.Object parameter)
Creates a "not equals" Criterion based on the specified property name and value.Criteria
neProperty(java.lang.String propertyName, java.lang.String otherPropertyName)
Constrains a property to be not equal to a specified other property.Criteria
not(Criteria other)
Creates a logical negation.Criteria
notIn(java.lang.String propertyName, QueryModel subquery)
Creates a negated "in" Criterion using a subquery.Criteria
or(Criteria other)
Creates a logical disjunction.Criteria
rlike(java.lang.String propertyName, java.lang.Object parameter)
Creates an rlike Criterion based on the specified property name and value.Criteria
sizeEq(java.lang.String propertyName, java.lang.Object size)
Creates a Criterion that constrains a collection property by size.Criteria
sizeGe(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.Criteria
sizeGt(java.lang.String propertyName, java.lang.Object size)
Creates a Criterion that constrains a collection property to be greater than the given size.Criteria
sizeLe(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.Criteria
sizeLt(java.lang.String propertyName, java.lang.Object size)
Creates a Criterion that constrains a collection property to be less than to the given size.Criteria
sizeNe(java.lang.String propertyName, java.lang.Object size)
Creates a Criterion that constrains a collection property to be not equal to the given size.Criteria
startsWith(java.lang.String propertyName, java.lang.Object parameter)
Restricts the property match to strings starting with the given value.Criteria
versionEq(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
-
-