mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1945 - ENH: Add query.orderById(boolean) to ExpressionList ... improve fluid style
This commit is contained in:
@@ -52,6 +52,14 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
Query<T> query();
|
||||
|
||||
/**
|
||||
* Controls, if paginated queries should always append an 'order by id' statement at the end to
|
||||
* guarantee a deterministic sort result. This may affect performance.
|
||||
* If this is not enabled, and an orderBy is set on the query, it's up to the programmer that
|
||||
* this query provides a deterministic result.
|
||||
*/
|
||||
Query<T> orderById(boolean orderById);
|
||||
|
||||
/**
|
||||
* Set the order by clause replacing the existing order by clause if there is
|
||||
* one.
|
||||
|
||||
@@ -354,6 +354,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return query.order(orderBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> orderById(boolean orderById) {
|
||||
return query.orderById(orderById);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> apply(FetchPath fetchPath) {
|
||||
return query.apply(fetchPath);
|
||||
|
||||
@@ -813,6 +813,11 @@ class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expression
|
||||
return exprList.orderBy(orderBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> orderById(boolean orderById) {
|
||||
return exprList.orderById(orderById);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> query() {
|
||||
return exprList.query();
|
||||
|
||||
Reference in New Issue
Block a user