Models a query that can be executed against a data store
Modifiers | Name | Description |
---|---|---|
static class |
Query.AvgProjection |
Computes the average value of a property |
static class |
Query.Between |
Criterion used to restrict the result to be between values (range query) |
static class |
Query.Conjunction |
A Criterion used to combine to criterion in a logical AND |
static class |
Query.CountDistinctProjection |
|
static class |
Query.CountProjection |
Used to count the results of a query |
static interface |
Query.Criterion |
A criterion is used to restrict the results of a query |
static class |
Query.Disjunction |
A Criterion used to combine to criterion in a logical OR |
static class |
Query.DistinctProjection |
|
static class |
Query.DistinctPropertyProjection |
|
static class |
Query.Equals |
A criterion that restricts the results based on equality |
static class |
Query.EqualsAll |
|
static class |
Query.EqualsProperty |
|
static class |
Query.GreaterThan |
Used to restrict a value to be greater than the given value |
static class |
Query.GreaterThanAll |
|
static class |
Query.GreaterThanEquals |
Used to restrict a value to be greater than or equal to the given value |
static class |
Query.GreaterThanEqualsAll |
|
static class |
Query.GreaterThanEqualsProperty |
|
static class |
Query.GreaterThanProperty |
|
static class |
Query.ILike |
Criterion used to restrict the results based on a pattern (likeness) |
static class |
Query.IdEquals |
A criterion that restricts the results based on the equality of the identifier |
static class |
Query.IdProjection |
A projection used to obtain the identifier of an object |
static class |
Query.In |
Criterion used to restrict the results based on a list of values |
static class |
Query.IsEmpty |
Restricts a property to be empty (such as a blank string) |
static class |
Query.IsNotEmpty |
Restricts a property to be empty (such as a blank string) |
static class |
Query.IsNotNull |
Restricts a property to be not null |
static class |
Query.IsNull |
Restricts a property to be null |
static class |
Query.Junction |
|
static class |
Query.LessThan |
Used to restrict a value to be less than the given value |
static class |
Query.LessThanAll |
|
static class |
Query.LessThanEquals |
Used to restrict a value to be less than the given value |
static class |
Query.LessThanEqualsAll |
|
static class |
Query.LessThanEqualsProperty |
|
static class |
Query.LessThanProperty |
|
static class |
Query.Like |
Criterion used to restrict the results based on a pattern (likeness) |
static class |
Query.MaxProjection |
Computes the max value of a property |
static class |
Query.MinProjection |
Computes the min value of a property |
static class |
Query.Negation |
A criterion used to negate several other criterion |
static class |
Query.NotEquals |
A criterion that restricts the results based on equality |
static class |
Query.NotEqualsAll |
|
static class |
Query.NotEqualsProperty |
|
static class |
Query.Order |
The ordering of results. |
static class |
Query.Projection |
A projection |
static class |
Query.ProjectionList |
A list of projections |
static class |
Query.PropertyComparisonCriterion |
A Criterion that compares to properties |
static class |
Query.PropertyCriterion |
Criterion that applies to a property and value |
static class |
Query.PropertyNameCriterion |
A Criterion that applies to a property |
static class |
Query.PropertyProjection |
A projection that obtains the value of a property of an entity |
static class |
Query.RLike |
Criterion used to restrict the results based on a regular expression pattern |
static class |
Query.SizeEquals |
|
static class |
Query.SizeGreaterThan |
|
static class |
Query.SizeGreaterThanEquals |
|
static class |
Query.SizeLessThan |
|
static class |
Query.SizeLessThanEquals |
|
static class |
Query.SizeNotEquals |
|
static class |
Query.SubqueryCriterion |
Used to differentiate criterion that require a subquery |
static class |
Query.SumProjection |
Computes the sum of a property |
Modifiers | Name | Description |
---|---|---|
protected Query.Junction |
criteria |
|
protected PersistentEntity |
entity |
|
protected int |
max |
|
protected int |
offset |
|
protected java.util.List<Order> |
orderBy |
|
protected Query.ProjectionList |
projections |
|
protected Session |
session |
|
protected boolean |
uniqueResult |
Type | Name and description |
---|---|
protected java.lang.Object |
Query(Session session, PersistentEntity entity) Models a query that can be executed against a data store |
void |
add(Query.Criterion criterion) Adds the specified criterion instance to the query |
Query |
allEq(java.util.Map<java.lang.String, java.lang.Object> values) Shortcut to restrict the query to multiple given property values |
Query |
and(Query.Criterion a, Query.Criterion b) Creates a conjunction using two specified criterion |
Query |
between(java.lang.String property, java.lang.Object start, java.lang.Object end) Restricts the results by the given property value range |
Query.Junction |
conjunction() Creates a disjunction (OR) query |
AssociationQuery |
createQuery(java.lang.String associationName) Creates an association query |
Query.Junction |
disjunction() Creates a disjunction (OR) query |
Query |
eq(java.lang.String property, java.lang.Object value) Restricts the results by the given properties value |
protected java.util.List |
executeQuery(PersistentEntity entity, Query.Junction criteria) Subclasses should implement this to provide the concrete implementation of querying |
Query |
firstResult(int offset) Defines the offset (the first result index) of the query |
protected void |
flushBeforeQuery() Default behavior is the flush the session before a query in the case of FlushModeType.AUTO. |
Query |
ge(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than or equal to the given value |
Query.Junction |
getCriteria() @return The criteria defined by this query |
PersistentEntity |
getEntity() @return The PersistentEntity being query |
java.util.List<Order> |
getOrderBy() Gets the Order entries for this query |
Session |
getSession() @return The session that created the query |
Query |
gt(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than the given value |
Query |
gte(java.lang.String property, java.lang.Object value) Used to restrict a value to be greater than or equal to the given value |
Query |
idEq(java.lang.Object value) Restricts the results by the given properties value |
Query |
ilike(java.lang.String property, java.lang.String expr) Restricts the results by the given properties value |
Query |
in(java.lang.String property, java.util.List values) Restricts the results by the given property values |
Query |
isEmpty(java.lang.String property) Used to restrict a value to be empty (such as a blank string or an empty collection) |
Query |
isNotEmpty(java.lang.String property) Used to restrict a value to be not empty (such as a blank string or an empty collection) |
Query |
isNotNull(java.lang.String property) Used to restrict a property to be not null |
Query |
isNull(java.lang.String property) Used to restrict a property to be null |
Query |
le(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than or equal to the given value |
Query |
like(java.lang.String property, java.lang.String expr) Restricts the results by the given properties value |
java.util.List |
list() Executes the query returning zero or many results as a list. |
Query |
lt(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than the given value |
Query |
lte(java.lang.String property, java.lang.Object value) Used to restrict a value to be less than or equal to the given value |
Query |
max(int max) Defines the maximum number of results to return |
Query |
maxResults(int max) Defines the maximum number of results to return |
Query.Junction |
negation() Creates a negation of several criterion |
Query |
offset(int offset) Defines the offset (the first result index) of the query |
Query |
or(Query.Criterion a, Query.Criterion b) Creates a disjunction using two specified criterion |
Query |
order(Query.Order order) Specifies the order of results |
Query.ProjectionList |
projections() |
protected java.lang.Object |
resolveIdIfEntity(java.lang.Object value) |
Query |
rlike(java.lang.String property, java.lang.String expr) Restricts the results by the given properties value |
void |
setUniqueResult(boolean uniqueResult) Here purely for compatibility |
java.lang.Object |
singleResult() Executes the query returning a single result or null |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Models a query that can be executed against a data store
Adds the specified criterion instance to the query
criterion
- The criterion instanceShortcut to restrict the query to multiple given property values
values
- The valuesCreates a conjunction using two specified criterion
a
- The left hand sideb
- The right hand sideRestricts the results by the given property value range
property
- The name of the propertystart
- The start of the rangeend
- The end of the rangeCreates a disjunction (OR) query
Creates an association query
associationName
- The assocation nameCreates a disjunction (OR) query
Restricts the results by the given properties value
property
- The name of the propertyvalue
- The value to restrict bySubclasses should implement this to provide the concrete implementation of querying
entity
- The entitycriteria
- The criteriaDefines the offset (the first result index) of the query
offset
- The offsetDefault behavior is the flush the session before a query in the case of FlushModeType.AUTO. Subclasses can override this method to disable that.
Used to restrict a value to be greater than or equal to the given value
property
- The name of the propertyvalue
- The value to restrict by
Gets the Order entries for this query
Used to restrict a value to be greater than the given value
property
- The name of the propertyvalue
- The value to restrict byUsed to restrict a value to be greater than or equal to the given value
property
- The name of the propertyvalue
- The value to restrict byRestricts the results by the given properties value
value
- The value to restrict byRestricts the results by the given properties value
property
- The name of the propertyexpr
- The expression to restrict byRestricts the results by the given property values
property
- The name of the propertyvalues
- The values to restrict byUsed to restrict a value to be empty (such as a blank string or an empty collection)
property
- The property nameUsed to restrict a value to be not empty (such as a blank string or an empty collection)
property
- The property nameUsed to restrict a property to be not null
property
- The property nameUsed to restrict a property to be null
property
- The property nameUsed to restrict a value to be less than or equal to the given value
property
- The name of the propertyvalue
- The value to restrict byRestricts the results by the given properties value
property
- The name of the propertyexpr
- The expression to restrict byExecutes the query returning zero or many results as a list.
Used to restrict a value to be less than the given value
property
- The name of the propertyvalue
- The value to restrict byUsed to restrict a value to be less than or equal to the given value
property
- The name of the propertyvalue
- The value to restrict byDefines the maximum number of results to return
max
- The max resultsDefines the maximum number of results to return
max
- The max resultsCreates a negation of several criterion
Defines the offset (the first result index) of the query
offset
- The offsetCreates a disjunction using two specified criterion
a
- The left hand sideb
- The right hand sideSpecifies the order of results
order
- The order objectRestricts the results by the given properties value
property
- The name of the propertyexpr
- The expression to restrict byHere purely for compatibility
uniqueResult
- Whether it is a unique resultExecutes the query returning a single result or null