Core Data: fetching keypaths through abstract entities
Core Data: fetching keypaths through abstract entities
- Subject: Core Data: fetching keypaths through abstract entities
- From: David Riggle <email@hidden>
- Date: Sun, 19 Oct 2008 15:00:21 -0700
I want to use a keypath that goes through an abstract entity down into
a concrete sub-entity. For example, given this data model:
Abstract entity: person
Concrete sub-entities: man, woman
Abstract entity: club
relationship: members (->> person)
Concrete sub-entities: allMale, coed
I want to specify a fetch request like so:
Entity: "allMale"
Predicate: "ALL members.beard > 0"
Since beard is not an attribute of the abstract person entity that
members points to, I get the following error at runtime:
NSInvalidArgumentException -- keypath members.beard not found in
entity <NSSQLEntity allMale id=8>
Other than redesigning the data model, is there a way to specify the
concrete entities that Core Data should use at each point in the
keypath? I.e. something like "ALL members.(man)beard > 0"?
_______________________________________________
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