Support H2database 2.x

This commit is contained in:
Rob Bygrave committed 2022-01-25 21:28:09 +13:00
1 parent 8d29a3a575
commit a9dbc036e9
12 files changed
+30 -13

No files matched your search

@@ -101,7 +101,7 @@ public class PlatformNoGeneratedKeysTest {
config.setDatabasePlatform(platform);
config.getDataSourceConfig().setUsername("sa");
config.getDataSourceConfig().setPassword("");
config.getDataSourceConfig().setUrl("jdbc:h2:mem:withPCQuery;");
config.getDataSourceConfig().setUrl("jdbc:h2:mem:withPCQuery;MODE=LEGACY");
config.getDataSourceConfig().setDriver("org.h2.Driver");
config.setDisableLazyLoading(true);
@@ -47,6 +47,14 @@ public class ScalarTypeLocalDateTest {
assertTrue(o instanceof Date);
}
@Test
public void olderDates_ToFromJdbcType() {
LocalDate localDate = LocalDate.of(1850,12,1);
Object o = type.toJdbcType(localDate);
LocalDate localDate1 = type.toBeanType(o);
assertThat(localDate1).isEqualTo(localDate);
}
@Test
public void testToBeanType() {
@@ -39,7 +39,7 @@ public class TestSqlUpdateUpsert extends BaseTestCase {
.setParameter("online", false);
Object key2 = sqlUpdate2.executeGetKey();
assertThat(key2).isNull();
assertThat(key2).isEqualTo(key);
EPersonOnline found2 = DB.find(EPersonOnline.class).where().eq("email", email).findOne();
@@ -8,5 +8,5 @@ ebean.jodaLocalTimeMode=normal
datasource.someotherdb.username=sa
datasource.someotherdb.password=
datasource.someotherdb.databaseUrl=jdbc:h2:mem:someotherdb
datasource.someotherdb.databaseUrl=jdbc:h2:mem:someotherdb;NON_KEYWORDS=KEY,VALUE
datasource.someotherdb.databaseDriver=org.h2.Driver