Deprecate order() methods on Query, ExpressionList - migrate to orderBy()

Unfortunately we have order() and orderBy() methods which do the
same thing. I have decided to deprecate the order() ones in
favour of the orderBy() methods so that ultimately we will end
up with less methods and I think orderBy() is the correct choice.

Apologies for the migration pain here.
This commit is contained in:
Rob Bygrave
2023-06-01 21:21:39 +12:00
parent 6a2d0c233a
commit e71be4e1b1
6 changed files with 25 additions and 82 deletions
@@ -1241,23 +1241,10 @@ public abstract class TQRootBean<T, R> {
}
/**
* Marker that can be used to indicate that the order by clause is defined after this.
* <p>
* <h2>Example: order by customer name, order date</h2>
* <pre>{@code
* List<Order> orders =
* new QOrder()
* .customer.name.ilike("rob")
* .orderBy()
* .customer.name.asc()
* .orderDate.asc()
* .findList();
*
* }</pre>
* Deprecated migrate to orderBy().
*/
@Deprecated(since = "13.19")
public R order() {
// Yes this does not actually do anything! We include it because style wise it makes
// the query nicer to read and suggests that order by definitions are added after this
return root;
}
@@ -1274,15 +1261,11 @@ public abstract class TQRootBean<T, R> {
}
/**
* Set the full raw 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.
* Deprecated migrate to {@link #orderBy(String)}
*/
@Deprecated(since = "13.19")
public R order(String orderByClause) {
query.order(orderByClause);
return root;
return orderBy(orderByClause);
}
/**