thank first,

PersistenceBroker *delete elements* from the database that have been removed
from the collection only if i do this :
for example : A 1:n B
1. i get A from database using OJB Broker.
2. i delete one element B from A : A.getBCollection().remove(o);

in this case yes the PB delete the element from database . but in generale
we don't
invoke remove but we construct a new collection and we set it :
1. get A from database.
2. Collection bCol = new ArrayList();
    A.setBCollection(bCol);

in this case the element that not figure in bCol are not deleted because i
use ArrayList. (in my Application i can't put RemovalAwareList directly
inorder to keep the application independent of OJB classes ...)

so what is the solution please ... without using ODMG ?????


Thanks

On 3/7/06, Armin Waibel <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> ABOU LINA wrote:
> > Hi,
> > in ojb document :
> > ---------------------------------------
> > Say you use the PB to query an object O that has a collection attribute
> col
> > with five
> > elements a,b,c,d,e. Next you delete Objects d and e from col and store O
> > again with
> > PersistenceBroker.store(O);
> > PB will store the remaining objects a,b,c. But it will not delete d and
> e !
> > If you then
> > requery object O it will again contain a,b,c,d,e !!!
> > --------------------
> >
> > i ask if the new version of PB (1.0.4) still behave like this ???
>
> Oops! Seems you found some outdated documentation - I will fix this till
> next release.
> With corresponding settings OJB 1.0.4 is able to detect the deleted
> objects of the 1:n reference. More info see
>
> http://db.apache.org/ojb/docu/guides/basic-technique.html#1%3An+auto-xxx+setting
>
> http://db.apache.org/ojb/docu/guides/advanced-technique.html#which-collection-type
>
> regards,
> Armin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to