R – Fluent nhibernate table-per-hierarchy mapping

fluent-nhibernatenhibernate-mapping

I have a simple scenario where I have an entity Action (this is a workflow style application) that has a DueDate calculated property.

Now id like to introduce a SlidingAction, whose only difference (at this stage) is to override the DueDate calculation, as such has none of its own mapping.

Im having difficulty mapping this scenario since Fluent Nhibernate seems to be forcing me to map 'something' on the subclass.

Could someone shed some light?

Cheers,
Byron

public class ActionMap : ClassMap<Action>
{
    public ActionMap()
    {
        WithTable("Actions");
        Id(x => x.ID);
        Map(x => x.Description);
        Map(x => x.TimeLine);
        Map(x => x.Template);
        Map(x => x.StageOrder);
        Map(x => x.CorrespondenceType).CustomTypeIs(typeof (ActionCorrespondenceTypeEnumType));
        References(x => x.Matter).FetchType.Join();
        HasMany(x => x.FileNotes).Cascade.SaveUpdate();

        DiscriminateSubClassesOnColumn("Type")
            .SubClass<SlidingAction>(/*its forcing me to map something here*/);
    }
}

Best Answer

Just put an empty lambda in, c => {}.

.SubClass<SlidingAction>(c => {});
Related Topic