#1269 - Paging queries should not ALWAYS append an order by ID ... but only when the order by is empty

This commit is contained in:
Rob Bygrave committed 2018-02-22 22:40:22 +13:00
1 parent ec7b376612
commit 8ee68ac5e1
8 files changed
+38 -24

No files matched your search

@@ -1372,6 +1372,15 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
return this;
}
@Override
public boolean checkPagingOrderBy() {
return (maxRows > 1 || firstRow > 0) && !distinct && orderByIsEmpty();
}
private boolean orderByIsEmpty() {
return orderBy == null || orderBy.isEmpty();
}
@Override
public OrderBy<T> getOrderBy() {
return orderBy;