Package io.tesler.model.core.hbn
Class PropagateAnnotationReader
- java.lang.Object
-
- io.tesler.model.core.hbn.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 Summary
Constructors Constructor Description PropagateAnnotationReader(org.hibernate.annotations.common.reflection.AnnotationReader delegate, org.hibernate.annotations.common.reflection.MetadataProvider metadataProvider, AnnotatedElement annotatedElement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Annotation>
TgetAnnotation(Class<T> annotationType)
Returns an annotation of the specified type for an element, taking into account inheritanceAnnotation[]
getAnnotations()
returns an array of all element annotations taking into account inheritance<T extends Annotation>
booleanisAnnotationPresent(Class<T> annotationType)
returns whether an annotation of the specified type is specified for the element being annotated, considering inheritance
-
-
-
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 interfaceorg.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 interfaceorg.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 interfaceorg.hibernate.annotations.common.reflection.AnnotationReader
- Returns:
- array of annotations
-
-