Deprecate orderBy() migrate to order()

This commit is contained in:
rob bygrave
2020-02-18 23:27:43 +13:00
parent 6961bf5787
commit 168dacffa7
39 changed files with 100 additions and 134 deletions
+6 -16
View File
@@ -67,10 +67,6 @@ public interface ExpressionList<T> {
* This follows SQL syntax using commas between each property with the
* optional asc and desc keywords representing ascending and descending order
* respectively.
* </p>
* <p>
* This is EXACTLY the same as {@link #orderBy(String)}.
* </p>
*/
Query<T> order(String orderByClause);
@@ -85,27 +81,21 @@ public interface ExpressionList<T> {
OrderBy<T> order();
/**
* Return the OrderBy so that you can append an ascending or descending
* property to the order by clause.
* <p>
* This will never return a null. If no order by clause exists then an 'empty'
* OrderBy object is returned.
* </p>
* Deprecated migrate to order().
*/
@Deprecated
OrderBy<T> orderBy();
/**
* Add an orderBy clause to the query.
*
* @see Query#orderBy(String)
* Deprecated migrate to {@link #order(String)}
*/
@Deprecated
Query<T> orderBy(String orderBy);
/**
* Add an orderBy clause to the query.
*
* @see Query#orderBy(String)
* Deprecated migrate to {@link #order(String)}
*/
@Deprecated
Query<T> setOrderBy(String orderBy);
/**
+6 -30
View File
@@ -1347,17 +1347,9 @@ public interface Query<T> {
Query<T> having(Expression addExpressionToHaving);
/**
* Set the order by clause replacing the existing order by clause if there is
* one.
* <p>
* This follows SQL syntax using commas between each property with the
* optional asc and desc keywords representing ascending and descending order
* respectively.
* </p>
* <p>
* This is EXACTLY the same as {@link #order(String)}.
* </p>
* Deprecated migrate to {@link #order(String)}
*/
@Deprecated
Query<T> orderBy(String orderByClause);
/**
@@ -1380,40 +1372,24 @@ public interface Query<T> {
* <p>
* This will never return a null. If no order by clause exists then an 'empty'
* OrderBy object is returned.
* </p>
* <p>
* This is EXACTLY the same as {@link #orderBy()}.
* </p>
*/
OrderBy<T> order();
/**
* Return the OrderBy so that you can append an ascending or descending
* property to the order by clause.
* <p>
* This will never return a null. If no order by clause exists then an 'empty'
* OrderBy object is returned.
* </p>
* <p>
* This is EXACTLY the same as {@link #order()}.
* </p>
* Deprecated migrate to order().
*/
@Deprecated
OrderBy<T> orderBy();
/**
* Set an OrderBy object to replace any existing OrderBy clause.
* <p>
* This is EXACTLY the same as {@link #setOrderBy(OrderBy)}.
* </p>
*/
Query<T> setOrder(OrderBy<T> orderBy);
/**
* Set an OrderBy object to replace any existing OrderBy clause.
* <p>
* This is EXACTLY the same as {@link #setOrder(OrderBy)}.
* </p>
* Deprecated migrate to {@link #setOrder(OrderBy)}
*/
@Deprecated
Query<T> setOrderBy(OrderBy<T> orderBy);
/**
@@ -118,7 +118,7 @@ public class LoadManyRequest extends LoadRequest {
SpiQuery<?> query = many.newQuery(server);
String orderBy = many.getLazyFetchOrderBy();
if (orderBy != null) {
query.orderBy(orderBy);
query.order(orderBy);
}
String extraWhere = many.getExtraWhere();
@@ -152,7 +152,7 @@ class EqlAdapter<T> extends EqlWhereListener<T> {
}
}
query.orderBy().add(new OrderBy.Property(path, asc, nulls, nullsFirstLast));
query.order().add(new OrderBy.Property(path, asc, nulls, nullsFirstLast));
}
@Override
@@ -268,8 +268,8 @@ public class CQueryEngine {
}
// order by id asc, lower sys period desc
query.orderBy().asc(request.getBeanDescriptor().getIdProperty().getName());
query.orderBy().desc(sysPeriodLower);
query.order().asc(request.getBeanDescriptor().getIdProperty().getName());
query.order().desc(sysPeriodLower);
CQuery<T> cquery = queryBuilder.buildQuery(request);
try {