on 07-14-2004 10:03 AM
Hello,
is it possible to trigger cascading deletes on JDO objects automatically ?
Regards, Udo
Hi Udo,
There was a long debate in the JDO 1.0 expert group on how to express cascading deletes: declaratively or programmatically. Well, they decided in favor of the programmatic approach.
In order to implement cascading deletes in JDO, you have to make use of the jdoPreDelete instance callback method. jdoPreDelete is called on the JDO instance just right before the instance is "deleted". Simply call deletePersistent on the referenced objects and collections.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm a little new to JDO and we're trying to implement this functionality. Could you please show a simple pseudo code explaining this preDelete. Something like deleting an employee which automatically deletes the employee from the department would be helpful. Also, will this work for a many to many relationship?
Thanks,
Dustin
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.