I may not be understanding your question fully, but I think NH already supports something like this using joined-subclass. I have a polymorphic Asset class (abstract) that has concrete implementation classes (File, URI). Most attributes are stored in the Asset Table with specific data stored in each subclass table (File, URI). It is very simple for now, but here is a sample of my mapping file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
namespace="AMA.Core.Domain.Assets"
assembly="AMA.Core">
<class name="Asset"
table="Asset"
dynamic-update="true">
<jcs-cache usage="read-write" />
<id name="id" column="AssetID" type="Guid" unsaved-value="{00000000-0000-0000-0000-000000000000}" access="field">
<generator class="guid" />
</id>
<version name="version" column="Version" type="Int32" unsaved-value="-1" access="field" />
<many-to-one name="Owner"
class="AMA.Core.Domain.Member"
column="OwnerID"
not-null="true"
access="nosetter.camelcase" />
<property name="Title" column="Title" type="String" not-null="true" />
<property name="DateCreated" column="DateCreated" type="DateTime" not-null="true" update="false" access="nosetter.camelcase" />
<property name="LastUpdate" column="LastUpdate" type="DateTime" not-null="true" />
<property name="IsArchived" column="IsArchived" type="Boolean" not-null="true" />
<bag name="MemberAssets"
table="MemberAsset"
cascade="all-delete-orphan"
inverse="true"
lazy="true"
access="nosetter.camelcase">
<key column="AssetID" />
<one-to-many class="MemberAsset" />
</bag>
<joined-subclass name="File"
table="`File`"
dynamic-update="true">
<key column="FileID" />
<many-to-one name="FileType"
column="FileTypeID"
class="FileType"
not-null="true"
outer-join="true"
cascade="none" />
<property name="FileName" column="`FileName`" type="String" not-null="true" />
<property name="Content" column="Content" type="BinaryBlob" not-null="false" />
</joined-subclass>
<joined-subclass name="URI"
table="URI"
dynamic-update="true">
<key column="UriID" />
<property name="Path" column="Path" type="String" not-null="true" />
</joined-subclass>
</class>
</hibernate-mapping>
In this situation, the PK of the File and URI tables are FKs to the PK of the Asset table.
hth,
-devon