I use FluentNHibernate with AutoMapping to map my persistent classes.
The default Table per Sub-Class mapping works fine for almost all of my class hierarchies, except one: Here I have an abstract base class “A”, A has all the data fields needed. The Subclasses “B” , “C”, … “X” differ only in behavior. “Table per Class” would lead to a lot of unwanted tables.
I want to create an Override Class to create a single table A ( I can do this with an IncludeBaseClass Override. But how do I set up the Discriminator Override class which places all the sub-classes in this table as well?
The fluent documentation suggests the following:
public override bool IsDiscriminated(Type type)
{
return type.In(typeof(ClassOne), typeof(ClassTwo));
}
I thinik this would boildown to this for my case:
public override bool IsDiscriminated(Type type)
{
return (type == typeof(A));
}
But what would be the Override class to place this method in?