Re: EO: Object Collections?
Re: EO: Object Collections?
- Subject: Re: EO: Object Collections?
- From: Christopher Pavicich <email@hidden>
- Date: Mon, 28 Jul 2003 07:27:20 -0400
Bill:
You need a 3 table to do this; Song, Genre, and X_SONG_GENRE.
The X_SONG_GENRE table should have its own primary key, a foreign key that is the SONG's primary key
and a foreign key that is the GENRE's primary key. Then EOModeler you can put a TO-MANY relationships on
both SONG and GENRE. You should also be able to flatten the relationship (someone check me on this, my EOF is
rusty) between SONG and GENRE. This will allow you to ignore the X_SONG_GENRE table and EO in your code and just do:
Song song;
song.genres();
or
Genre genre;
genre.songs();
--CMP
On Monday, July 28, 2003, at 05:52AM, Goodbye Bill <email@hidden> wrote:
>SCENARIO:
>Assume we have two objects in our model: "Song" and "Genre." The goal is to
>be able to assign each "Song" object to multiple "Genre" objects.
>
>QUESTION:
>Using the example above, must there be some type of third object -- possibly
>a "SongGenreAssignment" object to allow for a many-to-many relationship?
>
>It would appear that EO should take care of this thing automatically if the
>developer is to be able to break away from manipulating the database
>directly. Unfortunately, there does not appear to be any way to define a
>collection of objects within EO, other than using a relationship (which does
>not allow for a many-to-many hierarchy).
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
>
--cmp
email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.