From 3b51096dae69634322c8d92cb1f3317f3a25024a Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Sat, 10 Apr 2021 17:06:59 +0200 Subject: [PATCH 1/3] OPENJPA-2866 no need to test JDBC2 feature Oracle comes with JDBC4. We can safely assume that Statement#getGeneratedKeys is always available. Oracle relies on it and will fail without. --- .../openjpa/persistence/identity/TestGenerationType.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestGenerationType.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestGenerationType.java index 5262cbdd4..9c70fc43b 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestGenerationType.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/identity/TestGenerationType.java @@ -25,6 +25,7 @@ import javax.persistence.EntityTransaction; import javax.persistence.Query; import org.apache.openjpa.jdbc.conf.JDBCConfiguration; +import org.apache.openjpa.jdbc.sql.OracleDictionary; import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.test.SingleEMFTestCase; @@ -117,6 +118,10 @@ public class TestGenerationType } public void testQueryWithoutGetGeneratedKeys() { + if (getDBDictionary() instanceof OracleDictionary) { + // Oracle now always has JDBC4 driver. + return; + } testQuery(); } From 760765379264569a1a0cc6d4453f90a67d513a16 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Sat, 10 Apr 2021 17:18:41 +0200 Subject: [PATCH 2/3] test needs Oracle specific create table stmt --- .../schema/TestSchemaGenerationProperties.java | 3 +++ .../persistence/jdbc/schema/create-oracle.sql | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/schema/create-oracle.sql diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSchemaGenerationProperties.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSchemaGenerationProperties.java index fc46ac4ae..23b67cdc0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSchemaGenerationProperties.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/schema/TestSchemaGenerationProperties.java @@ -31,6 +31,7 @@ import org.apache.openjpa.jdbc.meta.MappingTool; import org.apache.openjpa.jdbc.schema.SchemaGroup; import org.apache.openjpa.jdbc.schema.SchemaTool; import org.apache.openjpa.jdbc.sql.DBDictionary; +import org.apache.openjpa.jdbc.sql.OracleDictionary; import org.apache.openjpa.jdbc.sql.PostgresDictionary; import org.apache.openjpa.jdbc.sql.SQLServerDictionary; import org.apache.openjpa.persistence.OpenJPAEntityManager; @@ -179,6 +180,8 @@ public class TestSchemaGenerationProperties extends BaseJDBCTest { createSql = "org/apache/openjpa/persistence/jdbc/schema/create-postgresql.sql"; } else if (dict instanceof SQLServerDictionary) { createSql = "org/apache/openjpa/persistence/jdbc/schema/create-mssql.sql"; + } else if (dict instanceof OracleDictionary) { + createSql = "org/apache/openjpa/persistence/jdbc/schema/create-oracle.sql"; } else { createSql = "org/apache/openjpa/persistence/jdbc/schema/create.sql"; } diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/schema/create-oracle.sql b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/schema/create-oracle.sql new file mode 100644 index 000000000..0ee1902d4 --- /dev/null +++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/schema/create-oracle.sql @@ -0,0 +1,14 @@ +CREATE TABLE AUTOINCPC1 (ID INTEGER NOT NULL, STRNGFLD VARCHAR(50), DTYPE VARCHAR(255), ONEONE_ID INTEGER, INTFIELD INTEGER, CONSTRAINT SQL150111133630290 PRIMARY KEY (ID)); +CREATE TABLE AUTOINCPC3 (ID NUMBER NOT NULL, STRNGFLD VARCHAR(50), ONEONE_ID NUMBER, CONSTRAINT SQL150111133630380 PRIMARY KEY (ID)); +CREATE TABLE CONJOINPC4 (ID INTEGER NOT NULL, MANYTOMANY BLOB, NAME VARCHAR(50), ONETOONE1_ID INTEGER, CONSTRAINT SQL150111133630400 PRIMARY KEY (ID)); +CREATE TABLE CONJOINPC5 (ID INTEGER NOT NULL, NAME VARCHAR(255), CONSTRAINT SQL150111133630420 PRIMARY KEY (ID)); +CREATE TABLE CUSTMAPPC (ID INTEGER NOT NULL, FEMALE SMALLINT, NAME VARCHAR(50), CONSTRAINT SQL150111133630430 PRIMARY KEY (ID)); +CREATE TABLE DFGTEST (ID NUMBER NOT NULL, DFGFIELD INTEGER, NONDFGFIELD INTEGER, CONSTRAINT SQL150111133630450 PRIMARY KEY (ID)); +CREATE TABLE EAGEROUTERJOINPC (ID NUMBER NOT NULL, NAME VARCHAR(255), HELPER BLOB, CONSTRAINT SQL150111133630460 PRIMARY KEY (ID)); +CREATE TABLE EAGERPC (ID INTEGER NOT NULL, STRNGFLD VARCHAR(50), EAGER_ID INTEGER, EAGSUB INTEGER, HELPER_ID INTEGER, RECURSE_ID INTEGER, CONSTRAINT SQL150111133630470 PRIMARY KEY (ID)); +CREATE TABLE EAGERPCSUB (ID INTEGER NOT NULL, INTFIELD INTEGER, CONSTRAINT SQL150111133630480 PRIMARY KEY (ID)); +CREATE TABLE HELPERPC (ID INTEGER NOT NULL, STRNGFLD VARCHAR(50), EAGER_ID INTEGER, HELPER BLOB, CONSTRAINT SQL150111133630500 PRIMARY KEY (ID)); +CREATE TABLE HELPERPC2 (ID INTEGER NOT NULL, STRNGFLD VARCHAR(50), HELPER_ID INTEGER, CONSTRAINT SQL150111133630510 PRIMARY KEY (ID)); +CREATE TABLE HELPERPC3 (ID INTEGER NOT NULL, STRNGFLD VARCHAR(50), DTYPE VARCHAR(255), INTFIELD INTEGER, CONSTRAINT SQL150111133630520 PRIMARY KEY (ID)); +CREATE TABLE INVERTA (ID INTEGER NOT NULL, TEST VARCHAR(35), INVERTB_ID INTEGER, CONSTRAINT SQL150111133630530 PRIMARY KEY (ID)); +CREATE TABLE INVERTB (ID INTEGER NOT NULL, TEST VARCHAR(35), INVERTA_ID INTEGER, CONSTRAINT SQL150111133630540 PRIMARY KEY (ID)); From d5ac99d402df5129e686deee563106f9e66c11c1 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Sat, 10 Apr 2021 19:06:15 +0200 Subject: [PATCH 3/3] move back to Oracle11XE docker the o18 docker image I did try was simply what we needed. While the o11xe is not suitable for running the full test wuite it is perfectly fine for running single tests. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 55a367df0..fae2605ee 100644 --- a/pom.xml +++ b/pom.xml @@ -1548,8 +1548,8 @@ - - pvargacl/oracle-xe-18.4.0:latest + oracleinanutshell/oracle-xe-11g +