Re: Data in many-to-many join table
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