You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2006/08/18 16:31:43 UTC
svn commit: r432603 -
/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
Author: arminw
Date: Fri Aug 18 07:31:42 2006
New Revision: 432603
URL: http://svn.apache.org/viewvc?rev=432603&view=rev
Log:
fix, on object insert always replace the current Identity object with new one
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java?rev=432603&r1=432602&r2=432603&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java Fri Aug 18 07:31:42 2006
@@ -2019,11 +2019,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