Hello Shane,

> -----Original Message-----
> From: Shane Mingins [mailto:[EMAIL PROTECTED]


> If OJB is meant to provide the persistence mechanism for my 
> application so
> that I can then just code against Objects, why shouldn't I 
> expect to be able
> to persist an Object that holds a collection of other Objects 
> (1->n) and
> have the state of my Object reflected in the persistence 
> operation without
> micro-managing the 'n' side of the relationship?

OJB can do this for you.  When I wrote "Why would you expect that to
happen?"
I was referring to your expectation that objects get removed from
the database when you remove them from a particular collection.
This is not was I would expect.  (But I think even that
is possible with the 'RemovalAwareCollection').

> It seems that the original persistence of the Object supports our
> expectations but subsequent operations do not.

May I ask which API you use?  The ODMG API contains more 
magic, so might be more happy with it than with the 
PersistenecBroker API. 

If you use the PB API nevertheless, you might try to set 
auto-update attribute in the collection-descriptor to true,
it might do what you want.
There are some other attributes that control the behaviour
of references and collections.  See http://db.apache.org/ojb/repository.html
for details.

> > My problem is that the objects B I remove from the list of 
> > objects B are not deleted in the database when I update the 
> object A.
> 
> Why would you expect that to happen? When you wish to delete an
> item b from the database, you have to explicitly delete it with the
> suitable API call, e.g.
>       broker.delete(x);  // PersistenceBroker
> or
>       database.deletePersistent(x);  // ODMG

Olli

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to