willDelete() won't be called on the rest until saveChanges()
On Jul 23, 2010, at 12:51 PM, Farrukh Ijaz wrote:
> Hi,
>
> I have a model where an entity A has a recursive relationship as parent
> "toParentOfTypeA()" and children "toChildrenOfTypeA()". Consider it as a tree
> structured entity.
>
> In the model have setup the entity to delete cascade.
>
> In the entity I have overriden the method willDelete(). Now when I delete the
> parent, it fires the willDelete() of it but does not fire willDelete() of
> it's children. When I checked in the willDelete() I found the toChildren()
> relationship is empty but the children are there and I access it in the
> component when I generate tree. Below is the source code.
>
> Follwing method is overridden inside entity A.
>
> public void willDelete() {
> ERXUtilities.deleteObjects(editingContext(), toChildrenOfTypeA());
> }
>
> // below code is somewhere else.
> A a = // object retrieved from the db.
> a.delete();
>
> Any Idea? If needed, I can send the source code too.
>
> Farrukh
>
> Sent from my iPad _______________________________________________
> 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/chill%40global-village.net
>
> This email sent to [email protected]
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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]
