Closed sebersole closed 3 months ago
AnnotationTarget#getAnnotationUsage is designed to throw an exception if more than one exists (repeatable annotations). E.g. given
AnnotationTarget#getAnnotationUsage
@Entity class Stuff { ... @JoinColumn(...) @JoinColumn(...) Things things; }
a call to FieldDetails("things").getAnnotationUsage(JoinColumn.class) will result in a AnnotationAccessException being thrown.
FieldDetails("things").getAnnotationUsage(JoinColumn.class)
AnnotationAccessException
Add a method AnnotationTarget#getSingleAnnotationUsage which simply returns null in these cases.
AnnotationTarget#getSingleAnnotationUsage
AnnotationTarget#getAnnotationUsage
is designed to throw an exception if more than one exists (repeatable annotations). E.g. givena call to
FieldDetails("things").getAnnotationUsage(JoinColumn.class)
will result in aAnnotationAccessException
being thrown.Add a method
AnnotationTarget#getSingleAnnotationUsage
which simply returns null in these cases.