How to map many-to-many in NHibernate correctly(notherdev.blogspot.com)

submitted by notherdevnotherdev(238) 5 months, 25 days ago

Many-to-many relationships exist only at object model level - at database level it is only a concept implemented using two many-to-one relations with intermediate table. We can implement it the same way in our NHibernate-based object model, but we don't want User and Group to have collections of some UserInGroup objects that have no real object-oriented meaning. We do want User to have many Groups and Group to have many Users - as simple as it can be. Fortunately, this is quite common scenario and NHibernate can support it very well with respect to database-level constraints and good practices, but only when mapped and used with care.

add a comment |category: |Views: 9

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story