Search in sources :

Example 1 with JaxbOneToMany

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

the class JPAXMLOverriddenAnnotationReader method getOneToMany.

private void getOneToMany(List<Annotation> annotationList, XMLContext.Default defaults) {
    Class<OneToMany> annotationType = OneToMany.class;
    List<JaxbOneToMany> elements = elementsForProperty.getOneToMany();
    for (JaxbOneToMany 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, "orphan-removal", element.isOrphanRemoval(), false);
        copyAttribute(ad, "mapped-by", element.getMappedBy(), false);
        annotationList.add(AnnotationFactory.create(ad));
        getOrderBy(annotationList, element.getOrderBy());
        getMapKey(annotationList, element.getMapKey());
        getMapKeyClass(annotationList, element.getMapKeyClass(), defaults);
        getMapKeyColumn(annotationList, element.getMapKeyColumn());
        getOrderColumn(annotationList, element.getOrderColumn());
        getMapKeyTemporal(annotationList, element.getMapKeyTemporal());
        getMapKeyEnumerated(annotationList, element.getMapKeyEnumerated());
        Annotation annotation = getMapKeyAttributeOverrides(element.getMapKeyAttributeOverride(), defaults);
        addIfNotNull(annotationList, annotation);
        getMapKeyJoinColumns(annotationList, element.getMapKeyJoinColumn());
        getAccessType(annotationList, element.getAccess());
    }
    afterGetAssociation(annotationType, annotationList, defaults);
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) JaxbOneToMany(org.hibernate.boot.jaxb.mapping.spi.JaxbOneToMany) JaxbOneToMany(org.hibernate.boot.jaxb.mapping.spi.JaxbOneToMany) OneToMany(jakarta.persistence.OneToMany) Annotation(java.lang.annotation.Annotation)

Aggregations

OneToMany (jakarta.persistence.OneToMany)1 Annotation (java.lang.annotation.Annotation)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbOneToMany (org.hibernate.boot.jaxb.mapping.spi.JaxbOneToMany)1