What's better way to build NSPredicate with to-many deep relationships?
Posted
by Victor
on Stack Overflow
See other posts from Stack Overflow
or by Victor
Published on 2010-01-05T15:21:48Z
Indexed on
2010/04/22
14:33 UTC
Read the original article
Hit count: 659
Hello,
I have three entities: EntityA, EntityB and EntityC connected with to-many relationships.
See schema for details:
For getting all instance of EntityA which depend from EntityB.name I use the predicate like this:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY EntityB.name like 'SomeName'"];
What should be predicate for getting all instance of EntityA which depend from EntityC.name? I tried query like @"ANY EntityB.entitiesC.name like 'SomeName'" but get exception "multiple to-many keys not allowed here".
Best regards,
Victor
© Stack Overflow or respective owner