Search in sources :

Example 6 with AssociationOverride

use of javax.persistence.AssociationOverride in project hibernate-orm by hibernate.

the class AbstractPropertyHolder method buildAssociationOverrides.

private static AssociationOverride[] buildAssociationOverrides(XAnnotatedElement element, String path) {
    AssociationOverride singleOverride = element.getAnnotation(AssociationOverride.class);
    AssociationOverrides pluralOverrides = element.getAnnotation(AssociationOverrides.class);
    AssociationOverride[] overrides;
    if (singleOverride != null) {
        overrides = new AssociationOverride[] { singleOverride };
    } else if (pluralOverrides != null) {
        overrides = pluralOverrides.value();
    } else {
        overrides = null;
    }
    return overrides;
}
Also used : AssociationOverrides(javax.persistence.AssociationOverrides) AssociationOverride(javax.persistence.AssociationOverride)

Aggregations

AssociationOverride (javax.persistence.AssociationOverride)6 AssociationOverrides (javax.persistence.AssociationOverrides)4 JoinTable (javax.persistence.JoinTable)2 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)2 Test (org.junit.Test)2 AnnotatedElement (java.lang.reflect.AnnotatedElement)1 ArrayList (java.util.ArrayList)1 JoinColumn (javax.persistence.JoinColumn)1 MapKeyJoinColumn (javax.persistence.MapKeyJoinColumn)1 UniqueConstraint (javax.persistence.UniqueConstraint)1 Element (org.dom4j.Element)1