• 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
Re: Data in many-to-many join table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data in many-to-many join table


  • Subject: Re: Data in many-to-many join table
  • From: Arturo Perez <email@hidden>
  • Date: Thu, 14 Apr 2005 13:21:44 -0400

Wolfram Stebel wrote:

Hi folks,

i have a many-to-many relation

    person<<-->>task

Each person should be able to "confirm" the task.
So i packed the "confirmed" attribute into to join table Task_Person.
I felt this is the best place, but how can i cheapest access this field?

In the moment i do fetches on the table directly, using both related
objects.
Then i have the EOGeneric, where i use key/value coding to set and get
values.
Is there a better precoded way for this?

Assume Person with myTasks NSArray attribute (i.e. your toMany) pointing to PersonTask.
Assume Task with personsWorkingOnTask NSArray attribute pointing to PersonTask.
Assume PersonTask with person, task, and confirmed attributes.


Assume you have a Person in hand with one task. Then you do
(PersonTask)(person.myTasks.objectAtIndex(0)).takeValueForKey(Boolean.true, "confirmed").


That's it. You can't flatten the join table because it has an attribute that's not related to the act of joining.

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


References: 
 >Data in many-to-many join table (From: Wolfram Stebel <email@hidden>)

  • Prev by Date: Re: Tiger, EOF & CoreData
  • Next by Date: Re: Tiger, EOF & CoreData
  • Previous by thread: Data in many-to-many join table
  • Next by thread: NoClassDefFoundError com/webobjects/_eoproject/_WBInterfaceDescriptor
  • Index(es):
    • Date
    • Thread