diff --git a/ebean-api/src/main/java/io/ebean/util/AnnotationUtil.java b/ebean-api/src/main/java/io/ebean/util/AnnotationUtil.java index 583c99009..709019158 100644 --- a/ebean-api/src/main/java/io/ebean/util/AnnotationUtil.java +++ b/ebean-api/src/main/java/io/ebean/util/AnnotationUtil.java @@ -71,6 +71,20 @@ public class AnnotationUtil { return typeGet(clazz, annotation) != null; } + /** + * Check if an element is annotated with an annotation of given type searching meta-annotations. + */ + public static boolean metaHas(AnnotatedElement element, Class annotationType) { + return !metaFindAll(element, annotationType).isEmpty(); + } + + /** + * Find all the annotations of a given type searching meta-annotations. + */ + public static Set metaFindAll(AnnotatedElement element, Class annotationType) { + return metaFindAllFor(element, Collections.singleton(annotationType)); + } + /** * Find all the annotations for the filter searching meta-annotations. */