Search in sources :

Example 1 with AnyMetaDefs

use of org.hibernate.annotations.AnyMetaDefs in project hibernate-orm by hibernate.

the class BinderHelper method bindAnyMetaDefs.

public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, MetadataBuildingContext context) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation(AnyMetaDef.class);
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation(AnyMetaDefs.class);
    boolean mustHaveName = XClass.class.isAssignableFrom(annotatedElement.getClass()) || XPackage.class.isAssignableFrom(annotatedElement.getClass());
    if (defAnn != null) {
        checkAnyMetaDefValidity(mustHaveName, defAnn, annotatedElement);
        bindAnyMetaDef(defAnn, context);
    }
    if (defsAnn != null) {
        for (AnyMetaDef def : defsAnn.value()) {
            checkAnyMetaDefValidity(mustHaveName, def, annotatedElement);
            bindAnyMetaDef(def, context);
        }
    }
}
Also used : AnyMetaDef(org.hibernate.annotations.AnyMetaDef) XPackage(org.hibernate.annotations.common.reflection.XPackage) XClass(org.hibernate.annotations.common.reflection.XClass) AnyMetaDefs(org.hibernate.annotations.AnyMetaDefs)

Aggregations

AnyMetaDef (org.hibernate.annotations.AnyMetaDef)1 AnyMetaDefs (org.hibernate.annotations.AnyMetaDefs)1 XClass (org.hibernate.annotations.common.reflection.XClass)1 XPackage (org.hibernate.annotations.common.reflection.XPackage)1