|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Query<T>
This represents a Query in an indexing system. It is created from a
QueryBuilder
, which decides the "where" clause in the query.
Additional limitations, such as paging, ordering, and variables, can be set on
a Query before it is executed by calling one of find(), iterator(),
or count().
Method Summary | ||
---|---|---|
long |
count()
Count how many results would be returned by this Query. |
|
T |
find()
Get the first Entity that matches the criteria. |
|
Query<T> |
firstResult(int firstResult)
Set the index of the first result. |
|
|
getVariable(java.lang.String name)
Get the value of a named variable. |
|
Query<T> |
maxResults(int maxResults)
Set how many results should be returned. |
|
Query<T> |
orderBy(OrderBy... segments)
Set the ordering rules. |
|
Query<T> |
orderBy(Property<?> property)
Append an ascending ordering rule to the existing segments. |
|
Query<T> |
orderBy(Property<?> property,
OrderBy.Order order)
Append an ordering rule to the existing segments. |
|
java.lang.Class<T> |
resultType()
Get the result type of this Query |
|
Query<T> |
setVariable(java.lang.String name,
java.lang.Object value)
Set the value of a named variable. |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
Query<T> orderBy(OrderBy... segments)
segments
- the segments to order by
Query<T> orderBy(Property<?> property, OrderBy.Order order)
property
- the property to order byorder
- the order to apply
Query<T> orderBy(Property<?> property)
property
- the property to order by
Query<T> firstResult(int firstResult)
firstResult
- which index to use as the first one
Query<T> maxResults(int maxResults)
maxResults
- that shouldbe returned
T find() throws QueryExecutionException
QueryExecutionException
- if the query failsQuery<T> setVariable(java.lang.String name, java.lang.Object value)
name
- of the variablevalue
- of the variable
<V> V getVariable(java.lang.String name)
name
- of the variable
java.lang.Class<T> resultType()
long count() throws QueryExecutionException
QueryExecutionException
- if the query fails
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |