• 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: Question regarding nullified relationship objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Question regarding nullified relationship objects


  • Subject: re: Question regarding nullified relationship objects
  • From: Ben Trumbull <email@hidden>
  • Date: Mon, 9 Feb 2009 12:14:32 -0800

If I have two entities, A and B, where A <-->>B, and the delete rule in
entity A's relationship to B is cascade, and B's delete rule for the
relationship to A is nullify, what happens to the actual "row" that holds
the relationship data in A that was once B after B is deleted? Does it get
completely deleted, or is it left as garbage that is later cleaned up, or is
left and later re-filled?

If you delete B first, it nullifies the inverse, and A remains alive and well. A will then have NULL for its column referring to B's table. If you delete A first, it cascades the deletion, and everything will be deleted.


what happens to the actual "row" that holds the relationship data in A that was once B after B is deleted?

The stuff is deleted. Often it's not a row. There might be a join table, or there might not. "Implementation dependent" For educational purposes only, if you want to get a better feel of what's going on, you can use -com.apple.CoreData.SQLDebug 1 as a user default. I prefer the command line like:


some.app/Contents/MacOS/some  -com.apple.CoreData.SQLDebug 1

Unlike .NET, the association tables are not first class objects of their own, but rather just a property on the source object.

- Ben



_______________________________________________

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


  • Follow-Ups:
    • RE: Question regarding nullified relationship objects
      • From: "Jon C. Munson II" <email@hidden>
  • Prev by Date: RE: Determining if a user is logged in from a Launchd Daemon
  • Next by Date: RE: NSTableView Popup Column issue
  • Previous by thread: Re: Question regarding nullified relationship objects
  • Next by thread: RE: Question regarding nullified relationship objects
  • Index(es):
    • Date
    • Thread