use of org.hibernate.boot.jaxb.mapping.spi.JaxbDiscriminatorColumn in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method getDiscriminatorColumn.
private DiscriminatorColumn getDiscriminatorColumn(ManagedType root, XMLContext.Default defaults) {
JaxbDiscriminatorColumn element = root instanceof JaxbEntity ? ((JaxbEntity) root).getDiscriminatorColumn() : null;
if (element != null) {
AnnotationDescriptor ad = new AnnotationDescriptor(DiscriminatorColumn.class);
copyAttribute(ad, "name", element.getName(), false);
copyAttribute(ad, "column-definition", element.getColumnDefinition(), false);
DiscriminatorType type = element.getDiscriminatorType();
if (type != null) {
ad.setValue("discriminatorType", type);
}
copyAttribute(ad, "length", element.getLength(), false);
return AnnotationFactory.create(ad);
} else if (defaults.canUseJavaAnnotations()) {
return getPhysicalAnnotation(DiscriminatorColumn.class);
} else {
return null;
}
}
Aggregations