HHH-7970 - Fix broken logic in JPAOverriddenAnnotationReader.getCacheable(): if element is null, you have to consider the @Cacheable annotation

per gripe from Andreas Joseph Krogh
This commit is contained in:
Guillaume Smet 2013-02-10 18:11:14 +01:00 committed by Brett Meyer
parent 74251d5185
commit e2fc8b12db
1 changed files with 7 additions and 6 deletions

View File

@ -837,12 +837,13 @@ public class JPAOverriddenAnnotationReader implements AnnotationReader {
}
private Cacheable getCacheable(Element element, XMLContext.Default defaults){
if(element==null)return null;
String attValue = element.attributeValue( "cacheable" );
if(attValue!=null){
AnnotationDescriptor ad = new AnnotationDescriptor( Cacheable.class );
ad.setValue( "value", Boolean.valueOf( attValue ) );
return AnnotationFactory.create( ad );
if ( element != null ) {
String attValue = element.attributeValue( "cacheable" );
if ( attValue != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( Cacheable.class );
ad.setValue( "value", Boolean.valueOf( attValue ) );
return AnnotationFactory.create( ad );
}
}
if ( defaults.canUseJavaAnnotations() ) {
return getJavaAnnotation( Cacheable.class );