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 2005/12/04 03:23:56 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/core PersistenceBrokerImpl.java

arminw      2005/12/03 18:23:56

  Modified:    src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        PersistenceBrokerImpl.java
  Log:
  minor change in handle 1:n collection reference objects
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.83.2.29 +12 -3     db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java,v
  retrieving revision 1.83.2.28
  retrieving revision 1.83.2.29
  diff -u -r1.83.2.28 -r1.83.2.29
  --- PersistenceBrokerImpl.java	26 Sep 2005 16:33:50 -0000	1.83.2.28
  +++ PersistenceBrokerImpl.java	4 Dec 2005 02:23:56 -0000	1.83.2.29
  @@ -1128,8 +1128,17 @@
               while(it.hasNext())
               {
                   refObj = it.next();
  -                // set FK in refObj if it is materialized
  -                if(getProxyFactory().isMaterialized(refObj))
  +                /*
  +                TODO: Check this!
  +                arminw:
  +                When it's necessary to 'link' (set the FK) the 1:n reference objects?
  +                1. set FK in refObj if it is materialized
  +                2. if the referenced object is a proxy AND the main object needs insert
  +                we have to materialize the real object, because the user may move a collection
  +                of proxy objects from object A to new object B. In this case we have to replace the
  +                FK in the proxy object with new key of object B.
  +                */
  +                if(insert || getProxyFactory().isMaterialized(refObj))
                   {
                       ClassDescriptor refCld = getClassDescriptor(getProxyFactory().getRealClass(refObj));
                       // get the real object before linking
  
  
  

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