I am new to fluent nhibernate. I have the following combination of table per subclass and single table with discriminator per subclass structure. Will appreciate any help in mapping this with fluent - specially with automapping:
enum type {a, b, c, d}
Class pool
{
int id;
IList<Class1> aVals;
IList<Class1> bVals;
IList<Class2> cVals;
IList<Class3> dVals;
}
Class Class1
{
int ID;
Type discriminator;
string value;
}
class Class2 : Class1 //This is only for type c
{
string SomeExtraProperty;
}
Class Class3 : class1 //This is only for type d
{
string AnotherExtraProperty;
}
DB tables: Table Pool ( id int identity, name varchar(50) )
table Class1( id int identity, pool_id int references(pool.id), value varchar(50) )
table Class2 ( id int identity, Class1_id int references(Class1.id), SomeProperty varchar(50) )
table Class2 ( id int identity, Class1_id int references(Class1.id), anotherProperty varchar(50) )