fix another bug in detecting when a repo method param is multivalued

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-03-31 19:22:25 +02:00 committed by Christian Beikov
parent d99309db52
commit dcfc254635
1 changed files with 14 additions and 1 deletions

View File

@ -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: