Thomas Mahler wrote:
Hi Sebastian,

Did you read http://db.apache.org/ojb/tutorial3.html#Setting%20Load,%20Update,%20and%20Delete%20Cascading ?

You encounter the interference of two features here: the cascading operations feature and the removal-aware collection.

1. If you remove a Child and then delete the parent, The cascade feature does only delete those elements currently present in the collection.

2. If you remove a child and then store the parent, the removal aware collection notices that the removed child should be removed in the db too.

ALthough this all works as designed, I have to admit that it may be a bit confusing.
Maybe it would be more consistent, if we would change the semantics of 1. as follows:
If you remove a Child and then delete the parent, the cascading feature deletes the childs currently present in the collection and all removed child objects?


cu,
Thomas

Hello Thomas,
thanks for your quick response. I read the section you mentioned sometime before I encountered this issue, so I didn't have the exact definition in mind.
I of course can live with the "workaround" of saving the parent object first, but I would like to see the semantic change you described as it really makes sense and helps to avoid orphan entries in the database.


Regards,
Sebastian


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



Reply via email to