diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java index 62be8e880b..317d4cb2bc 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java @@ -1244,7 +1244,7 @@ public class AnnotationMetaEntity extends AnnotationMeta { sessionType, operation, context.addNonnullAnnotation(), - declaredType != parameterType, + isIterableLifecycleParameter(parameterType), returnArgument ) ); @@ -1252,6 +1252,19 @@ public class AnnotationMetaEntity extends AnnotationMeta { } } + private static boolean isIterableLifecycleParameter(TypeMirror parameterType) { + switch (parameterType.getKind()) { + case ARRAY: + return true; + case DECLARED: + final DeclaredType declaredType = (DeclaredType) parameterType; + final TypeElement typeElement = (TypeElement) declaredType.asElement(); + return typeElement.getQualifiedName().contentEquals(LIST); + default: + return false; + } + } + private static boolean isVoid(TypeMirror returnType) { switch (returnType.getKind()) { case VOID: