private <T> void validateSingleTableInheritance(CFMappingDef<T> cfMapDef) {
if (null == cfMapDef.getDiscColumn()) {
throw new HectorObjectMapperException("Class, " + cfMapDef.getRealClass().getName()
+ ", requested single table inheritance, but you did not specify a "
+ DiscriminatorColumn.class.getSimpleName() + " annotation");
}
if (cfMapDef.isAbstract() && null != cfMapDef.getDiscValue()) {
throw new HectorObjectMapperException("Abstract class, " + cfMapDef.getRealClass().getName()
+ ", has an @" + DiscriminatorValue.class.getSimpleName()
+ " annotation, but cannot be instantiated");
} else if (!cfMapDef.isAbstract() && null == cfMapDef.getDiscValue()) {
throw new HectorObjectMapperException("Class, "
+ cfMapDef.getEffectiveClass().getName()
+ ", is a part of inheritance hierarchy, but did not specify a "
+ DiscriminatorValue.class.getSimpleName() + " annotation. Should it be 'abstract'?");
}
}