Hello,
i have one Table "CustomerTable" and several classes wich all reffer to this table.
i.e.:
Code:
public class BaseCustomer{
int Id;
}
public class Customer : BaseCustomer {
string SomeString;
}
The Fluent Mapping would be like
Code:
public class BaseCustomerMaps : ClassMap<BaseCustomer>
{
public BaseCustomerMaps()
{
Table("CustomerTable");
Id(a => a.Id);
// DiscriminateSubClassesOnColumn("type");
}
}
public class CustomerMaps : SubclassMap<Customer>
{
public CustomerMaps()
{
Map(a => a.SomeString);
}
}
So without using the "DiscriminateSubClassesOnColumn("type");" i will get a query like ... FROM database.dbo.CustomerTable ... JOIN database.dbo.Customer
Of course the second table does not exist, it is only the name of the Entity Class.
Using "DiscriminateSubClassesOnColumn("type");" would only select from the one correct table without joining - but it would create a where Statement "WHERE this_.type='Customer'" wich can not work as there is no such column.
So how do i tell Fluent NHibernate that there is only one Table but no Column which distinguishes the Entities?I Can not change the Database or ignore existing Classes.