The second question is a bit more complicated. I have two entities with a one-to-many parent-child relationship. Say the parent is an entity named Parent. This is an abstract class; only Parent subclasses are instantiated. In the data model, the destination of the child to parent relationship is the abstract Parent class.
When I create a mapping model, there is no entity mapping for the Parent class automatically, I suppose because it is abstract. I can't compile the mapping model if there is no property mapping for the child to parent relationship. So I create an entity mapping for the abstract class Parent, and make a property mapping for the relationship using this mapping.
But when the model is migrated, the Parent mapping is never used, I suppose because there are no Parent entities. So that destinationInstancesForEntityMappingNamed:@"Parent" is empty for any child instance when the relations are being recreated. But it gets even stranger. I created a new migration policy class, MyPolicy, and assigned it as the custom policy for the child entity mapping. This class overrides only createRelationshipsForDestinationInstance. When this is called for a child instance, the child initially has a parent; but after executing super's createRelationshipsForDestinationInstance, the parent relationship is gone, which is consistent with there being no destination instances.
So what I've done is to save the parent, call the super method, and then restore the parent. This fixes the problem, but seems rather desperate. What is the correct method for dealing with a property mapping that involves an abstract class?
-- Timothy Larkin Abstract Tools Caroline, NY
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]