Re: CoreData, reset a persistent store
Re: CoreData, reset a persistent store
- Subject: Re: CoreData, reset a persistent store
- From: Pierre Chatelier <email@hidden>
- Date: Thu, 16 Nov 2006 13:33:54 +0100
Again that's the wrong way round to think about it. (...) If you
want to remove all instances of an entity, then you must ensure
that the resulting object graph is valid (there may be
relationship constraints that need to be applied)
Yes, but the NSPersistentStoreCoordinator is initialized with the
model, so the persistent store should know how to cascade
deletions by traversing relationships
Cascading deletions per se is not the issue; the issue is whether
the resulting object graph is in a valid state. This can only, in
the general case, be determined by having the objects in memory.
I do not understand why you must have the objects in memory to know
if this is a valid state... I was expecting the persistent store to
be able to understand relationships, but perhaps it's not the case ?
(Consider what happens if you allow the object graph to be saved in
an invalid state, for example if the destination of a required
relationship is not present:
Do you mean, for instance, the following :
-Let's suppose I have a persistent store containing two types of
entities A and B, with relation ships between them
-Let's suppose the persistent store allows me to delete all entities
of type A.
-if I remove all entities A in the persistent store, only the
managedObjectContext is able to determine cascading deletions. The
persistent store does not know which B entities were connected and
should be removed ?
Thanks for your patience
Regards,
Pierre Chatelier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden