re: CoreData: Using to-may relationships in fetch request predicates
re: CoreData: Using to-may relationships in fetch request predicates
- Subject: re: CoreData: Using to-may relationships in fetch request predicates
- From: Ben Trumbull <email@hidden>
- Date: Sat, 29 Aug 2009 18:25:14 -0700
in the typical CoreData example, if I want to fetch all departments
whose employees have a salary higher than a specified value, I will
perform a fetch on the Department entity using a predicate with the
following format:
"ANY employees.salary < %@"
This is working fine.
Now I want to fetch all departments whose employees fulfill the salary
condition AND are born after a certain date. I would expect something
like this to work:
"ANY (employees.salary < %@ AND employees.dateOfBirth > %@"
But it doesn't. Does anybody know if there is a way to use the ANY
statement with more than one condition?
You'll need to use a SUBQUERY predicate instead of an ANY/operator.
Probably easiest to do SUBQUERY(..).@count > 0
Please file a bug.
- Ben
_______________________________________________
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