• 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
Relationship on parent not observed properly for subentity (was: Abstract entities and relationships)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Relationship on parent not observed properly for subentity (was: Abstract entities and relationships)


  • Subject: Relationship on parent not observed properly for subentity (was: Abstract entities and relationships)
  • From: Charilaos Skiadas <email@hidden>
  • Date: Wed, 13 Jul 2005 12:49:41 -0500

Upon further examination, this has nothing to do with abstract classes. If a relationship "rel1" is set up to an entityA from an entityC, with inverse "rel2", and "item" is an object of entityB, a subentity of entityA, then setting the value for rel2 does not update rel1 as well.
Further, this can be saved with no problems, and it is clear in the XML that, will "item" points through rel2 to its corresponding thing of entityC, that thing does not point back.
Should I consider this a bug?
On Jul 13, 2005, at 3:15 AM, Charilaos Skiadas wrote:


I have three entities:
1) GradeItem is an abstract entity. It has a to-one relationship "type" to entity GradeType.
2) ConcreteGradeitem is an entity with parent GradeItem.
3) GradeType is an entity with a to-many relationship "gradeItems" to GradeItem, inverse to "type".


Now, I create an object of type 2 in code, and set its type through setValue:forKey: The code is basically:

NSManagedObjectContext *theContext = [self managedObjectContext];
NSManagedObject *item = [NSEntityDescription insertNewObjectForEntityForName:@"ConcreteGradeItem" inManagedObjectContext:theContext];
[item setValue:type forKey:@"type"];


Now, I would expect that gradeItems would be updated from this, since it is inverse to type. However it doesn't, as looking at the XML file shows. If one the other hand I use
NSManagedObject *item = [NSEntityDescription insertNewObjectForEntityForName:@"GradeItem" inManagedObjectContext:theContext];


instead, then it does get updated.
Now, I would expect that it should not matter to GradeType, which of the two I use, but it does. Is this a misconception on my part, or a bug?


thanks,
Haris


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40math.uchicago.edu


This email sent to email@hidden


Haris


_______________________________________________ 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
References: 
 >Abstract entities and relationships (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: Host name of remote volume
  • Next by Date: Re: unique properties using Core Data
  • Previous by thread: Abstract entities and relationships
  • Next by thread: LSUIElement and LSBackgroundOnly
  • Index(es):
    • Date
    • Thread