#2907 - Promote Db2SqlLimiter to be AnsiSqlRowsLimiter and move to ebean-api module

This commit is contained in:
Rob Bygrave
2022-12-01 22:18:16 +13:00
parent 22a5bd9b9d
commit 37ba0b63e4
6 changed files with 31 additions and 23 deletions
@@ -19,7 +19,6 @@ import static org.junit.jupiter.api.Assertions.*;
public class TestQueryForUpdate extends BaseTestCase {
@Test
@ForPlatform({Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
public void testForUpdate() {
ResetBasicData.reset();
@@ -40,6 +39,28 @@ public class TestQueryForUpdate extends BaseTestCase {
}
}
// @IgnorePlatform(Platform.ORACLE)
@Test
public void testForUpdate_withLimit() {
ResetBasicData.reset();
Query<Customer> query;
try (final Transaction transaction = DB.beginTransaction()) {
query = DB.find(Customer.class)
.forUpdate()
.setMaxRows(3)
.order().desc("id");
query.findList();
}
if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else {
assertThat(sqlOf(query)).contains("for update");
}
}
@Test
@ForPlatform({ Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
public void testForUpdate_when_alreadyInPCAsReference() {