@Override
protected void serializeInheritanceContent(ClassMetaData mapping) {
ClassMapping cls = (ClassMapping) mapping;
ClassMappingInfo info = cls.getMappingInfo();
DiscriminatorMappingInfo dinfo = cls.getDiscriminator()
.getMappingInfo();
String strat = info.getHierarchyStrategy();
if (null == strat)
return;
String itypecls = Strings.getClassName(InheritanceType.class);
AnnotationBuilder abInheritance =
addAnnotation(Inheritance.class, mapping);
if (FlatClassStrategy.ALIAS.equals(strat))
abInheritance.add("strategy", itypecls + ".SINGLE_TABLE");
else if (VerticalClassStrategy.ALIAS.equals(strat))
abInheritance.add("strategy", itypecls + ".JOINED");
else if (FullClassStrategy.ALIAS.equals(strat))
abInheritance.add("strategy", itypecls + ".TABLE_PER_CLASS");
if (dinfo.getValue() != null) {
AnnotationBuilder abDiscVal =
addAnnotation(DiscriminatorValue.class, mapping);
abDiscVal.add(null, dinfo.getValue());
}
AnnotationBuilder abDiscCol =
addAnnotation(DiscriminatorColumn.class, mapping);
serializeColumns(dinfo, ColType.DISC, null, abDiscCol, null);
}