NHibernate now supports the joined table pattern

Published 23 April 07 05:36 PM | andersnoras 

I have been asked on several occasions how one can map a single entity to more than one table. Hibernate has supported a the "joined table" pattern for some time, but this feature hasn't been part available in NHibernate. A while a go I wrote a post on different options one has to work around this limitation. I this post I mentioned a patch for NHibernate that enables this feature. Ayende made me aware that this patch is now part of the NHibernate trunk. If you need to map an entity to more than one table you should NHibernate's features for this rather than repository composition or updateable views (which are the two alternative described in my post).

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Interesting finding - 04/25/2007 « Another .NET Blog said on April 26, 2007 12:59 PM:

PingBack from http://liangwu.wordpress.com/2007/04/26/interesting-finding-04252007/

# Dirc said on July 3, 2007 12:47 AM:

Note that there is a bug with this if using with subclasses:

see http://jira.nhibernate.org/browse/NH-1059

# Ralph said on March 26, 2008 9:35 AM:

Hi, the patch link is broken above(http://jira.nhibernate.org/browse/NH-466).

can you post on how to actually map one entity to more than one table?  i cant seem to find anywhere that will explain how to do this with NHibernate.

# Ralph said on March 27, 2008 7:59 AM:

this seems to be a working link to the jira issue:

http://jira.nhibernate.org:8080/jira/browse/NH-466

Leave a Comment

(required) 
(optional)
(required) 
Enter the code you see below