Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: fetching keypaths through abstract entities



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.