db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg ObjectEnvelopeTable.java
Date Wed, 30 Mar 2005 08:00:53 GMT
arminw      2005/03/30 00:00:53

  Modified:    src/java/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        ObjectEnvelopeTable.java
  Log:
  fix OJB-8: Problem with cascading delete
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.32.2.15 +9 -6      db-ojb/src/java/org/apache/ojb/odmg/ObjectEnvelopeTable.java
  
  Index: ObjectEnvelopeTable.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/ObjectEnvelopeTable.java,v
  retrieving revision 1.32.2.14
  retrieving revision 1.32.2.15
  diff -u -r1.32.2.14 -r1.32.2.15
  --- ObjectEnvelopeTable.java	23 Mar 2005 12:32:15 -0000	1.32.2.14
  +++ ObjectEnvelopeTable.java	30 Mar 2005 08:00:53 -0000	1.32.2.15
  @@ -710,13 +710,16 @@
               if(getTransaction().cascadeDeleteFor(ord))
               {
                   Object depObj = ord.getPersistentField().get(source.getObject());
  -                Identity oid = getTransaction().getBroker().serviceIdentity().buildIdentity(depObj);
  -                // if(!isNewAssociatedObject(oid) && !alreadyPrepared.contains(oid))
  -                if(!isNewAssociatedObject(oid))
  +                if(depObj != null)
                   {
  -                    ObjectEnvelope depMod = get(oid, depObj, false);
  -                    depMod.setModificationState(depMod.getModificationState().markDelete());
  -                    cascadeDeleteFor(depMod, alreadyPrepared);
  +                    Identity oid = getTransaction().getBroker().serviceIdentity().buildIdentity(depObj);
  +                    // if(!isNewAssociatedObject(oid) && !alreadyPrepared.contains(oid))
  +                    if(!isNewAssociatedObject(oid))
  +                    {
  +                        ObjectEnvelope depMod = get(oid, depObj, false);
  +                        depMod.setModificationState(depMod.getModificationState().markDelete());
  +                        cascadeDeleteFor(depMod, alreadyPrepared);
  +                    }
                   }
               }
           }
  
  
  

---------------------------------------------------------------------
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