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

Steve Ebersole steve at hibernate.org
Thu Aug 29 15:22:14 EDT 2013


Given an XProperty, is there a way to ask for annotations which are 
defined only locally on that declared property (not on any super classes)?

Basically given this situation:

@MappedSuperclass
public class Super {
     ...
     @Convert( converter=Converter1.class )
     public String getIt() {
         ...
     }
}

@Entity
@Convert( attributeName="it", disableConversion=true )
public class Sub extends Super {
}


Disabling of the conversion is supposed to "win".  But as far as I can 
tell there is no way for me to tell, using commons-annotations, that 
@Convert( converter=Converter1.class ) came from a super class.  The 
trouble is that the above is a valid spec situation, whereas:

@Entity
@Convert( attributeName="it", disableConversion=true )
public class Sub {
     ...
     @Convert( converter=Converter1.class )
     public String getIt() {
         ...
     }
}

Is explicitly an error by the spec.  But I see no way to tell the 
difference here using commons-annotations.  Am I missing that way?


More information about the hibernate-dev mailing list