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 Summary
Fields Modifier and Type Field Description protected boolean
countTotal
protected MultiExpression
filter
protected long
limit
protected long
offset
protected OrderByList
orders
-
Constructor Summary
Constructors Constructor Description QueryBuilder()
QueryBuilder(QueryBuilder other)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryBuilder
and(Predicate predicate)
Adds a new predicate to the list of AND predicates.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.QueryBuilder
countTotal(boolean countTotal)
QueryBuilder
defaultOrder()
QueryBuilder
filter(MultiExpression filter)
Sets the filter.long
limit()
QueryBuilder
limit(long limit)
long
offset()
QueryBuilder
offset(long offset)
QueryBuilder
or(Predicate predicate)
Adds a new predicate to the list of OR predicates.QueryBuilder
order(OrderByExpr order)
Adds a new order to this query builder.OrderByList
orders()
We currently only need to handle object instantiated throughOrderByExprs
.QueryBuilder
orders(List<OrderByExpr> orders)
Sets the orders to use when querying audit.QueryBuilder
orders(OrderByExpr order, OrderByExpr... orders)
Sets the orders to use when querying audit.MultiExpression
predicate()
QueryBuilder
predicate(Predicate predicate)
Adds a new predicate to the list.String
toString()
-
-
-
Field Detail
-
filter
protected MultiExpression filter
-
orders
protected OrderByList orders
-
offset
protected long offset
-
limit
protected long limit
-
countTotal
protected boolean countTotal
-
-
Constructor Detail
-
QueryBuilder
public QueryBuilder()
-
QueryBuilder
public QueryBuilder(QueryBuilder other)
Copy constructor.
-
-
Method Detail
-
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 throughOrderByExprs
.
-
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 whenfalse
does a best effort but may return-2
when unknown
-
countTotal
public QueryBuilder countTotal(boolean countTotal)
-
-