As I explained, you don't use a many to many for that. You map the "Join" data, as it's own class. Then you can map anything you want. Any bits of extra data. Then your Order/Product has a collection of that join class defined as a HasMany(), not a HasManyToMany().
On Wed, Feb 17, 2010 at 10:47 AM, Del Brocco Andrea <a.delbro...@gmail.com>wrote: > I have a rapresentation because i have extra data in the relation (es > quantity) i've tried first with many to many using rel table but i'm > not be able to map extra data so i try to modify the model using > another class and subclassing > > the real problem is how can i map extra data in the relation table > with object properties of entity? > > > On Feb 17, 4:55 pm, Hudson Akridge <hudson.akri...@gmail.com> wrote: > > Since you've got an actual class representing your join table, it's not a > > many to many. You can use a many-to-many if you drop the ProductInOrder > > class, and instead use an IDictionary<Product,int> on the Order side, > with > > an entity key on the dictionary. > > > > Otherwise you map ProductInOrder with references() back to Order and > > Product. Order and product each have a HasMany() to ProductInOrder. > > > > On Wed, Feb 17, 2010 at 9:03 AM, Del Brocco Andrea < > a.delbro...@gmail.com>wrote: > > > > > > > > > > > > > Hi, the sample scenario is this: > > > > > table Order > > > with > > > id, OrderDesc, > > > > > table Product > > > with id, DescProduct > > > > > table OrderDetail > > > with idOrder ,idProduct, quantity > > > > > objects > > > > > object Order > > > { > > > idOrder, > > > DescOrder, > > > ICollection<ProductInOrder> Details > > > } > > > > > object ProductInOrder > > > { > > > idProduct, > > > DescProduct > > > quantityAB > > > } > > > > > Ill try to use manytomany or join and different models but i'm not be > > > able to recostruct the behaviour > > > (distinct objects and collections and so on, productbase mapped to > > > product and a subclass productorder with a join, etc) > > > > > The sample is not my real problem but the situation is the same, i > > > want to know how i can map or rearrange domain for this situation. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Fluent NHibernate" group. > > > To post to this group, send email to > fluent-nhibern...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com> > <fluent-nhibernate%2bunsubscrÂ...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/fluent-nhibernate?hl=en. > > > > -- > > - Hudsonhttp://www.bestguesstheory.comhttp://twitter.com/HudsonAkridge-Hide > > quoted text - > > > > - Show quoted text - > > -- > You received this message because you are subscribed to the Google Groups > "Fluent NHibernate" group. > To post to this group, send email to fluent-nhibern...@googlegroups.com. > To unsubscribe from this group, send email to > fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- - Hudson http://www.bestguesstheory.com http://twitter.com/HudsonAkridge -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibern...@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.