ClassMapping cls = disc.getClassMapping();
if (cls.getJoinablePCSuperclassMapping() != null
|| cls.getEmbeddingMetaData() != null)
throw new MetaDataException(_loc.get("not-base-disc", cls));
DiscriminatorMappingInfo info = disc.getMappingInfo();
info.assertNoJoin(disc, true);
info.assertNoForeignKey(disc, !adapt);
info.assertNoUnique(disc, false);
Column tmplate = new Column();
tmplate.setJavaType(getJavaType());
DBDictionary dict = cls.getMappingRepository().getDBDictionary();
DBIdentifier typName = DBIdentifier.newColumn("typ", dict != null ? dict.delimitAll() : false);
tmplate.setIdentifier(typName);
Column[] cols = info.getColumns(disc, new Column[]{ tmplate }, adapt);
disc.setColumns(cols);
disc.setColumnIO(info.getColumnIO());
Index idx = info.getIndex(disc, cols, adapt);
disc.setIndex(idx);
}