Hi !
I use nhibernate 1.2 CR 1 with the one-table-per-concrete-class mapping paradigm. I want to use NHibernate.Mapping.Attributes to auto-generate mapping files. The problem is, that for inherited properties from base classes, no mappings will be generated. Only for the properties defined in the current class the mappings are created by NHibernate.Mapping.Attributes.
An example:
Code:
[Class]
public class PersistenceBase
{
private int persistenceId;
[Id]
public virtual int PersistenceId
{
get { return persistenceId; }
set { persistenceId = value; }
}
}
[Class]
public class Child: PersistenceBase
{
private string name;
[Property()]
public virtual string Name
{
get { return name; }
set { name = value; }
}
}
The output xml is:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="HiberTest.PersistenceBase, HiberTest">
<id/>
</class>
<class name="HiberTest.Child, HiberTest">
<property name="Name" />
!! ID would be needed here
</class>
</hibernate-mapping>
Is there a way to enable NHibernate.Mapping.Attributes to also map the inherited fields to child-classes ?
Thanks for your help.
Thomas