|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.datastore.query.Query
public abstract class Query
Models a query that can be executed against a data store
| Nested Class Summary | |
|---|---|
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.CountProjection
Used to count the results of a query |
static class |
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.Equals
A criterion that restricts the results based on equality |
static class |
Query.GreaterThan
Used to restrict a value to be greater than the given value |
static class |
Query.GreaterThanEquals
Used to restrict a value to be greater than or equal to the given value |
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.Junction
|
static class |
Query.LessThan
Used to restrict a value to be less than the given value |
static class |
Query.LessThanEquals
Used to restrict a value to be less than the given value |
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.Order
The ordering of results |
static class |
Query.Projection
A projection |
static class |
Query.ProjectionList
A list of projections |
static class |
Query.PropertyCriterion
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.SumProjection
Computes the sum of a property |
| Field Summary | |
|---|---|
protected Query.Junction |
criteria
|
protected PersistentEntity |
entity
|
protected int |
max
|
protected int |
offset
|
protected List<Query.Order> |
orderBy
|
protected Query.ProjectionList |
projections
|
| Constructor Summary | |
|---|---|
protected |
Query(Session session,
PersistentEntity entity)
|
| Method Summary | |
|---|---|
void |
add(Query.Criterion criterion)
|
Query |
and(Query.Criterion a,
Query.Criterion b)
Creates a conjunction using two specified criterion |
Query |
between(String property,
Object start,
Object end)
Restricts the results by the given property value range |
Query.Junction |
disjunction()
Creates a disjunction (OR) query |
Query |
eq(String property,
Object value)
Restricts the results by the given properties value |
protected abstract 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 |
PersistentEntity |
getEntity()
|
List<Query.Order> |
getOrderBy()
Gets the Order entries for this query |
Session |
getSession()
|
Query |
gt(String property,
Object value)
Used to restrict a value to be greater than the given value |
Query |
gte(String property,
Object value)
Used to restrict a value to be greater than or equal to the given value |
Query |
in(String property,
List values)
Restricts the results by the given property values |
Query |
like(String property,
String expr)
Restricts the results by the given properties value |
List |
list()
Executes the query returning zero or many results as a list |
Query |
lt(String property,
Object value)
Used to restrict a value to be less than the given value |
Query |
lte(String property,
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 |
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()
|
void |
setUniqueResult(boolean uniqueResult)
Deprecated. |
Object |
singleResult()
Executes the query returning a single result or null |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PersistentEntity entity
protected Query.Junction criteria
protected Query.ProjectionList projections
protected int max
protected int offset
protected List<Query.Order> orderBy
| Constructor Detail |
|---|
protected Query(Session session,
PersistentEntity entity)
| Method Detail |
|---|
public Query.ProjectionList projections()
public void add(Query.Criterion criterion)
public Session getSession()
public PersistentEntity getEntity()
public Query.Junction disjunction()
public Query max(int max)
max - The max results
public Query maxResults(int max)
max - The max results
public Query offset(int offset)
offset - The offset
public Query firstResult(int offset)
offset - The offset
public Query order(Query.Order order)
order - The order object
public List<Query.Order> getOrderBy()
public Query eq(String property,
Object value)
property - The name of the propertyvalue - The value to restrict by
public Query gt(String property,
Object value)
property - The name of the propertyvalue - The value to restrict by
public Query gte(String property,
Object value)
property - The name of the propertyvalue - The value to restrict by
public Query lte(String property,
Object value)
property - The name of the propertyvalue - The value to restrict by
public Query lt(String property,
Object value)
property - The name of the propertyvalue - The value to restrict by
public Query in(String property,
List values)
property - The name of the propertyvalues - The values to restrict by
public Query between(String property,
Object start,
Object end)
property - The name of the propertystart - The start of the rangeend - The end of the range
public Query like(String property,
String expr)
property - The name of the propertyexpr - The expression to restrict by
public Query and(Query.Criterion a,
Query.Criterion b)
a - The left hand sideb - The right hand side
public Query or(Query.Criterion a,
Query.Criterion b)
a - The left hand sideb - The right hand side
public List list()
public Object singleResult()
public void setUniqueResult(boolean uniqueResult)
uniqueResult - Whether it is a unique result
protected abstract List executeQuery(PersistentEntity entity,
Query.Junction criteria)
entity - The entitycriteria - The criteria
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||