Abstract entities and relationships
Abstract entities and relationships
- Subject: Abstract entities and relationships
- From: Charilaos Skiadas <email@hidden>
- Date: Wed, 13 Jul 2005 03:15:56 -0500
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:
This email sent to email@hidden