#1694 - findList() with firstRows/maxRows adds "order by id" (even with orderById(false))

This commit is contained in:
rob bygrave
2019-05-03 14:33:42 +12:00
parent e4569f9362
commit 4aa8a0dc63
11 changed files with 98 additions and 22 deletions
@@ -518,7 +518,7 @@ public class ServerConfig {
/**
* Controls the default order by id setting of queries. See {@link Query#orderById(boolean)}
*/
private boolean defaultOrderById = false;
private boolean defaultOrderById;
/**
* The mappingLocations for searching xml mapping.
@@ -585,8 +585,9 @@ public class ServerConfig {
/**
* Sets the default orderById setting for queries.
* Deprecated - look to have explicit order by. Sets the default orderById setting for queries.
*/
@Deprecated
public void setDefaultOrderById(boolean defaultOrderById) {
this.defaultOrderById = defaultOrderById;
}
@@ -1615,7 +1615,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
@Override
public boolean checkPagingOrderBy() {
return !useDocStore && (maxRows > 1 || firstRow > 0) && !distinct && (orderByIsEmpty() || isOrderById());
return orderById && !useDocStore;
}
@Override