• 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: Core Data SQL store looses data that XML store does not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data SQL store looses data that XML store does not


  • Subject: Re: Core Data SQL store looses data that XML store does not
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 10 Aug 2005 00:13:21 -0700


On Aug 9, 2005, at 11:18 AM, Scott Ellsworth wrote:

My Location entity has six toMany relationships to itself. There are no reverse relationships set for these, because I rarely care about the other direction

This is almost certainly the issue.

If you don't specify the reverse relationships, then Core Data cannot know whether the reverse is intended to be to-one or to-many, so it defaults to to-one. If (as *appears* to be the case) you're expecting the relationship to be many-to-many, then you'll run into problems...

(Since Core Data assumes an unspecified inverse is a to-one, "it creates a foreign key column in the destination table. If the destination object can be part of more than one source object's relationship, this column gets overwritten as source objects are saved".)

Take-home point: You should always model to-many relationships in both directions.

Filed as bug 4204193.

Actually filed as bug 4204139.
(Curiously, 4204193 was filed by Scott too...)

mmalc
(With thanks to Melissa.)

_______________________________________________
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: Core Data SQL store looses data that XML store does not
      • From: Scott Ellsworth <email@hidden>
    • Re: Core Data SQL store looses data that XML store does not
      • From: "Marcus S. Zarra" <email@hidden>
References: 
 >Core Data SQL store looses data that XML store does not (From: Scott Ellsworth <email@hidden>)

  • Prev by Date: Re: A question about bindings and multiple nib files
  • Next by Date: RE: how to manage width of popuplist of a combobox???
  • Previous by thread: Core Data SQL store looses data that XML store does not
  • Next by thread: Re: Core Data SQL store looses data that XML store does not
  • Index(es):
    • Date
    • Thread