Free NHibernate table for matching subclass inheritance

I am new to NHibernate and Fluent NHibernate. I am wondering how to use Fluent NHibernate correctly with a table-to-subclass matching strategy.

This is an example of what I need. More specifically, although I need a way to split subclass mappings into separate files.

Also, when adding records, I need NHibernate to first insert the parent and then into the child. The following is a simplified prototype of my database. Characters, images, and designs must be inherited from Entities. Entities are responsible for creating the primary key. PersonnelId, ImageId, and ProjectId have foreign keys that reference EntityId.

Hope this 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

+3
source share
1 answer

There is a link at the top of the article that you referred to that contains updates for the latest version of Fluent NHibernate, in particular, to separate subclass mappings into separate files. Subclass updates and unified subclass mapping in fluent nhibernate 1.0RC .

In addition, you should read the Fluent NHibernate wiki on subclasses .

+6

Source: https://habr.com/ru/post/1726350/


All Articles