views:

30

answers:

1

There is a table A containing common unversioned data for entities. There are also tables B,C,D with versioned data of particular entity type. All of these tables are referencing table A.

The task is to add a mapping of a property of entity's type, for example, stored in table B, which would reference table A, and specify a rule how entity should be fetch from table B based on identifier from table A. (For example, to fetch latest version of an entity).

It it possible with NHibernate?

A: 

Take a look at this post by Ayende. You can map this using table per hierarchy or table per sub class. If you choose the former you will have to add a discriminator column to table A.

s1mm0t

related questions