From ee9b4d78cd5038754318fddf8c01c5a4f0ed3b8a Mon Sep 17 00:00:00 2001 From: John Verhaeg Date: Fri, 14 Sep 2012 14:03:01 -0500 Subject: [PATCH] HHH-7542: Modified EntityClass to allow for multiple class-level @Immutable annotations in the same hierarchy --- .../internal/source/annotations/entity/EntityClass.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/entity/EntityClass.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/entity/EntityClass.java index c743993a59..17bd8e277a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/entity/EntityClass.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/entity/EntityClass.java @@ -285,10 +285,8 @@ public class EntityClass extends ConfiguredClass { } 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();