FIX for the limit query (#1540)

This commit is contained in:
Roland Praml
2018-11-13 21:08:53 +13:00
committed by Rob Bygrave
parent ec24374d72
commit e4cb5f0443
5 changed files with 14 additions and 10 deletions
@@ -6,6 +6,7 @@ import io.ebean.Query;
import org.tests.model.basic.Order;
import org.tests.model.basic.ResetBasicData;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.util.List;
@@ -22,6 +23,7 @@ public class TestLimitQuery extends BaseTestCase {
}
@Test
@Ignore("TODO: maxRows=-1 should become the default value for 'unset'")
public void testMaxRowsZeroWithFirstRow() {
ResetBasicData.reset();
@@ -24,7 +24,7 @@ public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
LoggedSqlCollector.start();
Ebean.find(Order.class)
List<Order> list = Ebean.find(Order.class)
.setFirstRow(3)
.orderBy().asc("id")
.findList();
@@ -33,6 +33,7 @@ public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
assertThat(loggedSql).hasSize(1);
assertThat(loggedSql.get(0)).contains("order by t0.id");
assertThat(list).isNotEmpty();
}