Testing nuodb 4.3.2, but it isn't supporting getGeneratedKeys for jdbc batch inserts

That breaks a lot of tests
This commit is contained in:
Rob Bygrave committed 2022-06-16 23:32:04 +12:00
1 parent fa6fdf124d
commit afdb1df7ce
4 files changed
+20 -34

No files matched your search

@@ -13,6 +13,22 @@ public class NuoDbDdl extends PlatformDdl {
this.dropConstraintIfExists = "drop constraint"; this.dropConstraintIfExists = "drop constraint";
} }
@Override
public String createSequence(String sequenceName, DdlIdentity identity) {
StringBuilder sb = new StringBuilder("create sequence ");
sb.append(quote(sequenceName));
int start = identity.getStart();
if (start > 0) {
sb.append(" ").append(sequenceStartWith).append(" ").append(start);
}
int cache = identity.getCache();
if (cache > 0) {
sb.append(" quantum size ").append(cache);
}
sb.append(";");
return sb.toString();
}
@Override @Override
public void addTableComment(DdlBuffer apply, String tableName, String tableComment) { public void addTableComment(DdlBuffer apply, String tableName, String tableComment) {
// do nothing // do nothing
+1 -1
View File
@@ -228,7 +228,7 @@
<dependency> <dependency>
<groupId>com.nuodb.jdbc</groupId> <groupId>com.nuodb.jdbc</groupId>
<artifactId>nuodb-jdbc</artifactId> <artifactId>nuodb-jdbc</artifactId>
<version>22.0.0</version> <version>23.0.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -7,45 +7,15 @@ import org.tests.model.basic.ESimple;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
public class TestSimpleIdInsert extends BaseTestCase { class TestSimpleIdInsert extends BaseTestCase {
@Test @Test
public void test() { void test() {
ESimple e = new ESimple(); ESimple e = new ESimple();
e.setName("name"); e.setName("name");
DB.save(e); DB.save(e);
assertNotNull(e.getId()); assertNotNull(e.getId());
} }
// // This test fails with jdbc drivers that don't
// // support batch insert with getGeneratedKeys
// public void testJdbcBatch() {
//
// GlobalProperties.put("datasource.default", "hsqldb");
// GlobalProperties.put("ebean.classes", ESimple.class.getName());
//
// Transaction transaction = DB.beginTransaction();
// try {
// transaction.setBatchMode(true);
// transaction.setLogLevel(LogLevel.SQL);
// ESimple e = new ESimple();
// e.setName("name");
// DB.save(e);
//
// ESimple e2 = new ESimple();
// e2.setName("name2");
// DB.save(e2);
// transaction.commit();
//
// Assert.assertNotNull(e.getId());
// Assert.assertNotNull(e2.getId());
//
// } finally {
// DB.endTransaction();
// }
// }
} }
+1 -1
View File
@@ -1,3 +1,3 @@
ebean.test.platform=nuodb ebean.test.platform=nuodb
ebean.test.dbName=testdb ebean.test.dbName=testdb
ebean.test.nuodb.version=latest ebean.test.nuodb.version=4.3.2