Re: Simple Many-to-Many Question
Re: Simple Many-to-Many Question
- Subject: Re: Simple Many-to-Many Question
- From: Deirdre Saoirse Moen <email@hidden>
- Date: Fri, 26 Aug 2005 17:09:56 -0700 (PDT)
On Fri, 26 Aug 2005, David Schneider-Joseph wrote:
> I have two entity tables, Person and Interest. I also have a many-to-
> many relationship between People and Interests, in a table named
> PeopleInterests. I am generating Java source with EOGenerator. How do
> I write a method for Person which returns an NSArray of all the
> Interests that person has? EOGenerator doesn't seem to generate the
> method itself, and nothing I can think of works.
This is one of those things that's easier to show than it is to explain.
In diagram view, select the two tables, then choose "Join in Many-to-Many"
(I'm not on my system right now, so I may have the wording off a bit).
This will generate an interests relationship in the Person class and a
persons relationship in the Interest class. These are transparent
pass-throughs of the entity in the middle (you may need to fidget with the
definitions to get the middle table named correctly).
--
_Deirdre web / blog: http://deirdre.net/
yarn: http://fuzzyorange.com cat's blog: http://fuzzyorange.com/vsd/
"Memes are a hoax! Pass it on!"
_______________________________________________
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