• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fetching entities where the relations are known
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fetching entities where the relations are known


  • Subject: Fetching entities where the relations are known
  • From: rakel <email@hidden>
  • Date: Tue, 10 Oct 2006 23:13:06 +0200

I have a Core Data model, which looks something like [Person] ----* [Value] *---- [Variable] I.e. the Person entity has a to-many relation to the Value entity, and the Variable entity also has a to- many relation to Value. Value in turn has a to-one relation with both Person and Variable (and before anyone asks, no, this is not a "many to many"-relational table as seen in ordinary relational databases).

Also, the Value entity has a date attribute, called assessmentDate.

Now, in my application I have a Person instance and a Variable instance. How do I get all the corresponding Value instances, sorted on assessmentDate?

I have been trying around with fetch predicates, with no success ( [NSPredicate predicateWithFormat:@"personr == %@", currentPerson ] does not do the trick). Another idea could be to ask the Person for the set of all its Values and then the Variable for the set of all its Values, and then to take the union of those two sets -- but this won't sort the Values.

Regards /Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: [ANN] Cocoa client for Cayenne ROP
  • Next by Date: Re: Code injection and replace methods at runtime
  • Previous by thread: [ANN] Cocoa client for Cayenne ROP
  • Next by thread: DO load connection problem
  • Index(es):
    • Date
    • Thread