• 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
Entities bound through third entity. Best practice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Entities bound through third entity. Best practice?


  • Subject: Entities bound through third entity. Best practice?
  • From: Charilaos Skiadas <email@hidden>
  • Date: Fri, 8 Jul 2005 17:48:28 -0500

Sorry for the unclear subject, but I just couldn't find anything better. I am trying to figure out what the best way to accomplish the following is:
I have a model with three entities, student, gradeItem, and grade. Both student and gradeItem have a to-many relationship with grade, with to-one inverses. The idea I am trying to get to is that gradeItem stands for a type of grade, say midterm1, midterm2, final etc. So what I want is for each student, and each gradeItem, for there to be *exactly one* grade corresponding to them through the relationships.
The problem I am encountering at this point is, that I would like a particularly easy way if possible, to make it so that when a new student is added, a new grade is created for that student and each gradeItem in existence. Similarly if a new gradeItem is created. Of course what one has to do is, when a new student is created, simply go through each gradeItem, and add a grade for it and that student. I was just hoping that maybe there is a way to do this automagically.
Second problem is, how to ensure that there is exactly one grade corresponding to each pair of gradeItem-student. I think in my case this will not be a problem simply because I will not be allowing the user to create new grades, but instead all grades will be created upon creation of gradeItems/students. So it's more of an academic question, whether it is easy to achieve, but nonetheless one that I would like to know.


Any thoughts?
I must admit I did not look very hard to see if this is answered anywhere, so please feel more than free to send me to RTFM.


thanks,
Haris


_______________________________________________ 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: mutableArrayValueForKeyPath gives me valueForUndefinedKey
  • Next by Date: Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
  • Previous by thread: Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey[solved]
  • Next by thread: 2nd target not like the 1st, why?
  • Index(es):
    • Date
    • Thread