HHH-7542: Modified EntityClass to allow for multiple class-level @Immutable annotations in the same hierarchy

This commit is contained in:
John Verhaeg 2012-09-14 14:03:01 -05:00
parent 4882bebdba
commit ee9b4d78cd

View File

@ -285,10 +285,8 @@ private void processHibernateEntitySpecificAnnotations() {
}
optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );
final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.IMMUTABLE
);
isMutable = hibernateImmutableAnnotation == null
List< AnnotationInstance > hibernateImmutableAnnotations = getClassInfo().annotations().get( HibernateDotNames.IMMUTABLE );
isMutable = ( hibernateImmutableAnnotations == null || hibernateImmutableAnnotations.isEmpty() )
&& hibernateEntityAnnotation != null
&& hibernateEntityAnnotation.value( "mutable" ) != null
&& hibernateEntityAnnotation.value( "mutable" ).asBoolean();