OPENJPA-2713 fix h2

This commit is contained in:
Mark Struberg 2019-01-30 22:33:08 +01:00
parent e82d1ec2fb
commit ad4ed02728
4 changed files with 36 additions and 3 deletions

View File

@ -4755,6 +4755,9 @@ public class DBDictionary
* from {@link DatabaseMetaData}.
*/
protected String getTableNameForMetadata(DBIdentifier tableName) {
if (tableName == null) {
return null;
}
return convertSchemaCase(tableName.getUnqualifiedName());
}

View File

@ -69,6 +69,9 @@ public class H2Dictionary extends DBDictionary {
supportsLockingWithOuterJoin = false;
supportsLockingWithInnerJoin = false;
// no timezone support for time in h2
timeWithZoneTypeName = "TIME";
reservedWordSet.addAll(Arrays.asList(new String[] {
"CURRENT_TIMESTAMP", "CURRENT_TIME", "CURRENT_DATE", "CROSS",
"DISTINCT", "EXCEPT", "EXISTS", "FROM", "FOR", "FALSE", "FULL",

View File

@ -198,17 +198,17 @@ To run the tests in the debugger simply add the following JVM properties
-Dopenjpa.ConnectionURL=jdbc:derby:target/database/openjpa-derby-database;create=true -Dopenjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
For running against a MySQL Docker installation:
-ea -Dopenjpa.ConnectionDriverName=com.mysql.jdbc.Driver -Dopenjpa.ConnectionURL=jdbc:mysql://localhost:3306/openjpatst -Dopenjpa.ConnectionUserName=openjpatst -Dopenjpa.ConnectionPassword=openjpatst
Running against a PostgreSQL Docker installation:
-ea -Dopenjpa.ConnectionDriverName=org.postgresql.Driver -Dopenjpa.ConnectionURL=jdbc:postgresql:5432//localhost/openjpatst -Dopenjpa.ConnectionUserName=postgres -Dopenjpa.ConnectionPassword=postgres
For running against a MariaDB Docker installation:
-ea -Dopenjpa.ConnectionDriverName=org.mariadb.jdbc.Driver -Dopenjpa.ConnectionURL=jdbc:mariadb://localhost:3306/openjpatst -Dopenjpa.ConnectionUserName=root -Dopenjpa.ConnectionPassword=openjpatst
For running against a h2 based installation:
-ea -Dopenjpa.ConnectionDriverName=org.h2.Driver -Dopenjpa.ConnectionURL=jdbc:h2:./target/database/openjpa-h2-database -Dopenjpa.ConnectionUserName=root -Dopenjpa.ConnectionPassword=openjpatst
TODO: finish!
For starting tests in `openjpa-persistence-jdbc` inside a compiler you can also trigger all the enhancement manually via:

27
pom.xml
View File

@ -430,6 +430,33 @@
</properties>
</profile>
<!-- profile for testing with an embedded h2 DB -->
<profile>
<id>test-h2</id>
<activation>
<property>
<name>test-h2</name>
</property>
</activation>
<properties>
<h2.version>1.4.197</h2.version>
<connection.driver.name>org.h2.Driver</connection.driver.name>
<connection.url>jdbc:h2:./target/database/openjpa-h2-database</connection.url>
<connection.username />
<connection.password />
<!-- TCK specific properties -->
<tck.db.name>h2mem</tck.db.name>
</properties>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
</dependencies>
</profile>
<!-- Profile for testing with an In-Memory Apache Derby DB -->
<profile>
<!--