1

I have 2 tables having many to many relation and hence there is junction table to resolve this like... Table1, Table2 and Junction table name Table1Table2 having Foreign key of Table1 and Table2 and both are composit key here is what I am doing and getting exception

<class name="Table1Table2" table="Table1Table2" lazy="true">
<many-to-one name="Table1" column="Id" class="Table1"/>
<many-to-one name="Table2" column="Id" class="Table2"/>

is the above schema right?

Thanks

Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191

1 Answers1

1

Why don't you just use many-to-many?

http://codebetter.com/blogs/peter.van.ooijen/archive/2008/05/29/nhibernate-many-to-many-collections-or-mapping-is-not-one-table-one-class.aspx

This SO Question may also help you out: Fluent NHibernate Many-to-Many

Community
  • 1
  • 1
Tigraine
  • 23,358
  • 11
  • 65
  • 110