NHibernate SchemaExport With Abstract Class Lists Not Being Created
I am currently trying to create a base class for my domain objects that contains a list because we have to model an excel spreadsheet with very particular requirements.
My classes look like this:
public abstract class BaseClass : EntityBase
{
public BaseC开发者_如何学运维lass()
{
PersonnelList = new List<Person>();
}
public virtual IList<AuditPersonnel> PersonnelList { get; set; }
public virtual DateTime? DateCompleted { get; set; }
}
public class SubClass : BaseClass
{
public virtual string Details { get; set; }
}
public class SubClass2 : BaseClass
{
public virtual DateTime? StartDate { get; set; }
}
When I use the schema export function to create the database the list relationship is not created in the database tables.
Is this even possible? Should I be using the SubClass method on my mappings to create these classes in a single table?
Any help is appreciated.
I ended up removing the abstract from the BaseClass and using multi-table inheritance and that has worked out well.
精彩评论