-->
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.  [ 3 posts ] 
Author Message
 Post subject: Getting extra info from many-to-many relationship
PostPosted: Tue May 25, 2004 8:59 am 
Newbie

Joined: Tue May 25, 2004 8:50 am
Posts: 8
I have three columns in the database:

DISC with columns ID and TITLE
SONG with columns ID and TITLE
DISC_SONG with columns DISC_ID, SONG_ID and SEQUENCE

In my mapping file I have the following lines:

Code:
<set name="songs" table="disc_song"  order-by="sequence asc">
  <key column="disc_id" />
  <many-to-many column="song_id" class="com.huijzer.musicweb.Song" />
</set>


When I retrieve the relevant song objects with the following code:

Code:
Set songs = myDisc.getSongs();


I would like the returned Song objects to include the SEQUENCE column so I can use

Code:
mySong.getSequence()


to return the sequence column for that particular Disc.

Is this possible?

Thanks in advance for any help!
Arjan Huijzer


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 25, 2004 9:11 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Look the documentation examples with the product customer and order case.
You can use a component element to manage this case.
or 2 one to many relationships.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 25, 2004 9:25 am 
Newbie

Joined: Tue May 25, 2004 8:50 am
Posts: 8
Thanks! I'll look at the example :-)


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

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.