-->
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: need help with Many-to-Many
PostPosted: Sun May 18, 2008 2:51 pm 
Newbie

Joined: Sun May 18, 2008 2:34 pm
Posts: 1
Hi All

I'm using Nhibernate v. 1.2.1
The task is to create Top10 List of songs. So I setup relationship between Top10 and Song entity as:

private IList<Song> _songs = new List<Song>();
[Bag(1, Name = "Songs", Table = "Top10Songs", Cascade = CascadeStyle.None, Lazy = true)]
[Key(2, Column = "Top10_ID")]
[ManyToMany(3, ClassType = typeof(Song), Column = "Song_id")]
public virtual IList<Song> Songs
{
get { return _songs; }
set { _songs = value; }
}


The question how do I indicate that this interim table (Top10Song) needs an extra column to hold the position of the song in the top10 list.

Or may be it needs to be done difefrently?

Thanks in advance
V.


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.