-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ternary association and sublist
PostPosted: Fri Feb 20, 2004 8:06 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:33 am
Posts: 29
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.