public ISuperClassDef Map()
{
if (MustBeMapped())
{
var baseType = this.TypeWrapper.BaseType;
var superClassInheritanceRel = baseType.MapInheritance();
var superClassDef = baseType.MapClass();
ISuperClassDef inheritanceDef;
if (superClassDef != null)
{
if (superClassInheritanceRel != null)
{
superClassDef.SuperClassDef = superClassInheritanceRel;
}
inheritanceDef = new SuperClassDef(superClassDef, ORMapping.SingleTableInheritance);
//If this is the Most Base Type i.e. it
// does not have another Business object as its super class
// then you should create the discriminator Property
if (superClassInheritanceRel == null)
{
inheritanceDef.Discriminator = superClassDef.ClassName + "Type";
CreateDiscriminatorProp(inheritanceDef);
}else
{
inheritanceDef.Discriminator = superClassInheritanceRel.Discriminator;
}
return inheritanceDef;
}
}
return null;
}