Search in sources :

Example 1 with JaxbManyToOne

use of org.hibernate.boot.jaxb.mapping.spi.JaxbManyToOne in project hibernate-orm by hibernate.

the class JPAXMLOverriddenAnnotationReader method getManyToOne.

/**
 * @see #getOneToOne(List, XMLContext.Default)
 * @see #getElementCollection(List, XMLContext.Default)
 */
private void getManyToOne(List<Annotation> annotationList, XMLContext.Default defaults) {
    Class<ManyToOne> annotationType = ManyToOne.class;
    List<JaxbManyToOne> elements = elementsForProperty.getManyToOne();
    for (JaxbManyToOne element : elements) {
        AnnotationDescriptor ad = new AnnotationDescriptor(annotationType);
        addTargetClass(element.getTargetEntity(), ad, "target-entity", defaults);
        getFetchType(ad, element.getFetch());
        getCascades(ad, element.getCascade(), defaults);
        getJoinTable(annotationList, element, defaults);
        buildJoinColumns(annotationList, element.getJoinColumn());
        copyAttribute(ad, "optional", element.isOptional(), false);
        annotationList.add(AnnotationFactory.create(ad));
        getAssociationId(annotationList, element.isId());
        getMapsId(annotationList, element.getMapsId());
        getAccessType(annotationList, element.getAccess());
    }
    afterGetAssociation(annotationType, annotationList, defaults);
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) JaxbManyToOne(org.hibernate.boot.jaxb.mapping.spi.JaxbManyToOne) JaxbManyToOne(org.hibernate.boot.jaxb.mapping.spi.JaxbManyToOne) ManyToOne(jakarta.persistence.ManyToOne)

Aggregations

ManyToOne (jakarta.persistence.ManyToOne)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbManyToOne (org.hibernate.boot.jaxb.mapping.spi.JaxbManyToOne)1