HHH-12062 - Make sure AttributeAccessor annotation is read.

This commit is contained in:
Chris Cranford 2017-12-05 09:41:55 +01:00
parent 80f315c328
commit 0dc788f42f
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import javax.persistence.Lob;
import org.hibernate.AnnotationException;
import org.hibernate.HibernateException;
import org.hibernate.annotations.AttributeAccessor;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.Immutable;
import org.hibernate.annotations.NaturalId;
@ -273,6 +274,11 @@ public class PropertyBinder {
if ( property != null ) {
prop.setValueGenerationStrategy( determineValueGenerationStrategy( property ) );
if ( property.isAnnotationPresent( AttributeAccessor.class ) ) {
final AttributeAccessor accessor = property.getAnnotation( AttributeAccessor.class );
prop.setPropertyAccessorName( accessor.value() );
}
}
NaturalId naturalId = property != null ? property.getAnnotation( NaturalId.class ) : null;