iPhone Development - Query related records using CoreData

Posted by Mustafa on Stack Overflow See other posts from Stack Overflow or by Mustafa
Published on 2010-04-12T07:03:56Z Indexed on 2010/04/14 12:23 UTC
Read the original article Hit count: 413

I have a case where i have three entities with one-to-many and one-to-many relationships:

Entity A (Entity B relationhip), 
Entity B (Entity A relationship, Entity C relationship),
Entity C (Entity B relationhip)

I have the reference of Entity A, and now i want to fetch all the related Entity C records. How can i do that? (with least amount of code)

Edit: Here's another way to put it.

Can we perform joins with CoreData. For example, (and this is a very crude example), We have a following entity-relationship:

Grand Parent  (1)---(m)  Parent
Parent        (1)---(m)  Child

So, now if i have "Albert" the Grand Parent, and i want to get all his grand children, how can i do that?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about coredata