Class AbstractOrderableQuery

java.lang.Object
ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
AbstractHibernateQueryAdapter, AbstractRelationQueryAdapter

public abstract class AbstractOrderableQuery extends Object implements Query
Base implementation for Query which handles the ordering aspects.
  • Field Details

    • ordering

      protected Ordering ordering
  • Constructor Details

    • AbstractOrderableQuery

      public AbstractOrderableQuery()
  • Method Details

    • getOrdering

      public Ordering getOrdering()
      Description copied from interface: Query
      Get a reference to the Ordering policy of this query. If there currently is no ordering policy, one will be created.
      Specified by:
      getOrdering in interface Query
      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 interface Query
      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

      public Query withOrder(Ordering order)
      Description copied from interface: Query
      Replace the Ordering 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.
      Specified by:
      withOrder in interface Query
      Returns:
      this query.
    • prependOrder

      public Query prependOrder(Ordering order)
      Description copied from interface: Query
      Prepend the given Ordering policy to the existing ordering policy of this query.
      Specified by:
      prependOrder in interface Query
      Parameters:
      order - the ordering policy to prepend.
      Returns:
      this query.
    • appendOrder

      public Query appendOrder(Ordering order)
      Description copied from interface: Query
      Append the given Ordering policy to the existing ordering policy of this query.
      Specified by:
      appendOrder in interface Query
      Parameters:
      order - the ordering policy to append.
      Returns:
      this query.