{"record":{"id":"04312d3dd4877361","repo":"quarkusio/quarkus","slug":"method-name-of-repository-repositoryclassin-04312d","errorCode":null,"errorMessage":"${method.name()} of Repository ${repositoryClassInfo} is missing the named parameters ${missingParameters}, provided are ${namedParameterToIndex.keySet()}. Ensure that the parameters are correctly annotated with @Param.","messagePattern":"(.+?) of Repository (.+?) is missing the named parameters (.+?), provided are (.+?)\\. Ensure that the parameters are correctly annotated with @Param\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/CustomQueryMethodsAdder.java","lineNumber":178,"sourceCode":"                        namedParameterToIndex.put(parameterName, index);\n                    }\n                }\n            }\n\n            boolean isModifying = (method.annotation(DotNames.SPRING_DATA_MODIFYING) != null);\n            if (isModifying && (sortParameterIndex != null || pageableParameterIndex != null)) {\n                throw new IllegalArgumentException(\n                        method.name() + \" of Repository \" + repositoryClassInfo\n                                + \" is meant to be a insert/update/delete query and therefore doesn't \" +\n                                \"support Pageable and Sort method parameters\");\n            }\n\n            Set<String> usedNamedParameters = extractNamedParameters(queryString);\n            if (!usedNamedParameters.isEmpty()) {\n                Set<String> missingParameters = new LinkedHashSet<>(usedNamedParameters);\n                missingParameters.removeAll(namedParameterToIndex.keySet());\n                if (!missingParameters.isEmpty()) {\n                    throw new IllegalArgumentException(\n                            method.name() + \" of Repository \" + repositoryClassInfo\n                                    + \" is missing the named parameters \" + missingParameters\n                                    + \", provided are \" + namedParameterToIndex.keySet()\n                                    + \". Ensure that the parameters are correctly annotated with @Param.\");\n                }\n                namedParameterToIndex.keySet().retainAll(usedNamedParameters);\n            } else {\n                namedParameterToIndex.clear();\n            }\n\n            DotName methodReturnTypeDotName = method.returnType().name();\n\n            // Need effectively final copies for use in lambdas\n            final Integer finalPageableParameterIndex = pageableParameterIndex;\n            final Integer finalSortParameterIndex = sortParameterIndex;\n            final String finalQueryString = queryString;\n            final Map<String, Integer> finalNamedParameterToIndex = namedParameterToIndex;\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/CustomQueryMethodsAdder.java#L160-L196","documentation":"When a @Query uses named parameters (:name syntax), every named parameter must be bound to a Java method parameter annotated with @Param(\"name\"). Quarkus extracts the named parameters from the query string at build time and fails with this IllegalArgumentException if any used :param has no matching @Param-annotated method parameter.","triggerScenarios":"A JPQL query references :foo but no method parameter is annotated @Param(\"foo\"); parameter names differ from query names (e.g. :email vs @Param(\"mail\")); relying on -parameters compiler flag/Java 8 name retention that Quarkus's Spring Data layer does not pick up; a typo in the query introduces an unused named parameter.","commonSituations":"Renaming a query parameter in JPQL but not the @Param annotation; copy-pasted queries where one parameter was removed from the signature but not the query string; forgetting @Param entirely because plain Spring sometimes infers names from bytecode.","solutions":["Annotate every method parameter with @Param(\"...\") matching exactly the :name used in the query","Fix typos so query parameter names and @Param values match (the message lists missing vs provided names)","Remove leftover :params from the query that no longer have corresponding arguments","Check the error message: it names the missing parameters and the ones actually provided"],"exampleFix":"// before\n@Query(\"select u from User u where u.email = :email\")\nList<User> findByEmail(@Param(\"mail\") String mail);\n// after\n@Query(\"select u from User u where u.email = :email\")\nList<User> findByEmail(@Param(\"email\") String email);","handlingStrategy":"validation","validationCode":"// Extract :params from query and cross-check @Param annotations\nSet<String> used = new HashSet<>();\nMatcher m = Pattern.compile(\":(\\w+)\").matcher(query);\nwhile (m.find()) used.add(m.group(1));\nSet<String> provided = new HashSet<>();\nfor (Annotation[] as : method.getParameterAnnotations())\n    for (Annotation a : as)\n        if (a instanceof Param p) provided.add(p.value());\nif (!provided.containsAll(used))\n    throw new IllegalArgumentException(\"Missing @Param for: \" + new HashSet<>(used) .stream().filter(p -> !provided.contains(p)).toList());","typeGuard":null,"tryCatchPattern":"try {\n    compile();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"missing the named parameters\")) {\n        log.error(\"Align :names with @Param values: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Always annotate query method parameters with @Param matching :names exactly","Rename query and @Param together","Remove unused :params from queries","The error lists missing vs provided — use it to spot typos"],"tags":["spring-data-jpa","quarkus","named-parameters","param-annotation","build-time"],"backgroundTag":"missing-named-parameter-binding","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}