db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r432583 - /db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
Date Fri, 18 Aug 2006 13:43:46 GMT
Author: arminw
Date: Fri Aug 18 06:43:45 2006
New Revision: 432583

URL: http://svn.apache.org/viewvc?rev=432583&view=rev
Log:
fix, always replace the Identity object on insert

Modified:
    db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java

Modified: db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java?rev=432583&r1=432582&r2=432583&view=diff
==============================================================================
--- db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java (original)
+++ db/ojb/trunk/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java Fri Aug 18
06:43:45 2006
@@ -2406,11 +2406,12 @@
         if (insert)
         {
             dbAccess.executeInsert(cld, obj);
-            if(oid.isTransient())
-            {
-                // Create a new Identity based on the current set of primary key values.
-                oid = serviceIdentity().buildIdentity(cld, obj);
-            }
+            /*
+            Create a new Identity based on the current set of primary key values.
+            This is mandatory because the used oid can be transient or the specified
+            PK values of the object can be changed by the database (use of database identity
columns)
+            */
+            oid = serviceIdentity().buildIdentity(cld, obj);
         }
         // else use UPDATE
         else



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message