I have tables: ARTISTS, INSTRUMENTS, ALBUMS, ARTISTS_INSTRUMENTS,ALBUMS_ARTISTS_INSTRUMENTS. The last one records which instrument an artist plays on an album:
Code:
ALBUMS_ARTIST_INSTRUMENT:
pk ALBUM_ID
pk ARTIST_ID
pk INSTRUMENT_ID
On the Album object I can map (as a composite element with 2 many-to-one) an object "ArtistInstrument" that has 2 properties: the Artist and the Instrument.
This way I can get from the db:
Code:
ALBUM: MYALBUM
player/instrument:
davis/trumpet
coltrane/sax tenor
coltrane/sax alto
But how could I get:
Code:
ALBUM: MYALBUM
player/ LIST of instruments:
davis:trumpet
coltrane:sax tenor,sax alto
That is, an Album with a list of players who have a list of instruments played in this album?
I don't know if I made myself clear...