From 2ff75df6a1735b5be99ce272f8efd4ffb4069584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Cedomir=20Igaly?= Date: Fri, 6 Dec 2024 16:24:46 +0100 Subject: [PATCH] HHH-18920 Proper class name is JpaSelection.getJavaTypeName(), not JpaSelection.getJavaType().getName() --- .../processor/annotation/AnnotationMetaEntity.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 1ab334d77d..0101e68089 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 @@ -2678,12 +2678,11 @@ public class AnnotationMetaEntity extends AnnotationMeta { private static boolean parameterMatches(VariableElement parameter, JpaSelection item) { final Class javaType = item.getJavaType(); - return javaType != null && parameterMatches( parameter.asType(), javaType ); + return javaType != null && parameterMatches( parameter.asType(), javaType, item.getJavaTypeName() ); } - private static boolean parameterMatches(TypeMirror parameterType, Class itemType) { + private static boolean parameterMatches(TypeMirror parameterType, Class itemType, String itemTypeName) { final TypeKind kind = parameterType.getKind(); - final String itemTypeName = itemType.getName(); if ( kind == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) parameterType; final TypeElement paramTypeElement = (TypeElement) declaredType.asElement(); @@ -2695,7 +2694,7 @@ public class AnnotationMetaEntity extends AnnotationMeta { else if ( kind == TypeKind.ARRAY ) { final ArrayType arrayType = (ArrayType) parameterType; return itemType.isArray() - && parameterMatches( arrayType.getComponentType(), itemType.getComponentType() ); + && parameterMatches( arrayType.getComponentType(), itemType.getComponentType(), itemType.getComponentType().getTypeName() ); } else { return false;