You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by so...@apache.org on 2021/10/21 16:15:12 UTC

[openjpa] branch OPENJPA-2883 updated: [OPENJPA-2883] 'supportsAutoAssign' is turned OFF when 'useTriggersForAutoAssign' is ON

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch OPENJPA-2883
in repository https://gitbox.apache.org/repos/asf/openjpa.git


The following commit(s) were added to refs/heads/OPENJPA-2883 by this push:
     new eae4981  [OPENJPA-2883] 'supportsAutoAssign' is turned OFF when 'useTriggersForAutoAssign' is ON
eae4981 is described below

commit eae49816f471e3ae657b4eff4528b1a0284e2ce5
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Thu Oct 21 23:15:03 2021 +0700

    [OPENJPA-2883] 'supportsAutoAssign' is turned OFF when 'useTriggersForAutoAssign' is ON
---
 .../main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java   | 8 ++++----
 .../java/org/apache/openjpa/jira_2883/TestOracleGeneratedId.java  | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
index b8283bc..8056d7d 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
@@ -289,7 +289,7 @@ public class OracleDictionary
     public void endConfiguration() {
         super.endConfiguration();
         if (useTriggersForAutoAssign)
-            supportsAutoAssign = true;
+            supportsAutoAssign = false;
     }
 
     @Override
@@ -1045,7 +1045,7 @@ public class OracleDictionary
 
             setTimeouts(stmnt, conf, false);
             rs = stmnt.executeQuery();
-            List idxList = new ArrayList();
+            List<Index> idxList = new ArrayList<>();
             while (rs != null && rs.next())
                 idxList.add(newIndex(rs));
             return (Index[]) idxList.toArray(new Index[idxList.size()]);
@@ -1160,13 +1160,13 @@ public class OracleDictionary
             return create;
 
         Column[] cols = table.getColumns();
-        List seqs = null;
+        List<String> seqs = null;
         String seq, trig;
         for (int i = 0; cols != null && i < cols.length; i++) {
             if (!cols[i].isAutoAssigned())
                 continue;
             if (seqs == null)
-                seqs = new ArrayList(4);
+                seqs = new ArrayList<String>(4);
 
             seq = autoAssignSequenceName;
             if (seq == null) {
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jira_2883/TestOracleGeneratedId.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jira_2883/TestOracleGeneratedId.java
index 068738c..b694508 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jira_2883/TestOracleGeneratedId.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jira_2883/TestOracleGeneratedId.java
@@ -20,12 +20,12 @@ package org.apache.openjpa.jira_2883;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
-import javax.persistence.EntityManager;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.openjpa.persistence.test.DatabasePlatform;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
 
 /**
@@ -34,6 +34,7 @@ import org.apache.openjpa.persistence.test.SingleEMFTestCase;
  *   <A HREF="https://issues.apache.org/jira/browse/OPENJPA-2883">OPENJPA-2883</A>
  *
  */
+@DatabasePlatform("oracle.jdbc.driver.OracleDriver")
 public class TestOracleGeneratedId extends SingleEMFTestCase {
     @Override
     public void setUp() {
@@ -42,7 +43,7 @@ public class TestOracleGeneratedId extends SingleEMFTestCase {
     }
 
     public void testGeneratedId() {
-        EntityManager em = emf.createEntityManager();
+        emf.createEntityManager();
         assertTrue("Should be created without issues", true);
     }