mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
This commit is contained in:
@@ -68,7 +68,7 @@ public interface ExpressionList<T> {
|
||||
* optional asc and desc keywords representing ascending and descending order
|
||||
* respectively.
|
||||
*/
|
||||
Query<T> order(String orderByClause);
|
||||
ExpressionList<T> order(String orderByClause);
|
||||
|
||||
/**
|
||||
* Return the OrderBy so that you can append an ascending or descending
|
||||
|
||||
@@ -340,8 +340,9 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> order(String orderByClause) {
|
||||
return query.order(orderByClause);
|
||||
public ExpressionList<T> order(String orderByClause) {
|
||||
query.order(orderByClause);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,6 +28,7 @@ public class FilterExpressionList<T> extends DefaultExpressionList<T> {
|
||||
|
||||
private int firstRow;
|
||||
private int maxRows;
|
||||
private String orderByClause;
|
||||
|
||||
public FilterExpressionList(FilterExprPath pathPrefix, FilterExpressionList<T> original) {
|
||||
super(null, original.expr, null, original.getUnderlyingList());
|
||||
@@ -123,21 +124,6 @@ public class FilterExpressionList<T> extends DefaultExpressionList<T> {
|
||||
throw new PersistenceException(notAllowedMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderBy<T> order() {
|
||||
return rootQuery.order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> order(String orderByClause) {
|
||||
return rootQuery.order(orderByClause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> orderBy(String orderBy) {
|
||||
return rootQuery.orderBy(orderBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> query() {
|
||||
return rootQuery;
|
||||
@@ -153,6 +139,22 @@ public class FilterExpressionList<T> extends DefaultExpressionList<T> {
|
||||
return rootQuery.setMapKey(mapKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderBy<T> order() {
|
||||
return rootQuery.order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> orderBy(String orderBy) {
|
||||
return rootQuery.orderBy(orderBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> order(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> setMaxRows(int maxRows) {
|
||||
this.maxRows = maxRows;
|
||||
@@ -183,6 +185,9 @@ public class FilterExpressionList<T> extends DefaultExpressionList<T> {
|
||||
if (maxRows > 0) {
|
||||
query.setMaxRows(maxRows);
|
||||
}
|
||||
if (orderByClause != null) {
|
||||
query.order(orderByClause);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -799,7 +799,7 @@ class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expression
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> order(String orderByClause) {
|
||||
public ExpressionList<T> order(String orderByClause) {
|
||||
return exprList.order(orderByClause);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user