diff --git a/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/BookAuthorRepository.java b/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/BookAuthorRepository.java index 6b6ab39822..b24839ca61 100644 --- a/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/BookAuthorRepository.java +++ b/tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/BookAuthorRepository.java @@ -44,6 +44,9 @@ public interface BookAuthorRepository { @Find Book[] books(@By("isbn") String[] isbns); + @Find + List booksWithPages(Iterable pages); + @Find Optional bookIfAny(String isbn); 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 b77e507ca7..4616a7e09a 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 @@ -43,6 +43,7 @@ import javax.lang.model.element.VariableElement; import javax.lang.model.type.ArrayType; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.ExecutableType; +import javax.lang.model.type.PrimitiveType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; @@ -1445,6 +1446,10 @@ public class AnnotationMetaEntity extends AnnotationMeta { return false; } else { + if ( attributeType.getKind().isPrimitive() ) { + final PrimitiveType primitiveType = (PrimitiveType) attributeType; + attributeType = types.boxedClass( primitiveType ).asType(); + } final TypeKind kind = parameterType.getKind(); switch (kind) { case TYPEVAR: @@ -1467,7 +1472,8 @@ public class AnnotationMetaEntity extends AnnotationMeta { return true; default: if ( kind.isPrimitive() ) { - if ( !types.isSameType( types.unboxedType(parameterType), attributeType) ) { + final PrimitiveType primitiveType = (PrimitiveType) parameterType; + if ( !types.isSameType( types.boxedClass(primitiveType).asType(), attributeType ) ) { parameterTypeError( entityType, param, attributeType ); } return false;