Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate Designer - many to many

Following on from a previous question, I am evaluating MindScape's NHibernate Designer.

When I add a many to many mapping, it says that it won't propagate this to the database..

Is there a way to map the many to many using this tool (a code generator). If I manually edit the mappings xml I lose it on changing the model.

The produced map:

<bag name='Roles' table='`RoleUser`'>
  <key column='`UserId`' />
  <many-to-many column='`RoleId`' class='Role' />
</bag>

I don't want to create an entity item_item and do a one to many on that link table as this should be done by the designer (adding an entity pollutes the business objects and is wrong).

Their help documents say that this can happen if you set the source column name, and destination column name... Not working!

enter image description here

like image 854
Darbio Avatar asked Dec 28 '25 21:12

Darbio


1 Answers

I am one of the developers of the NHibernate designer.

Earlier versions of the designer didn't support generating the database schema for many-to-many associations. This limitation has been removed in the latest version. You can get the latest version through the VS2010 Extension Manager Updates tab.

like image 83
itowlson Avatar answered Dec 31 '25 00:12

itowlson