Class AbstractOrderableQuery
java.lang.Object
ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
- All Implemented Interfaces:
Query
- Direct Known Subclasses:
AbstractHibernateQueryAdapter
,AbstractRelationQueryAdapter
Base implementation for
Query
which handles the ordering aspects.-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.query.Query
Query.Mode
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendOrder
(Ordering order) Append the givenOrdering
policy to the existing ordering policy of this query.Get a reference to theOrdering
policy of this query.boolean
Check whether this query has an ordering policy already.prependOrder
(Ordering order) Prepend the givenOrdering
policy to the existing ordering policy of this query.Replace theOrdering
policy of this query with the given ordering policy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.query.Query
count, execute, execute, execute, execute, execute, execute, firstResult, firstResultOrNull, getKeys, getKeys, getManager, getOnlyResult, getOnlyResult, getOnlyResultOrNull, getOnlyResultOrNull, setParameter, toQueryDefinition, uniqueResult, uniqueResultOrNull
-
Field Details
-
ordering
-
-
Constructor Details
-
AbstractOrderableQuery
public AbstractOrderableQuery()
-
-
Method Details
-
getOrdering
Description copied from interface:Query
Get a reference to theOrdering
policy of this query. If there currently is no ordering policy, one will be created.- Specified by:
getOrdering
in interfaceQuery
- Returns:
- The ordering policy of this query.
-
hasOrdering
public boolean hasOrdering()Description copied from interface:Query
Check whether this query has an ordering policy already.- Specified by:
hasOrdering
in interfaceQuery
- Returns:
true
, if this query has an ordering policy with at least one rule,false
if none or one without rules (which may mean that getOrdering() will make one up on the fly).
-
withOrder
Description copied from interface:Query
Replace theOrdering
policy of this query with the given ordering policy. If the given ordering policy is null or empty, it will be ignored and the existing ordering policy of the query will be preserved. -
prependOrder
Description copied from interface:Query
Prepend the givenOrdering
policy to the existing ordering policy of this query.- Specified by:
prependOrder
in interfaceQuery
- Parameters:
order
- the ordering policy to prepend.- Returns:
- this query.
-
appendOrder
Description copied from interface:Query
Append the givenOrdering
policy to the existing ordering policy of this query.- Specified by:
appendOrder
in interfaceQuery
- Parameters:
order
- the ordering policy to append.- Returns:
- this query.
-