public interface QueryModel extends Criteria
Modifier and Type | Interface and Description |
---|---|
static class |
QueryModel.AvgProjection
Computes the average value of a property.
|
static class |
QueryModel.Between
Criterion used to restrict the result to be between values (range query).
|
static class |
QueryModel.Conjunction
A Criterion used to combine to criterion in a logical AND.
|
static class |
QueryModel.Contains
Criterion used to restrict the results based on a result containing the given value.
|
static class |
QueryModel.CountDistinctProjection
Projection to count distinct property names.
|
static class |
QueryModel.CountProjection
Used to count the results of a query.
|
static interface |
QueryModel.Criterion
Represents a criterion to be used in a criteria query.
|
static class |
QueryModel.Disjunction
A Criterion used to combine to criterion in a logical OR.
|
static class |
QueryModel.DistinctProjection
Distinct result projection.
|
static class |
QueryModel.DistinctPropertyProjection
Projection to return distinct property names.
|
static class |
QueryModel.EndsWith
Criterion used to restrict the results based on starting with a given value.
|
static class |
QueryModel.Equals
A criterion that restricts the results based on equality.
|
static class |
QueryModel.EqualsAll
Restricts a value to be equal to all the given values.
|
static class |
QueryModel.EqualsProperty
A criterion for one property equaling another.
|
static class |
QueryModel.Exists
Used for exists subquery.
|
static class |
QueryModel.GreaterThan
Used to restrict a value to be greater than the given value.
|
static class |
QueryModel.GreaterThanAll
Restricts a value to be greater than all the given values.
|
static class |
QueryModel.GreaterThanEquals
Used to restrict a value to be greater than or equal to the given value.
|
static class |
QueryModel.GreaterThanEqualsAll
Restricts a value to be greater than or equal to all the given values.
|
static class |
QueryModel.GreaterThanEqualsProperty
A criterion for one property being greater than or equal to another.
|
static class |
QueryModel.GreaterThanEqualsSome
Restricts a value to be greater than some of the given values.
|
static class |
QueryModel.GreaterThanProperty
A criterion for one property being greater than another.
|
static class |
QueryModel.GreaterThanSome
Restricts a value to be greater than some of the given values.
|
static class |
QueryModel.GroupPropertyProjection
Group by property projection.
|
static class |
QueryModel.IdEquals
A criterion that restricts the results based on the equality of the identifier.
|
static class |
QueryModel.IdProjection
A projection used to obtain the identifier of an object.
|
static class |
QueryModel.ILike
Criterion used to restrict the results based on a pattern (likeness).
|
static class |
QueryModel.In
Criterion used to restrict the results based on a list of values.
|
static class |
QueryModel.IsEmpty
Restricts a property to be empty (such as a blank string).
|
static class |
QueryModel.IsFalse
Restricts a property to be false.
|
static class |
QueryModel.IsNotEmpty
Restricts a property to be empty (such as a blank string).
|
static class |
QueryModel.IsNotNull
Restricts a property to be not null.
|
static class |
QueryModel.IsNull
Restricts a property to be null.
|
static class |
QueryModel.IsTrue
Restricts a property to be true.
|
static class |
QueryModel.Junction
base class for a junction (AND or OR or NOT).
|
static class |
QueryModel.LessThan
Used to restrict a value to be less than the given value.
|
static class |
QueryModel.LessThanAll
Restricts a value to be less than all the given values.
|
static class |
QueryModel.LessThanEquals
Used to restrict a value to be less than the given value.
|
static class |
QueryModel.LessThanEqualsAll
Restricts a value to be less than or equal to all the given values.
|
static class |
QueryModel.LessThanEqualsProperty
A criterion for one property being less than or equal to another.
|
static class |
QueryModel.LessThanEqualsSome
Restricts a value to be less than some of the given values.
|
static class |
QueryModel.LessThanProperty
A criterion for one property being less than another.
|
static class |
QueryModel.LessThanSome
Restricts a value to be less than some of the given values.
|
static class |
QueryModel.Like
Criterion used to restrict the results based on a pattern (likeness).
|
static class |
QueryModel.MaxProjection
Computes the pageSize value of a property.
|
static class |
QueryModel.MinProjection
Computes the min value of a property.
|
static class |
QueryModel.Negation
A criterion used to negate several other criterion.
|
static class |
QueryModel.NotEquals
A criterion that restricts the results based on equality.
|
static class |
QueryModel.NotEqualsAll
Restricts a value to be not equal to all the given values.
|
static class |
QueryModel.NotEqualsProperty
A criterion for one property not equaling another.
|
static class |
QueryModel.NotExists
Used for exists subquery.
|
static class |
QueryModel.NotIn
Criterion used to restrict the results based on a list of values.
|
static class |
QueryModel.Projection
A projection.
|
static class |
QueryModel.PropertyComparisonCriterion
A Criterion that compares to properties.
|
static class |
QueryModel.PropertyCriterion
Criterion that applies to a property and value.
|
static class |
QueryModel.PropertyNameCriterion
A Criterion that applies to a property.
|
static class |
QueryModel.PropertyProjection
A projection that obtains the value of a property of an entity.
|
static class |
QueryModel.RLike
Criterion used to restrict the results based on a regular expression pattern.
|
static class |
QueryModel.SizeEquals
Size equals criterion.
|
static class |
QueryModel.SizeGreaterThan
Size greater than criterion.
|
static class |
QueryModel.SizeGreaterThanEquals
Size greater than equals criterion.
|
static class |
QueryModel.SizeLessThan
Size less than criterion.
|
static class |
QueryModel.SizeLessThanEquals
Size less than equals criterion.
|
static class |
QueryModel.SizeNotEquals
Size not equals criterion.
|
static class |
QueryModel.StartsWith
Criterion used to restrict the results based on starting with a given value.
|
static class |
QueryModel.SubqueryCriterion
Used to differentiate criterion that require a subquery.
|
static class |
QueryModel.SumProjection
Computes the sum of a property.
|
static class |
QueryModel.VersionEquals
A criterion that restricts the results based on the equality of the version.
|
Modifier and Type | Method and Description |
---|---|
QueryModel |
add(QueryModel.Criterion criterion)
Adds the specified criterion instance to the query.
|
QueryModel |
allEq(java.util.Map<java.lang.String,QueryParameter> propertyValues)
Apply an "equals" constraint to each property in the key set of a Map.
|
QueryModel |
and(Criteria other)
Creates a logical conjunction.
|
QueryModel |
between(java.lang.String propertyName,
QueryParameter start,
QueryParameter finish)
Restricts the results by the given property value range (inclusive).
|
QueryModel |
contains(java.lang.String propertyName,
QueryParameter parameter)
Restricts the property match to strings containing with the given value.
|
QueryModel |
endsWith(java.lang.String propertyName,
QueryParameter parameter)
Restricts the property match to strings ending with the given value.
|
QueryModel |
eq(java.lang.String propertyName,
QueryParameter parameter)
Creates an "equals" Criterion based on the specified property name and value.
|
QueryModel |
eqAll(java.lang.String propertyName,
Criteria propertyValue)
Creates a subquery criterion that ensures the given property is equals to all the given returned values.
|
QueryModel |
eqProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be equal to a specified other property.
|
void |
forUpdate()
Lock the selected entities.
|
static QueryModel |
from(PersistentEntity entity)
Creates a query from the given entity.
|
QueryModel |
ge(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be greater than or equal to the given value.
|
QueryModel |
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.
|
QueryModel |
geProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be greater than or equal to a specified other property.
|
QueryModel |
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.
|
QueryModel.Junction |
getCriteria() |
java.util.Optional<JoinPath> |
getJoinPath(java.lang.String path)
Obtain the join type for the given association.
|
java.util.Collection<JoinPath> |
getJoinPaths() |
int |
getMax()
Get the pageSize results to return.
|
long |
getOffset()
Get the offset of the query.
|
PersistentEntity |
getPersistentEntity() |
java.util.List<QueryModel.Projection> |
getProjections() |
default Sort |
getSort()
The sort to apply.
|
QueryModel |
gt(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be greater than or equal to the given value.
|
QueryModel |
gtAll(java.lang.String propertyName,
Criteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than all the given returned values.
|
QueryModel |
gte(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be greater than or equal to the given value.
|
QueryModel |
gtProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be greater than a specified other property.
|
QueryModel |
gtSome(java.lang.String propertyName,
Criteria propertyValue)
Creates a subquery criterion that ensures the given property is greater than some of the given values.
|
QueryModel |
idEq(QueryParameter parameter)
Creates an "equals" Criterion based on the specified property name and value.
|
QueryModel |
ilike(java.lang.String propertyName,
QueryParameter parameter)
Creates an ilike Criterion based on the specified property name and value.
|
QueryModel |
inList(java.lang.String propertyName,
QueryModel subquery)
Creates an "in" Criterion using a subquery.
|
QueryModel |
inList(java.lang.String propertyName,
QueryParameter parameter)
Creates an "in" Criterion based on the specified property name and list of values.
|
QueryModel |
isEmpty(java.lang.String propertyName)
Creates a criterion that asserts the given property is empty (such as a blank string).
|
QueryModel |
isFalse(java.lang.String propertyName)
Creates a criterion that asserts the given property is false.
|
boolean |
isForUpdate()
Whether to lock the selected entities.
|
QueryModel |
isNotEmpty(java.lang.String propertyName)
Creates a criterion that asserts the given property is not empty.
|
QueryModel |
isNotNull(java.lang.String propertyName)
Creates a criterion that asserts the given property is not null.
|
QueryModel |
isNull(java.lang.String propertyName)
Creates a criterion that asserts the given property is null.
|
QueryModel |
isTrue(java.lang.String propertyName)
Creates a criterion that asserts the given property is true.
|
default JoinPath |
join(Association association)
Join on the given association.
|
default JoinPath |
join(Association association,
Join.Type joinType)
Join on the given association.
|
JoinPath |
join(java.lang.String path,
Association association,
Join.Type joinType,
java.lang.String alias)
Deprecated.
|
default JoinPath |
join(java.lang.String path,
Join.Type joinType,
java.lang.String alias)
Join on the given association.
|
QueryModel |
le(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be less than or equal to the given value.
|
QueryModel |
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.
|
QueryModel |
leProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be less than or equal to a specified other property.
|
QueryModel |
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.
|
QueryModel |
like(java.lang.String propertyName,
QueryParameter parameter)
Creates a like Criterion based on the specified property name and value.
|
QueryModel |
lt(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be less than or equal to the given value.
|
QueryModel |
ltAll(java.lang.String propertyName,
Criteria propertyValue)
Creates a subquery criterion that ensures the given property is less than all the given returned values.
|
QueryModel |
lte(java.lang.String property,
QueryParameter parameter)
Used to restrict a value to be less than or equal to the given value.
|
QueryModel |
ltProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be less than a specified other property.
|
QueryModel |
ltSome(java.lang.String propertyName,
Criteria propertyValue)
Creates a subquery criterion that ensures the given property is less than some of the given values.
|
QueryModel |
max(int max)
Limits the maximum result.
|
QueryModel |
ne(java.lang.String propertyName,
QueryParameter parameter)
Creates a "not equals" Criterion based on the specified property name and value.
|
QueryModel |
neProperty(java.lang.String propertyName,
java.lang.String otherPropertyName)
Constrains a property to be not equal to a specified other property.
|
QueryModel |
not(Criteria other)
Creates a logical negation.
|
QueryModel |
notIn(java.lang.String propertyName,
QueryModel subquery)
Creates a negated "in" Criterion using a subquery.
|
QueryModel |
offset(long offset)
Sets the offset.
|
QueryModel |
or(Criteria other)
Creates a logical disjunction.
|
ProjectionList |
projections() |
QueryModel |
rlike(java.lang.String propertyName,
QueryParameter parameter)
Creates an rlike Criterion based on the specified property name and value.
|
QueryModel |
sizeEq(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property by size.
|
QueryModel |
sizeGe(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property to be greater than or equal to the given size.
|
QueryModel |
sizeGt(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property to be greater than the given size.
|
QueryModel |
sizeLe(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property to be less than or equal to the given size.
|
QueryModel |
sizeLt(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property to be less than to the given size.
|
QueryModel |
sizeNe(java.lang.String propertyName,
QueryParameter size)
Creates a Criterion that constrains a collection property to be not equal to the given size.
|
QueryModel |
sort(Sort sort)
Apply the given sort.
|
QueryModel |
startsWith(java.lang.String propertyName,
QueryParameter parameter)
Restricts the property match to strings starting with the given value.
|
QueryModel |
versionEq(QueryParameter parameter)
Creates that restricts the version to the given value.
|
@NonNull QueryModel idEq(QueryParameter parameter)
Criteria
@NonNull QueryModel versionEq(QueryParameter parameter)
Criteria
@NonNull QueryModel isEmpty(@NonNull java.lang.String propertyName)
Criteria
@NonNull QueryModel isNotEmpty(@NonNull java.lang.String propertyName)
Criteria
isNotEmpty
in interface Criteria
propertyName
- The property name@NonNull QueryModel isNull(@NonNull java.lang.String propertyName)
Criteria
@NonNull QueryModel isTrue(@NonNull java.lang.String propertyName)
Criteria
@NonNull QueryModel isFalse(@NonNull java.lang.String propertyName)
Criteria
@NonNull QueryModel isNotNull(java.lang.String propertyName)
Criteria
@NonNull QueryModel eq(java.lang.String propertyName, QueryParameter parameter)
Criteria
@NonNull QueryModel ne(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel between(@NonNull java.lang.String propertyName, @NonNull QueryParameter start, @NonNull QueryParameter finish)
Criteria
@NonNull QueryModel gte(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel ge(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel gt(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel lte(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel le(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel lt(@NonNull java.lang.String property, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel like(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel startsWith(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
startsWith
in interface Criteria
propertyName
- The property nameparameter
- The parameter that provides the value@NonNull QueryModel endsWith(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel contains(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel ilike(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel rlike(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel and(@NonNull Criteria other)
Criteria
@NonNull QueryModel or(@NonNull Criteria other)
Criteria
@NonNull QueryModel not(@NonNull Criteria other)
Criteria
@NonNull QueryModel inList(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Criteria
@NonNull QueryModel inList(@NonNull java.lang.String propertyName, @NonNull QueryParameter parameter)
Criteria
@NonNull QueryModel notIn(@NonNull java.lang.String propertyName, @NonNull QueryModel subquery)
Criteria
@NonNull QueryModel sizeEq(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel sizeGt(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel sizeGe(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel sizeLe(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel sizeLt(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel sizeNe(@NonNull java.lang.String propertyName, @NonNull QueryParameter size)
Criteria
@NonNull QueryModel eqProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
eqProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel neProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
neProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel gtProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
gtProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel geProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
geProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel ltProperty(@NonNull java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
ltProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel leProperty(java.lang.String propertyName, @NonNull java.lang.String otherPropertyName)
Criteria
leProperty
in interface Criteria
propertyName
- The propertyotherPropertyName
- The other property@NonNull QueryModel allEq(@NonNull java.util.Map<java.lang.String,QueryParameter> propertyValues)
Criteria
@NonNull QueryModel eqAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel gtAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel ltAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel geAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel leAll(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel gtSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel geSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel ltSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
@NonNull QueryModel leSome(@NonNull java.lang.String propertyName, @NonNull Criteria propertyValue)
Criteria
java.util.Collection<JoinPath> getJoinPaths()
@NonNull PersistentEntity getPersistentEntity()
@NonNull QueryModel.Junction getCriteria()
@NonNull java.util.List<QueryModel.Projection> getProjections()
java.util.Optional<JoinPath> getJoinPath(java.lang.String path)
path
- The path@NonNull @Deprecated JoinPath join(java.lang.String path, Association association, @NonNull Join.Type joinType, @Nullable java.lang.String alias)
path
- The join pathassociation
- The associationjoinType
- The join typealias
- The alias to use.@NonNull default JoinPath join(java.lang.String path, @NonNull Join.Type joinType, @Nullable java.lang.String alias)
path
- The join pathjoinType
- The join typealias
- The alias to use.@NonNull default JoinPath join(@NonNull Association association, @NonNull Join.Type joinType)
association
- The association, never nulljoinType
- The join type@NonNull default JoinPath join(@NonNull Association association)
association
- The association, never null@NonNull ProjectionList projections()
@NonNull QueryModel add(@NonNull QueryModel.Criterion criterion)
criterion
- The criterion instanceQueryModel max(int max)
max
- The pageSizeQueryModel offset(long offset)
offset
- The offsetdefault Sort getSort()
@NonNull QueryModel sort(@NonNull Sort sort)
sort
- The sort to apply@NonNull static QueryModel from(@NonNull PersistentEntity entity)
entity
- The entityint getMax()
long getOffset()
void forUpdate()
boolean isForUpdate()