db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject ManageableCollection.afterStore and auto-update ?
Date Sat, 03 Jul 2004 18:41:54 GMT
hi all,

while investigating the problem bogdan posted 
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db.apache.org&msgNo=8137 
i came across a potential problem with ManageableCollection.afterStore(). 
afterStore is called when auto-update is set to 'link' and 'object'.

i did a check to call ManageableCollection#afterStore only when CASCADE_OBJECT 
(auto-update = 'object' or 'true') is used, but actually i'm not sure whether 
this is always correct ?

...
// if CASCADE_NONE was set, do nothing with referenced objects
if (cod.getCascadingStore() != ObjectReferenceDescriptor.CASCADE_NONE)
{
     Object referencedObjects = cod.getPersistentField().get(obj);
     if (cod.isMtoNRelation())
     {
            storeAndLinkMtoN(false, obj, cod, referencedObjects, insert);
     }
     else
     {
           storeAndLinkOneToMany(false, obj, cod, referencedObjects, insert);
     }

     // BRJ: only when auto-update = object
     if ((cod.getCascadingStore() == ObjectReferenceDescriptor.CASCADE_OBJECT)
              && (referencedObjects instanceof ManageableCollection))
     {
         ((ManageableCollection) referencedObjects).afterStore(this);
     }
}

any ideas or comments on this issue ?

jakob



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