Re: Polymorphic relationship and migration
Re: Polymorphic relationship and migration
- Subject: Re: Polymorphic relationship and migration
- From: Quincey Morris <email@hidden>
- Date: Sun, 29 Nov 2009 03:16:09 -0800
On Nov 27, 2009, at 17:14, Yi Lin wrote:
> For example, if I have a relationship called "shape" that refers to the Shape abstract entity, with concrete classes Triangle, Square, etc. In the mapping model, there's no sensible setting for the Mapping Name field of "shape". If I set the Mapping Name to TriangleToTriangle, then Square relationships will not be set. And if I set the Mapping Name to "Shape", than the relationship would not be set at all because there are no concrete instances of Shape.
If the relationship "shape" is defined to be to a Shape entity, it seems that the correct mapping would be SomethingToShape. ("Something" is the entity from which the "shape" relationship emanates, but you didn't say what entity that was.) Even though there aren't any concrete instances of Shape, the actual instances (Triangle, Square, etc) *are* also Shape objects.
Perhaps the confusion arises because Leopard Core Data doesn't properly create the mappings for migrating abstract entities. (I don't know if this is fixed in Snow Leopard, but I suspect not.) If that's the problem, then adding the missing mapping should give you a usable mapping model.
Or have I missed your point?
_______________________________________________
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