Class PropagateAnnotationReader

  • All Implemented Interfaces:
    org.hibernate.annotations.common.reflection.AnnotationReader

    public class PropagateAnnotationReader
    extends Object
    implements org.hibernate.annotations.common.reflection.AnnotationReader
    Implementation of AnnotationReader adding parent entity annotations marked using @PropagateAnnotations, to the annotations of the child entity. Created for the reason that JPA and Hibernate annotations are not marked as @Inherited and therefore do not apply to child entities
    • Constructor Detail

      • PropagateAnnotationReader

        public PropagateAnnotationReader​(org.hibernate.annotations.common.reflection.AnnotationReader delegate,
                                         org.hibernate.annotations.common.reflection.MetadataProvider metadataProvider,
                                         AnnotatedElement annotatedElement)
    • Method Detail

      • getAnnotation

        public <T extends Annotation> T getAnnotation​(Class<T> annotationType)
        Returns an annotation of the specified type for an element, taking into account inheritance
        Specified by:
        getAnnotation in interface org.hibernate.annotations.common.reflection.AnnotationReader
        Parameters:
        annotationType - annotation type
        Returns:
        annotation
      • isAnnotationPresent

        public <T extends Annotation> boolean isAnnotationPresent​(Class<T> annotationType)
        returns whether an annotation of the specified type is specified for the element being annotated, considering inheritance
        Specified by:
        isAnnotationPresent in interface org.hibernate.annotations.common.reflection.AnnotationReader
        Parameters:
        annotationType - annotation type
        Returns:
        true/false
      • getAnnotations

        public Annotation[] getAnnotations()
        returns an array of all element annotations taking into account inheritance
        Specified by:
        getAnnotations in interface org.hibernate.annotations.common.reflection.AnnotationReader
        Returns:
        array of annotations