#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
@@ -50,7 +50,9 @@ public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
List<String> loggedSql = LoggedSqlCollector.stop();
assertThat(loggedSql).hasSize(1);
assertThat(loggedSql.get(0)).contains("order by t0.id");
if (isH2()) {
assertThat(loggedSql.get(0)).contains("from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id limit 10");
}
}
@@ -109,7 +111,9 @@ public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
List<String> loggedSql = LoggedSqlCollector.stop();
assertThat(loggedSql).hasSize(1);
assertThat(loggedSql.get(0)).contains("order by t0.id");
if (isH2()) {
assertThat(loggedSql.get(0)).contains("join o_customer t1 on t1.id = t0.kcustomer_id limit 10");
}
}
@Test
@@ -128,7 +132,9 @@ public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
List<String> loggedSql = LoggedSqlCollector.stop();
assertThat(loggedSql).hasSize(1);
assertThat(loggedSql.get(0)).contains("order by t0.id");
if (isH2()) {
assertThat(loggedSql.get(0)).contains(" limit 10 offset 10");
}
}