Search in sources :

Example 1 with JaxbInheritance

use of org.hibernate.boot.jaxb.mapping.spi.JaxbInheritance 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;
    }
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) JaxbInheritance(org.hibernate.boot.jaxb.mapping.spi.JaxbInheritance) Inheritance(jakarta.persistence.Inheritance) JaxbInheritance(org.hibernate.boot.jaxb.mapping.spi.JaxbInheritance) InheritanceType(jakarta.persistence.InheritanceType) JaxbEntity(org.hibernate.boot.jaxb.mapping.spi.JaxbEntity)

Aggregations

Inheritance (jakarta.persistence.Inheritance)1 InheritanceType (jakarta.persistence.InheritanceType)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbEntity (org.hibernate.boot.jaxb.mapping.spi.JaxbEntity)1 JaxbInheritance (org.hibernate.boot.jaxb.mapping.spi.JaxbInheritance)1