[hibernate-dev] hiberate-commons-annotations and locating annotations

Steve Ebersole steve at hibernate.org
Wed Sep 4 00:01:02 EDT 2013


On Tue 03 Sep 2013 05:22:22 PM CDT, Steve Ebersole wrote:
> After looking through this some more, I think what you say could
> almost work.  But:
> 1) Still need a way to determine the declarer of a property rather
> than just blindly accepting XProperty.getAnnotation(Convert.class).
> This is needed for the Super/Sub MappedSuperclass/Entity case in my
> initial email to properly interpret Convert precedence.  Is the best
> option here a change to hibernate-commons-annotations, and if so what
> change specifically?  Adding `XClass XProperty#getDeclarer()`?

As an alternative to `XClass XProperty#getDeclarer()` for this 
particular use case, I could also see having XAnnotatedElement (and 
therefore AnnotationReader) more closely mimic 
java.lang.reflect.AnnotatedElement in terms of exposed API.  
Especially, here, addition of a getDeclaredAnnotations() method (and 
I'd also argue for a getDeclaredAnnotation(Class<T> annotationType) 

More information about the hibernate-dev mailing list