Package io.micronaut.data.model.query
Class DefaultQuery
- java.lang.Object
-
- io.micronaut.data.model.query.DefaultQuery
-
- All Implemented Interfaces:
Criteria,QueryModel
- Direct Known Subclasses:
AssociationQuery
public class DefaultQuery extends java.lang.Object implements QueryModel
Models a query that can be executed against a data store.- Since:
- 1.0
- Author:
- Graeme Rocher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.micronaut.data.model.query.QueryModel
QueryModel.AvgProjection, QueryModel.Between, QueryModel.Conjunction, QueryModel.Contains, QueryModel.CountDistinctProjection, QueryModel.CountProjection, QueryModel.Criterion, QueryModel.Disjunction, QueryModel.DistinctProjection, QueryModel.DistinctPropertyProjection, QueryModel.EndsWith, QueryModel.Equals, QueryModel.EqualsAll, QueryModel.EqualsProperty, QueryModel.Exists, QueryModel.GreaterThan, QueryModel.GreaterThanAll, QueryModel.GreaterThanEquals, QueryModel.GreaterThanEqualsAll, QueryModel.GreaterThanEqualsProperty, QueryModel.GreaterThanEqualsSome, QueryModel.GreaterThanProperty, QueryModel.GreaterThanSome, QueryModel.GroupPropertyProjection, QueryModel.IdEquals, QueryModel.IdProjection, QueryModel.ILike, QueryModel.In, QueryModel.IsEmpty, QueryModel.IsFalse, QueryModel.IsNotEmpty, QueryModel.IsNotNull, QueryModel.IsNull, QueryModel.IsTrue, QueryModel.Junction, QueryModel.LessThan, QueryModel.LessThanAll, QueryModel.LessThanEquals, QueryModel.LessThanEqualsAll, QueryModel.LessThanEqualsProperty, QueryModel.LessThanEqualsSome, QueryModel.LessThanProperty, QueryModel.LessThanSome, QueryModel.Like, QueryModel.LiteralProjection, QueryModel.MaxProjection, QueryModel.MinProjection, QueryModel.Negation, QueryModel.NotEquals, QueryModel.NotEqualsAll, QueryModel.NotEqualsProperty, QueryModel.NotExists, QueryModel.NotIn, QueryModel.Projection, QueryModel.PropertyComparisonCriterion, QueryModel.PropertyCriterion, QueryModel.PropertyNameCriterion, QueryModel.PropertyProjection, QueryModel.Regex, QueryModel.RLike, QueryModel.SizeEquals, QueryModel.SizeGreaterThan, QueryModel.SizeGreaterThanEquals, QueryModel.SizeLessThan, QueryModel.SizeLessThanEquals, QueryModel.SizeNotEquals, QueryModel.StartsWith, QueryModel.SubqueryCriterion, QueryModel.SumProjection, QueryModel.VersionEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultQuery(PersistentEntity entity)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryModeladd(QueryModel.Criterion criterion)Adds the specified criterion instance to the query.DefaultQueryallEq(java.util.Map<java.lang.String,java.lang.Object> values)Shortcut to restrict the query to multiple given property values.QueryModeland(Criteria other)Creates a logical conjunction.DefaultQueryand(QueryModel.Criterion a, QueryModel.Criterion b)Creates a conjunction using two specified criterion.DefaultQuerybetween(java.lang.String property, java.lang.Object start, java.lang.Object end)Restricts the results by the given property value range.QueryModel.Junctionconjunction()Creates a conjunction (AND) query.QueryModelcontains(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings containing with the given value.AssociationQuerycreateQuery(java.lang.String associationName)Creates an association query.QueryModel.Junctiondisjunction()Creates a disjunction (OR) query.QueryModelendsWith(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings ending with the given value.DefaultQueryeq(java.lang.String property, java.lang.Object parameter)Restricts the results by the given properties value.QueryModeleqAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is equals to all the given returned values.DefaultQueryeqProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be equal to a specified other property.voidforUpdate()Lock the selected entities.DefaultQueryge(java.lang.String property, java.lang.Object value)Used to restrict a value to be greater than or equal to the given value.QueryModelgeAll(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.DefaultQuerygeProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be greater than or equal to a specified other property.QueryModelgeSome(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.QueryModel.JunctiongetCriteria()PersistentEntitygetEntity()java.util.Optional<JoinPath>getJoinPath(java.lang.String path)Obtain the joint for for a given association.java.util.Collection<JoinPath>getJoinPaths()intgetMax()Get the pageSize results to return.longgetOffset()Get the offset of the query.PersistentEntitygetPersistentEntity()java.util.List<QueryModel.Projection>getProjections()SortgetSort()The sort to apply.DefaultQuerygt(java.lang.String property, java.lang.Object value)Used to restrict a value to be greater than the given value.QueryModelgtAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than all the given returned values.DefaultQuerygte(java.lang.String property, java.lang.Object value)Used to restrict a value to be greater than or equal to the given value.DefaultQuerygtProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be greater than a specified other property.QueryModelgtSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is greater than some of the given values.DefaultQueryidEq(java.lang.Object value)Restricts the results by the given properties value.DefaultQueryilike(java.lang.String propertyName, java.lang.Object parameter)Creates an ilike Criterion based on the specified property name and value.DefaultQueryinList(java.lang.String propertyName, QueryModel subquery)Creates an "in" Criterion using a subquery.DefaultQueryinList(java.lang.String property, java.lang.Object values)Restricts the results by the given property values.DefaultQueryisEmpty(java.lang.String property)Used to restrict a value to be empty (such as a blank string or an empty collection).QueryModelisFalse(java.lang.String propertyName)Creates a criterion that asserts the given property is false.booleanisForUpdate()Whether to lock the selected entities.DefaultQueryisNotEmpty(java.lang.String property)Used to restrict a value to be not empty (such as a blank string or an empty collection).DefaultQueryisNotNull(java.lang.String property)Used to restrict a property to be not null.DefaultQueryisNull(java.lang.String property)Used to restrict a property to be null.QueryModelisTrue(java.lang.String propertyName)Creates a criterion that asserts the given property is true.JoinPathjoin(java.lang.String path, Join.Type joinType, java.lang.String alias)Specifies whether a join query should be used (if join queries are supported by the underlying datastore).JoinPathjoin(java.lang.String path, Association association, Join.Type joinType, java.lang.String alias)Join on the given association.DefaultQueryle(java.lang.String property, java.lang.Object value)Used to restrict a value to be less than or equal to the given value.QueryModelleAll(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.DefaultQueryleProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be less than or equal to a specified other property.QueryModelleSome(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.DefaultQuerylike(java.lang.String propertyName, java.lang.Object parameter)Creates a like Criterion based on the specified property name and value.DefaultQuerylt(java.lang.String property, java.lang.Object value)Used to restrict a value to be less than the given value.QueryModelltAll(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than all the given returned values.DefaultQuerylte(java.lang.String property, java.lang.Object value)Used to restrict a value to be less than or equal to the given value.DefaultQueryltProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be less than a specified other property.QueryModelltSome(java.lang.String propertyName, Criteria propertyValue)Creates a subquery criterion that ensures the given property is less than some of the given values.DefaultQuerymax(int max)Defines the maximum number of results to return.QueryModelne(java.lang.String propertyName, java.lang.Object parameter)Creates a "not equals" Criterion based on the specified property name and value.QueryModel.Junctionnegation()Creates a negation of several criterion.DefaultQueryneProperty(java.lang.String propertyName, java.lang.String otherPropertyName)Constrains a property to be not equal to a specified other property.QueryModelnot(Criteria other)Creates a logical negation.DefaultQuerynotIn(java.lang.String propertyName, QueryModel subquery)Creates a negated "in" Criterion using a subquery.DefaultQueryoffset(long offset)Defines the offset (the first result index) of the query.QueryModelor(Criteria other)Creates a logical disjunction.DefaultQueryor(QueryModel.Criterion a, QueryModel.Criterion b)Creates a disjunction using two specified criterion.ProjectionListprojections()DefaultQueryrlike(java.lang.String propertyName, java.lang.Object parameter)Creates an rlike Criterion based on the specified property name and value.DefaultQuerysizeEq(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property by size.DefaultQuerysizeGe(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.DefaultQuerysizeGt(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be greater than the given size.DefaultQuerysizeLe(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.DefaultQuerysizeLt(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be less than to the given size.DefaultQuerysizeNe(java.lang.String propertyName, java.lang.Object size)Creates a Criterion that constrains a collection property to be not equal to the given size.QueryModelsort(Sort sort)Apply the given sort.QueryModelstartsWith(java.lang.String propertyName, java.lang.Object parameter)Restricts the property match to strings starting with the given value.DefaultQueryversionEq(java.lang.Object value)Creates that restricts the version to the given value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.data.model.query.QueryModel
join, join
-
-
-
-
Constructor Detail
-
DefaultQuery
protected DefaultQuery(@NonNull PersistentEntity entity)Default constructor.- Parameters:
entity- The entity the query applies to.
-
-
Method Detail
-
getJoinPaths
public java.util.Collection<JoinPath> getJoinPaths()
- Specified by:
getJoinPathsin interfaceQueryModel- Returns:
- The join paths.
-
createQuery
public AssociationQuery createQuery(java.lang.String associationName)
Creates an association query.- Parameters:
associationName- The assocation name- Returns:
- The Query instance
-
getPersistentEntity
@NonNull public PersistentEntity getPersistentEntity()
- Specified by:
getPersistentEntityin interfaceQueryModel- Returns:
- The entity the criteria applies to
-
getCriteria
public QueryModel.Junction getCriteria()
- Specified by:
getCriteriain interfaceQueryModel- Returns:
- The criteria defined by this query
-
getProjections
@NonNull public java.util.List<QueryModel.Projection> getProjections()
- Specified by:
getProjectionsin interfaceQueryModel- Returns:
- The projections that apply to this query.
-
getJoinPath
public java.util.Optional<JoinPath> getJoinPath(java.lang.String path)
Obtain the joint for for a given association.- Specified by:
getJoinPathin interfaceQueryModel- Parameters:
path- The path to the association- Returns:
- The join type
-
join
public JoinPath join(@NonNull java.lang.String path, @NonNull Join.Type joinType, java.lang.String alias)
Specifies whether a join query should be used (if join queries are supported by the underlying datastore).- Specified by:
joinin interfaceQueryModel- Parameters:
path- The pathjoinType- The joinTypealias- The alias- Returns:
- The query
-
join
@NonNull public JoinPath join(java.lang.String path, Association association, @NonNull Join.Type joinType, @Nullable java.lang.String alias)
Description copied from interface:QueryModelJoin on the given association.- Specified by:
joinin interfaceQueryModel- Parameters:
path- The join pathassociation- The associationjoinType- The join typealias- The alias to use.- Returns:
- The query
-
projections
public ProjectionList projections()
- Specified by:
projectionsin interfaceQueryModel- Returns:
- The projections for this query.
-
add
@NonNull public QueryModel add(@NonNull QueryModel.Criterion criterion)
Adds the specified criterion instance to the query.- Specified by:
addin interfaceQueryModel- Parameters:
criterion- The criterion instance- Returns:
- This query
-
getEntity
public PersistentEntity getEntity()
- Returns:
- The PersistentEntity being query
-
disjunction
public QueryModel.Junction disjunction()
Creates a disjunction (OR) query.- Returns:
- The Junction instance
-
conjunction
public QueryModel.Junction conjunction()
Creates a conjunction (AND) query.- Returns:
- The Junction instance
-
negation
public QueryModel.Junction negation()
Creates a negation of several criterion.- Returns:
- The negation
-
max
public DefaultQuery max(int max)
Defines the maximum number of results to return.- Specified by:
maxin interfaceQueryModel- Parameters:
max- The pageSize results- Returns:
- This query instance
-
getMax
public int getMax()
Description copied from interface:QueryModelGet the pageSize results to return.- Specified by:
getMaxin interfaceQueryModel- Returns:
- The pageSize results
-
getOffset
public long getOffset()
Description copied from interface:QueryModelGet the offset of the query.- Specified by:
getOffsetin interfaceQueryModel- Returns:
- The offset
-
forUpdate
public void forUpdate()
Description copied from interface:QueryModelLock the selected entities.- Specified by:
forUpdatein interfaceQueryModel
-
isForUpdate
public boolean isForUpdate()
Description copied from interface:QueryModelWhether to lock the selected entities.- Specified by:
isForUpdatein interfaceQueryModel- Returns:
- true if the the selected entities should be locked
-
offset
public DefaultQuery offset(long offset)
Defines the offset (the first result index) of the query.- Specified by:
offsetin interfaceQueryModel- Parameters:
offset- The offset- Returns:
- This query instance
-
getSort
public Sort getSort()
Description copied from interface:QueryModelThe sort to apply.- Specified by:
getSortin interfaceQueryModel- Returns:
- The sort
-
sort
@NonNull public QueryModel sort(@NonNull Sort sort)
Description copied from interface:QueryModelApply the given sort.- Specified by:
sortin interfaceQueryModel- Parameters:
sort- The sort to apply- Returns:
- This query
-
eq
@NonNull public DefaultQuery eq(@NonNull java.lang.String property, @NonNull java.lang.Object parameter)
Restricts the results by the given properties value.- Specified by:
eqin interfaceCriteria- Specified by:
eqin interfaceQueryModel- Parameters:
property- The name of the propertyparameter- The parameter that provides the value- Returns:
- This query instance
-
allEq
@NonNull public DefaultQuery allEq(@NonNull java.util.Map<java.lang.String,java.lang.Object> values)
Shortcut to restrict the query to multiple given property values.- Specified by:
allEqin interfaceCriteria- Specified by:
allEqin interfaceQueryModel- Parameters:
values- The values- Returns:
- This query instance
-
eqAll
@NonNull public QueryModel eqAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is equals to all the given returned values.- Specified by:
eqAllin interfaceCriteria- Specified by:
eqAllin interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- A subquery- Returns:
- This criterion instance
-
gtAll
@NonNull public QueryModel gtAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is greater than all the given returned values.- Specified by:
gtAllin interfaceCriteria- Specified by:
gtAllin interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- A subquery- Returns:
- This criterion instance
-
ltAll
@NonNull public QueryModel ltAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is less than all the given returned values.- Specified by:
ltAllin interfaceCriteria- Specified by:
ltAllin interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- A subquery- Returns:
- This criterion instance
-
geAll
@NonNull public QueryModel geAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is greater than or equals to all the given returned values.- Specified by:
geAllin interfaceCriteria- Specified by:
geAllin interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- A subquery- Returns:
- This criterion instance
-
leAll
@NonNull public QueryModel leAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is less than or equal to all the given returned values.- Specified by:
leAllin interfaceCriteria- Specified by:
leAllin interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- A subquery- Returns:
- This criterion instance
-
gtSome
@NonNull public QueryModel gtSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is greater than some of the given values.- Specified by:
gtSomein interfaceCriteria- Specified by:
gtSomein interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- The property value- Returns:
- This Criteria instance
-
geSome
@NonNull public QueryModel geSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is greater than or equal to some of the given values.- Specified by:
geSomein interfaceCriteria- Specified by:
geSomein interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- The property value- Returns:
- This Criteria instance
-
ltSome
@NonNull public QueryModel ltSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is less than some of the given values.- Specified by:
ltSomein interfaceCriteria- Specified by:
ltSomein interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- The property value- Returns:
- This Criteria instance
-
leSome
@NonNull public QueryModel leSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Description copied from interface:CriteriaCreates a subquery criterion that ensures the given property is less than or equal to some of the given values.- Specified by:
leSomein interfaceCriteria- Specified by:
leSomein interfaceQueryModel- Parameters:
propertyName- The property namepropertyValue- The property value- Returns:
- This Criteria instance
-
versionEq
public DefaultQuery versionEq(@NonNull java.lang.Object value)
Description copied from interface:CriteriaCreates that restricts the version to the given value.- Specified by:
versionEqin interfaceCriteria- Specified by:
versionEqin interfaceQueryModel- Parameters:
value- The parameter that provides the value- Returns:
- The criteria
-
isEmpty
@NonNull public DefaultQuery isEmpty(@NonNull java.lang.String property)
Used to restrict a value to be empty (such as a blank string or an empty collection).- Specified by:
isEmptyin interfaceCriteria- Specified by:
isEmptyin interfaceQueryModel- Parameters:
property- The property name- Returns:
- The criteria
-
isNotEmpty
@NonNull public DefaultQuery isNotEmpty(@NonNull java.lang.String property)
Used to restrict a value to be not empty (such as a blank string or an empty collection).- Specified by:
isNotEmptyin interfaceCriteria- Specified by:
isNotEmptyin interfaceQueryModel- Parameters:
property- The property name- Returns:
- The criteria
-
isNull
@NonNull public DefaultQuery isNull(@NonNull java.lang.String property)
Used to restrict a property to be null.- Specified by:
isNullin interfaceCriteria- Specified by:
isNullin interfaceQueryModel- Parameters:
property- The property name- Returns:
- The criteria
-
isTrue
@NonNull public QueryModel isTrue(@NonNull java.lang.String propertyName)
Description copied from interface:CriteriaCreates a criterion that asserts the given property is true.- Specified by:
isTruein interfaceCriteria- Specified by:
isTruein interfaceQueryModel- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isFalse
@NonNull public QueryModel isFalse(@NonNull java.lang.String propertyName)
Description copied from interface:CriteriaCreates a criterion that asserts the given property is false.- Specified by:
isFalsein interfaceCriteria- Specified by:
isFalsein interfaceQueryModel- Parameters:
propertyName- The property name- Returns:
- The criteria
-
isNotNull
@NonNull public DefaultQuery isNotNull(@NonNull java.lang.String property)
Used to restrict a property to be not null.- Specified by:
isNotNullin interfaceCriteria- Specified by:
isNotNullin interfaceQueryModel- Parameters:
property- The property name- Returns:
- The criteria
-
idEq
@NonNull public DefaultQuery idEq(@NonNull java.lang.Object value)
Restricts the results by the given properties value.- Specified by:
idEqin interfaceCriteria- Specified by:
idEqin interfaceQueryModel- Parameters:
value- The value to restrict by- Returns:
- This query instance
-
ne
@NonNull public QueryModel ne(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaCreates a "not equals" Criterion based on the specified property name and value.- Specified by:
nein interfaceCriteria- Specified by:
nein interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
gt
@NonNull public DefaultQuery gt(@NonNull java.lang.String property, @NonNull java.lang.Object value)
Used to restrict a value to be greater than the given value.- Specified by:
gtin interfaceCriteria- Specified by:
gtin interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
gte
public DefaultQuery gte(java.lang.String property, java.lang.Object value)
Used to restrict a value to be greater than or equal to the given value.- Specified by:
gtein interfaceCriteria- Specified by:
gtein interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
lte
public DefaultQuery lte(java.lang.String property, java.lang.Object value)
Used to restrict a value to be less than or equal to the given value.- Specified by:
ltein interfaceCriteria- Specified by:
ltein interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
ge
public DefaultQuery ge(java.lang.String property, java.lang.Object value)
Used to restrict a value to be greater than or equal to the given value.- Specified by:
gein interfaceCriteria- Specified by:
gein interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
le
public DefaultQuery le(java.lang.String property, java.lang.Object value)
Used to restrict a value to be less than or equal to the given value.- Specified by:
lein interfaceCriteria- Specified by:
lein interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
lt
public DefaultQuery lt(java.lang.String property, java.lang.Object value)
Used to restrict a value to be less than the given value.- Specified by:
ltin interfaceCriteria- Specified by:
ltin interfaceQueryModel- Parameters:
property- The name of the propertyvalue- The value to restrict by- Returns:
- This query instance
-
like
@NonNull public DefaultQuery like(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaCreates a like Criterion based on the specified property name and value.- Specified by:
likein interfaceCriteria- Specified by:
likein interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
startsWith
@NonNull public QueryModel startsWith(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaRestricts the property match to strings starting with the given value.- Specified by:
startsWithin interfaceCriteria- Specified by:
startsWithin interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
endsWith
@NonNull public QueryModel endsWith(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaRestricts the property match to strings ending with the given value.- Specified by:
endsWithin interfaceCriteria- Specified by:
endsWithin interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
contains
@NonNull public QueryModel contains(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaRestricts the property match to strings containing with the given value.- Specified by:
containsin interfaceCriteria- Specified by:
containsin interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
ilike
@NonNull public DefaultQuery ilike(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaCreates an ilike Criterion based on the specified property name and value. Unlike a like condition, ilike is case insensitive.- Specified by:
ilikein interfaceCriteria- Specified by:
ilikein interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
rlike
@NonNull public DefaultQuery rlike(@NonNull java.lang.String propertyName, @NonNull java.lang.Object parameter)
Description copied from interface:CriteriaCreates an rlike Criterion based on the specified property name and value.- Specified by:
rlikein interfaceCriteria- Specified by:
rlikein interfaceQueryModel- Parameters:
propertyName- The property nameparameter- The parameter that provides the value- Returns:
- The criteria
-
and
@NonNull public QueryModel and(@NonNull Criteria other)
Description copied from interface:CriteriaCreates a logical conjunction.- Specified by:
andin interfaceCriteria- Specified by:
andin interfaceQueryModel- Parameters:
other- The other criteria- Returns:
- This criteria
-
or
@NonNull public QueryModel or(@NonNull Criteria other)
Description copied from interface:CriteriaCreates a logical disjunction.- Specified by:
orin interfaceCriteria- Specified by:
orin interfaceQueryModel- Parameters:
other- The other criteria- Returns:
- This criteria
-
not
@NonNull public QueryModel not(@NonNull Criteria other)
Description copied from interface:CriteriaCreates a logical negation.- Specified by:
notin interfaceCriteria- Specified by:
notin interfaceQueryModel- Parameters:
other- The other criteria- Returns:
- This criteria
-
inList
@NonNull public DefaultQuery inList(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Description copied from interface:CriteriaCreates an "in" Criterion using a subquery.- Specified by:
inListin interfaceCriteria- Specified by:
inListin interfaceQueryModel- Parameters:
propertyName- The property namesubquery- The subquery- Returns:
- The criteria
-
inList
public DefaultQuery inList(java.lang.String property, java.lang.Object values)
Restricts the results by the given property values.- Specified by:
inListin interfaceCriteria- Specified by:
inListin interfaceQueryModel- Parameters:
property- The name of the propertyvalues- The values to restrict by- Returns:
- This query instance
-
notIn
@NonNull public DefaultQuery notIn(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Description copied from interface:CriteriaCreates a negated "in" Criterion using a subquery.- Specified by:
notInin interfaceCriteria- Specified by:
notInin interfaceQueryModel- Parameters:
propertyName- The property namesubquery- The subquery- Returns:
- The criteria
-
sizeEq
@NonNull public DefaultQuery sizeEq(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property by size.- Specified by:
sizeEqin interfaceCriteria- Specified by:
sizeEqin interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeGt
@NonNull public DefaultQuery sizeGt(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property to be greater than the given size.- Specified by:
sizeGtin interfaceCriteria- Specified by:
sizeGtin interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeGe
@NonNull public DefaultQuery sizeGe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property to be greater than or equal to the given size.- Specified by:
sizeGein interfaceCriteria- Specified by:
sizeGein interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeLe
@NonNull public DefaultQuery sizeLe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property to be less than or equal to the given size.- Specified by:
sizeLein interfaceCriteria- Specified by:
sizeLein interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeLt
@NonNull public DefaultQuery sizeLt(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property to be less than to the given size.- Specified by:
sizeLtin interfaceCriteria- Specified by:
sizeLtin interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
sizeNe
@NonNull public DefaultQuery sizeNe(@NonNull java.lang.String propertyName, @NonNull java.lang.Object size)
Description copied from interface:CriteriaCreates a Criterion that constrains a collection property to be not equal to the given size.- Specified by:
sizeNein interfaceCriteria- Specified by:
sizeNein interfaceQueryModel- Parameters:
propertyName- The property namesize- The size to constrain by- Returns:
- This criteria
-
eqProperty
@NonNull public DefaultQuery eqProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be equal to a specified other property.- Specified by:
eqPropertyin interfaceCriteria- Specified by:
eqPropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
neProperty
@NonNull public DefaultQuery neProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be not equal to a specified other property.- Specified by:
nePropertyin interfaceCriteria- Specified by:
nePropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
gtProperty
@NonNull public DefaultQuery gtProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be greater than a specified other property.- Specified by:
gtPropertyin interfaceCriteria- Specified by:
gtPropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
geProperty
@NonNull public DefaultQuery geProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be greater than or equal to a specified other property.- Specified by:
gePropertyin interfaceCriteria- Specified by:
gePropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
ltProperty
@NonNull public DefaultQuery ltProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be less than a specified other property.- Specified by:
ltPropertyin interfaceCriteria- Specified by:
ltPropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
leProperty
@NonNull public DefaultQuery leProperty(java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Description copied from interface:CriteriaConstrains a property to be less than or equal to a specified other property.- Specified by:
lePropertyin interfaceCriteria- Specified by:
lePropertyin interfaceQueryModel- Parameters:
propertyName- The propertyotherPropertyName- The other property- Returns:
- This criteria
-
between
public DefaultQuery between(java.lang.String property, java.lang.Object start, java.lang.Object end)
Restricts the results by the given property value range.- Specified by:
betweenin interfaceCriteria- Specified by:
betweenin interfaceQueryModel- Parameters:
property- The name of the propertystart- The start of the rangeend- The end of the range- Returns:
- This query instance
-
and
public DefaultQuery and(QueryModel.Criterion a, QueryModel.Criterion b)
Creates a conjunction using two specified criterion.- Parameters:
a- The left hand sideb- The right hand side- Returns:
- This query instance
-
or
public DefaultQuery or(QueryModel.Criterion a, QueryModel.Criterion b)
Creates a disjunction using two specified criterion.- Parameters:
a- The left hand sideb- The right hand side- Returns:
- This query instance
-
-