Class QueryBuilder

java.lang.Object
org.nuxeo.ecm.core.query.sql.model.QueryBuilder
Direct Known Subclasses:
AuditQueryBuilder

public class QueryBuilder extends Object
Query builder for a query, including ordering, limit and offset.
Since:
10.3
  • Field Details

    • filter

      protected MultiExpression filter
    • orders

      protected OrderByList orders
    • offset

      protected long offset
    • limit

      protected long limit
    • countTotal

      protected boolean countTotal
  • Constructor Details

    • QueryBuilder

      public QueryBuilder()
    • QueryBuilder

      public QueryBuilder(QueryBuilder other)
      Copy constructor.
  • Method Details

    • predicate

      public MultiExpression predicate()
    • and

      public QueryBuilder and(Predicate predicate)
      Adds a new predicate to the list of AND predicates.
    • or

      public QueryBuilder or(Predicate predicate)
      Adds a new predicate to the list of OR predicates.
    • predicate

      public QueryBuilder predicate(Predicate predicate)
      Adds a new predicate to the list.
    • filter

      public QueryBuilder filter(MultiExpression filter)
      Sets the filter.
    • orders

      public OrderByList orders()
      We currently only need to handle object instantiated through OrderByExprs.
    • defaultOrder

      public QueryBuilder defaultOrder()
    • order

      public QueryBuilder order(OrderByExpr order)
      Adds a new order to this query builder.
    • orders

      public QueryBuilder orders(OrderByExpr order, OrderByExpr... orders)
      Sets the orders to use when querying audit.
    • orders

      public QueryBuilder orders(List<OrderByExpr> orders)
      Sets the orders to use when querying audit.
    • offset

      public long offset()
    • offset

      public QueryBuilder offset(long offset)
    • limit

      public long limit()
    • limit

      public QueryBuilder limit(long limit)
    • countTotal

      public boolean countTotal()
      May be used by supported APIs to include in the query result a count of total results if there was no limit or offset.

      If true, requests computation of the total size of the underlying list (the size if there was no limit or offset), otherwise when false does a best effort but may return -2 when unknown

    • countTotal

      public QueryBuilder countTotal(boolean countTotal)
    • toString

      public String toString()
      Overrides:
      toString in class Object