Class Restrictions
java.lang.Object
io.micronaut.data.model.query.factory.Restrictions
Factory for creating criterion instances.
- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryModel.Criterion
Logical OR.static QueryModel.ArrayContains
arrayContains
(String property, Object parameter) Restricts the property to be contained in the array.static QueryModel.Between
Restricts the results by the given property value range.static QueryModel.Contains
Restricts the property match to strings containing the given value.static QueryModel.EndsWith
Restricts the property match to strings ending with the given value.static QueryModel.Equals
Restricts the property to be equal to the given value.static QueryModel.EqualsProperty
eqProperty
(String propertyName, String otherPropertyName) Constraints a property to be equal to a specified other property.geProperty
(String propertyName, String otherPropertyName) Constraints a property to be greater than or equal to a specified other property.static QueryModel.GreaterThan
Used to restrict a value to be greater than the given value.static QueryModel.GreaterThanEquals
Used to restrict a value to be greater than or equal to the given value.gtProperty
(String propertyName, String otherPropertyName) Constraints a property to be greater than a specified other property.static QueryModel.IdEquals
Restricts the property to be equal to the given value.static QueryModel.ILike
Case-insensitive like.static QueryModel.In
in
(String property, QueryModel subquery) Restricts the property to be in the list of given values.static QueryModel.In
Restricts the property to be in the list of given values.static QueryModel.IsEmpty
Used to restrict a value to be empty (such as a blank string or an empty collection).static QueryModel.IsFalse
Used to restrict a value to be false.static QueryModel.IsNotEmpty
isNotEmpty
(String property) Used to restrict a value to be not empty (such as a non-blank string).static QueryModel.IsNotNull
Used to restrict a value to be null.static QueryModel.IsNull
Used to restrict a value to be null.static QueryModel.IsTrue
Used to restrict a value to be true.leProperty
(String propertyName, String otherPropertyName) Constraints a property to be less than or equal to a specified other property.static QueryModel.Like
Restricts the property match the given String expressions.static QueryModel.LessThan
Used to restrict a value to be less than the given value.static QueryModel.LessThanEquals
Used to restrict a value to be less than or equal to the given value.static QueryModel.LessThanProperty
ltProperty
(String propertyName, String otherPropertyName) Constraints a property to be less than a specified other property.static QueryModel.NotEquals
Restricts the property to be not equal to the given value.static QueryModel.NotEqualsProperty
neProperty
(String propertyName, String otherPropertyName) Constraints a property to be not equal to a specified other property.static QueryModel.NotIn
notIn
(String property, QueryModel subquery) Restricts the property to be in the list of given values.static QueryModel.NotIn
Restricts the property to not be in the list of given values.static QueryModel.Criterion
Logical OR.static QueryModel.Regex
Restricts the property match the given regex expressions.static QueryModel.RLike
Restricts the property match the given regular expressions.static QueryModel.SizeEquals
Used to restrict the size of a collection property.Used to restrict the size of a collection property to be greater than or equal to the given value.static QueryModel.SizeGreaterThan
Used to restrict the size of a collection property to be greater than the given value.Creates a Criterion that contrains a collection property to be less than or equal to the given size.static QueryModel.SizeLessThan
Creates a Criterion that contrains a collection property to be less than to the given size.static QueryModel.SizeNotEquals
Creates a Criterion that contrains a collection property to be not equal to the given size.static QueryModel.StartsWith
startsWith
(String property, Object expression) Restricts the property match to strings starting with the given value.static QueryModel.VersionEquals
Restricts the property to be equal to the given value.
-
Constructor Details
-
Restrictions
public Restrictions()
-
-
Method Details
-
eq
Restricts the property to be equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- An instance of Query.Equals
-
idEq
Restricts the property to be equal to the given value.- Parameters:
parameter
- The parameter that provides the value- Returns:
- An instance of Query.Equals
-
versionEq
Restricts the property to be equal to the given value.- Parameters:
parameter
- The parameter that provides the value- Returns:
- An instance of Query.Equals
-
ne
Restricts the property to be not equal to the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- An instance of Query.Equals
-
in
Restricts the property to be in the list of given values.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- An instance of Query.In
-
notIn
Restricts the property to not be in the list of given values.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- An instance of Query.In
-
in
Restricts the property to be in the list of given values.- Parameters:
property
- The propertysubquery
- The subquery- Returns:
- An instance of Query.In
-
notIn
Restricts the property to be in the list of given values.- Parameters:
property
- The propertysubquery
- The subquery- Returns:
- An instance of Query.In
-
like
Restricts the property match the given String expressions. Expressions use SQL-like % to denote wildcards- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.Like
-
regex
Restricts the property match the given regex expressions.- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.Like
-
startsWith
Restricts the property match to strings starting with the given value.- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.StartsWith
-
contains
Restricts the property match to strings containing the given value.- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.Constains
-
endsWith
Restricts the property match to strings ending with the given value.- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.EndsWith
-
ilike
Case-insensitive like.- Parameters:
property
- The propertyexpression
- The expression- Returns:
- An ILike expression
-
rlike
Restricts the property match the given regular expressions.- Parameters:
property
- The property nameexpression
- The expression- Returns:
- An instance of Query.RLike
-
and
Logical OR.- Parameters:
a
- The left criterionb
- The right criterion- Returns:
- The criterion
-
or
Logical OR.- Parameters:
a
- The left criterionb
- The right criterion- Returns:
- The criterion
-
between
Restricts the results by the given property value range.- Parameters:
property
- The name of the propertystart
- The start of the rangeend
- The end of the range- Returns:
- The Between instance
-
gt
Used to restrict a value to be greater than the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The GreaterThan instance
-
lt
Used to restrict a value to be less than the given value.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- The LessThan instance
-
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 LessThan 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 LessThan instance
-
isNull
Used to restrict a value to be null.- Parameters:
property
- The property name- Returns:
- The IsNull instance
-
isEmpty
Used to restrict a value to be empty (such as a blank string or an empty collection).- Parameters:
property
- The property name- Returns:
- The IsEmpty instance
-
isNotEmpty
Used to restrict a value to be not empty (such as a non-blank string).- Parameters:
property
- The property name- Returns:
- The IsEmpty instance
-
isNotNull
Used to restrict a value to be null.- Parameters:
property
- The property name- Returns:
- The IsNull instance
-
isTrue
Used to restrict a value to be true.- Parameters:
property
- The property name- Returns:
- The true instance
-
isFalse
Used to restrict a value to be false.- Parameters:
property
- The property name- Returns:
- The true instance
-
sizeEq
Used to restrict the size of a collection property.- Parameters:
property
- The propertysize
- The size to restrict- Returns:
- The result
-
sizeGt
Used to restrict the size of a collection property to be greater than the given value.- Parameters:
property
- The propertysize
- The size to restrict- Returns:
- The result
-
sizeGe
Used to restrict the size of a collection property to be greater than or equal to the given value.- Parameters:
property
- The propertysize
- The size to restrict- Returns:
- The result
-
sizeLe
Creates a Criterion that contrains a collection property to be less than or equal to the given size.- Parameters:
property
- The property namesize
- The size to constrain by- Returns:
- A Criterion instance
-
sizeLt
Creates a Criterion that contrains a collection property to be less than to the given size.- Parameters:
property
- The property namesize
- The size to constrain by- Returns:
- A Criterion instance
-
sizeNe
Creates a Criterion that contrains a collection property to be not equal to the given size.- Parameters:
property
- The property namesize
- The size to constrain by- Returns:
- A Criterion instance
-
eqProperty
Constraints a property to be equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- The criterion instance
-
neProperty
public static QueryModel.NotEqualsProperty neProperty(String propertyName, String otherPropertyName) Constraints a property to be not equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- This criterion instance
-
gtProperty
public static QueryModel.GreaterThanProperty gtProperty(String propertyName, String otherPropertyName) Constraints a property to be greater than a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- The criterion
-
geProperty
public static QueryModel.GreaterThanEqualsProperty geProperty(String propertyName, String otherPropertyName) Constraints a property to be greater than or equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- The criterion
-
ltProperty
Constraints a property to be less than a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- The criterion
-
leProperty
public static QueryModel.LessThanEqualsProperty leProperty(String propertyName, String otherPropertyName) Constraints a property to be less than or equal to a specified other property.- Parameters:
propertyName
- The propertyotherPropertyName
- The other property- Returns:
- The criterion
-
arrayContains
Restricts the property to be contained in the array.- Parameters:
property
- The propertyparameter
- The parameter that provides the value- Returns:
- An instance of Query.ArrayContains
-