Re: [OJB-developers] conditional persistence of objects
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-06-16 07:06:13
|
Hallo Bastian, Bastian Schmitz wrote: > hi you OJB developers, i've bee working with OJB for a couple of > months now and in my opinion you are performing great work. > thanks, > in my application's datamodel there are many objects (A) that reside > in a default, dummy or empty state at runtime and i would like them > not being persisted, when all the other objects (B) around them are > stored in the database and all references / fks to them stored as SQL > NULL values. reference-descriptors and collection-descriptors pointing from B to A must be set to auto-update="false" to avoid cascading storing of A objects! This can be done quite easily with existing OJB API at runtime. (start with broker.getClassDescriptorFor(B.class)) > on the other hand, on matialization of objects B > containing NULL references / fks to A's, these references should be > filled with dummy A's. OJB provide InstanceCallbacks. Let your class B implement the interface ojb.broker.PersistenceBrokerAware you can put your initialization code in the method afterLookup(). > the A objects have a method that "decides" > whether these objects should be persisted or not. this "mechanism" > should also work with collection descriptors. > can be done as described above. cheers, Thomas > now, my question is how this behaviour could be realized with OJB and > where are the "right" starting points for this. > > thanks in advance bastian schmitz > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=dntextlink > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > |