use of jakarta.persistence.Inheritance in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method getInheritance.
private Inheritance getInheritance(ManagedType root, XMLContext.Default defaults) {
JaxbInheritance element = root instanceof JaxbEntity ? ((JaxbEntity) root).getInheritance() : null;
if (element != null) {
AnnotationDescriptor ad = new AnnotationDescriptor(Inheritance.class);
InheritanceType strategy = element.getStrategy();
if (strategy != null) {
ad.setValue("strategy", strategy);
}
return AnnotationFactory.create(ad);
} else if (defaults.canUseJavaAnnotations()) {
return getPhysicalAnnotation(Inheritance.class);
} else {
return null;
}
}
use of jakarta.persistence.Inheritance in project hibernate-orm by hibernate.
the class InheritanceState method extractInheritanceType.
private void extractInheritanceType() {
XAnnotatedElement element = getClazz();
Inheritance inhAnn = element.getAnnotation(Inheritance.class);
MappedSuperclass mappedSuperClass = element.getAnnotation(MappedSuperclass.class);
if (mappedSuperClass != null) {
setEmbeddableSuperclass(true);
setType(inhAnn == null ? null : inhAnn.strategy());
} else {
setType(inhAnn == null ? InheritanceType.SINGLE_TABLE : inhAnn.strategy());
}
}
Aggregations