Query

For use by repository implementations, representing the values of a query.

The implementations of these objects are be provided by the underlying persistor/object store; consult its documentation.

Implementations are expected to implement the #getRange() method, which is used to support range / paging the data. Returned result sets are expected to start from index "start", and no more than "count" items are expected.

*Note:* not every object store will necessarily support this interface. In particular, the in-memory object store does not. For this, you can use the _Predicate_ interface to similar effect, for example in _RepositoryService#allMatches(Class, Predicate, long, long)_ ). *Note:* that the predicate is applied within the xref:refguide:applib:index/services/repository/RepositoryService.adoc[RepositoryService] (ie client-side) rather than being pushed back to the object store.

API

Query.java
interface Query<T> {
  Class<T> getResultType()     (1)
  String getDescription()     (2)
  QueryRange getRange()     (3)
  Query<T> withRange(QueryRange range)
  Query<T> withRange(long... range)
  Query<T> withStart(long start)
  Query<T> withLimit(long limit)
  Query<T> allInstances(Class<T> resultType)
  NamedQuery<T> named(Class<T> resultType, String queryName)
}
1 getResultType()

The Class of the objects returned by this query.

2 getDescription()

A human-readable representation of this query and its values.

3 getRange()

Returns a model with start index into the set table and maximal number of items to return.

Members

getResultType()

The Class of the objects returned by this query.

getDescription()

A human-readable representation of this query and its values.

getRange()

Returns a model with start index into the set table and maximal number of items to return.