mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
auomatically append "order by id" when paging and query.orderById = true (#1275)
Add ServerConfig.setDefaultOrderById() and query.orderById(boolean) ... to control automatically append "order by id" with paging query
This commit is contained in:
committed by
Rob Bygrave
parent
0cba0664f8
commit
a712be2917
@@ -244,11 +244,11 @@ public class TestQuerySingleAttribute extends BaseTestCase {
|
||||
|
||||
List<String> ids = query.findSingleAttributeList();
|
||||
if (isSqlServer()) {
|
||||
assertThat(sqlOf(query)).contains("select top 100 t0.id from o_customer t0");
|
||||
assertThat(sqlOf(query)).contains("select top 100 t0.id from o_customer t0 order by t0.id");
|
||||
} else if (isOracle()) {
|
||||
assertThat(sqlOf(query)).contains("where rownum <= 100");
|
||||
} else {
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 limit 100");
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 order by t0.id limit 100");
|
||||
}
|
||||
assertThat(ids).isNotEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user