Re: Core Data: Delete stops at first object in Cascade
Re: Core Data: Delete stops at first object in Cascade
- Subject: Re: Core Data: Delete stops at first object in Cascade
- From: Jerry Krinock <email@hidden>
- Date: Sun, 8 Feb 2009 20:07:52 -0800
I got a suggestion off-list that maybe cascade-deleting would be
inhibited if the relation was "optional". In my real project, all my
relationships are optional. The "Delete Rule" documentation makes no
mention of "optional" settings affecting what happens, but I thought
I'd test this suggestion anyhow.
Thanks to the the Core Data Entity in Interface Builder, I whipped up
and tested a little demo project with just the four entities as shown
below, a "number" attribute for each, "to many" and "Delete Rule"
settings as shown, and all six relationships optional. Result:
Deleting X deletes B and T, as expected and desired.
So there must be some other factor in my real project that is causing
T to be not deleted when I delete X. Performing a "Save As" and
examining the XML, I have confirmed that X and B are definitely being
deleted. My real project has other entities connected to X and J on
the right and left, and of course the entities in my real project have
lots more attributes.
Does anyone know of any other factor that might prevent an object from
being cascade-deleted?
Thanks,
Jerry Krinock
Cascade---> Cascade-->> Nullify--->
-->> X B T J <<--
<<--Nullify <---Nullify <<--Cascade
In my real project, X and J have relationships to other objects in the
greater graph, but B and T have only those shown. B is always added
to and "owned by" an X. T is a lightweight object which the user can
easily recreate. In a popup menu, the user can select any available B
for a T, but the relationship is optional because not all "types" of T
are can have a B.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden