openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r693283 - in /openjpa/branches/1.2.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/
Date Mon, 08 Sep 2008 21:32:27 GMT
Author: kwsutter
Date: Mon Sep  8 14:32:26 2008
New Revision: 693283

URL: http://svn.apache.org/viewvc?rev=693283&view=rev
Log:
OPENJPA-715.  Committing the testcase provided by Ekin Sokmen and the patch provided by Fay
Wang.  Committing the change for both the 1.2.x service stream and 1.3.0 snapshot (trunk).

Modified:
    openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
    openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java

Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=693283&r1=693282&r2=693283&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
(original)
+++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
Mon Sep  8 14:32:26 2008
@@ -356,7 +356,7 @@
     }
 
     /**
-     * Return the primary key value for the given class.
+     * Return the primary key value for the sequence table for the given class.
      */
     protected Object getPrimaryKey(ClassMapping mapping) {
         return Numbers.valueOf(0);

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?rev=693283&r1=693282&r2=693283&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
Mon Sep  8 14:32:26 2008
@@ -755,8 +755,12 @@
                     .setFailedObject(obj);
         } else {
             sm = _broker.getStateManager(obj);
-            if (sm == null || !sm.isProvisional())
+            if (sm == null || !sm.isProvisional()) { 
                 sm = _broker.persist(obj, null, true, call);
+                // ensure generated IDs get assigned properly
+                if (!logical)
+                    ((StateManagerImpl)sm).assignObjectId(false, true);
+            }
         }
 
         if (sm != null) {

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=693283&r1=693282&r2=693283&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Mon Sep  8 14:32:26 2008
@@ -512,7 +512,7 @@
      * Ask store manager to assign our oid, optionally flushing and
      * optionally recaching on the new oid.
      */
-    private boolean assignObjectId(boolean flush, boolean preFlushing) {
+    boolean assignObjectId(boolean flush, boolean preFlushing) {
         if (_oid != null || isEmbedded() || !isPersistent())
             return true;
 



Mime
View raw message