• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData, reset a persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: CoreData, reset a persistent store
      • From: Chris Hanson <email@hidden>
References: 
 >CoreData, reset a persistent store (From: Pierre Chatelier <email@hidden>)
 >Re: CoreData, reset a persistent store (From: Jim Correia <email@hidden>)
 >Re: CoreData, reset a persistent store (From: Pierre Chatelier <email@hidden>)
 >Re: CoreData, reset a persistent store (From: mmalc crawford <email@hidden>)
 >Re: CoreData, reset a persistent store (From: Pierre Chatelier <email@hidden>)
 >Re: CoreData, reset a persistent store (From: mmalc crawford <email@hidden>)

  • Prev by Date: QTKit : Creating and saving a movie Reference to an URL
  • Next by Date: escape special characters in HTML
  • Previous by thread: Re: CoreData, reset a persistent store
  • Next by thread: Re: CoreData, reset a persistent store
  • Index(es):
    • Date
    • Thread