I have a scenario where I have EO's in many-to-many .... A <<-->> B. The delete rule is nullify when A is deleted. A is the important EO and generally one A is related to a whole lot of B's.

Now if the B was only related to the A being deleted, then those related B's should be deleted, as if we were cascade deleting, and not delete any B's that are related to other A's should not be deleted.

Now what I did was use the ERXEnterpriseObject#willDelete() EOTransition method to grab the related B's as immutable clone and iterate thru them, however by the time I get to willDelete the related B's relationship are already nullified and thus the relationship returns an empty array and the B orphans are already in the wild.

For now I am over-riding ERXGenericRecord#delete() and doing it there after super.delete(), but I really wanted a more robust solution that will catch the future orphans when the more standard editingContext.deleteObject(EO o) is used.

Any suggestions?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to