Fluent NHibernate table per subclass inheritance mapping

I'm new to NHibernate and Fluent NHibernate. I'm wondering how to properly use Fluent NHibernate with the "table per subclass" mapping strategy.

This is an example of what I'm after. More specifically though, I need a way to break the subclass mappings into separate files.

Also, when adding records, I need NHibernate to first insert into the parent, then into the child. Below is a simplified prototype of my database. Personnel, Images, and Projects should all inherit from Entities. Entities is responsible for generating the primary key. PersonnelId, ImageId, and ProjectId all have foreign keys referencing EntityId.

Hope that makes sense, thanks in advance.

alt text http://img695.imageshack.us/img695/6112/databasediagram.jpg alt text http://img693.yfrog.com/img693/4980/databasecolumns.jpg


There's a link at the top of the article you referred to which contains updates for the latest version of Fluent NHibernate, specifically those for separating subclass mappings into separate files. Updates to subclass and joined subclass mapping in fluent nhibernate 1.0RC.

Also, you should read the Fluent NHibernate wiki on the subject of subclasses.

链接地址: http://www.djcxy.com/p/39452.html

上一篇: 如何在Fluent NHibernate 1.1中引用Fieldnames

下一篇: 流利的NHibernate表每个子类的继承映射