I'm hoping someone can help me out with this:
I've got a base class which contains the "lite" version of data and then a subclass that provides the additional detail. I want both classes to use the same table and am not sure if/why I need a discriminator.
Eg.
Code:
public class CustomerBase
{
public int ID;
public string Name;
}
public class CustomerDetail : CustomerBase
{
public string Address1;
public string Address2;
public string Suburb;
//Etc...
}
I've set up a sample mapping like this:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Types.CustomerBase, MyAssembly" table="Customers">
<id name="ID" column="CustomerID">
<generator class="native" />
</id>
<property name="Name" column="Name" />
<subclass name="Types.CustomerDetail, MyAssembly" extends="Types.CustomerBase, MyAssembly">
<property name="Address1" column="Address1" />
<property name="Address1" column="Address1" />
<property name="Suburb" column="Suburb" />
</subclass>
</class>
</hibernate-mapping>
...but it tells me that I need a discriminator. In effect, the base class is really just a stripped down version of the subclass (required for minimizing the amount of data being transferred over the wire in a high traffic web service) and it's going to be the only type in the table - is a discriminator really necessary?
Hope someone can clarify this for me...
Cheers,
Symon.