{"record":{"id":"1890eece8d4eed88","repo":"quarkusio/quarkus","slug":"method-name-of-repository-repositoryclassin","errorCode":null,"errorMessage":"${method.name()} of Repository ${repositoryClassInfo} is meant to be a insert/update/delete query and therefore doesn't support Pageable and Sort method parameters","messagePattern":"(.+?) of Repository (.+?) is meant to be a insert/update/delete query and therefore doesn't support Pageable and Sort method parameters","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":167,"sourceCode":"                var index = (int) annotation.target().asMethodParameter().position();\n                namedParameterToIndex.put(annotation.value().asString(), index);\n            }\n            // if no or only some parameters are annotated with @Param, add the compiled names (if present)\n            if (namedParameterToIndex.size() < methodParameterTypes.size()) {\n                for (int index = 0; index < methodParameterTypes.size(); index++) {\n                    if (namedParameterToIndex.containsValue(index)) {\n                        continue;\n                    }\n                    String parameterName = method.parameterName(index);\n                    if (parameterName != null) {\n                        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 {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/CustomQueryMethodsAdder.java#L149-L185","documentation":"Methods annotated with @Modifying (insert/update/delete queries) cannot use Pageable or Sort parameters, since pagination and ordering are meaningless for bulk modification statements. Quarkus enforces this at build time with this IllegalArgumentException.","triggerScenarios":"A repository method annotated with @Query and @Modifying whose signature includes a Pageable/PageRequest or Sort parameter, e.g. @Modifying @Query(\"delete from User u where u.lastLogin < :d\") void deleteInactive(Pageable p).","commonSituations":"Copy-pasting a read method signature (which legitimately takes Pageable) into a bulk delete/update method; intending to batch deletes with pagination — which JPQL bulk statements do not support; misuse of @Modifying on what is actually a select query.","solutions":["Remove the Pageable/PageRequest and Sort parameters from the modifying method","Restrict the affected rows in the WHERE clause instead of using pagination (e.g. by date range or id list)","If paginated deletion is truly required, select the ids with a paginated read method and then delete with an IN clause","Verify @Modifying is actually intended — if the query is a select, drop the annotation and keep Pageable"],"exampleFix":"// before\n@Modifying\n@Query(\"delete from User u where u.inactive = true\")\nvoid deleteInactive(Pageable page);\n// after\n@Modifying\n@Query(\"delete from User u where u.inactive = true\")\nvoid deleteInactive();","handlingStrategy":"validation","validationCode":"if (method.isAnnotationPresent(Modifying.class)) {\n    boolean hasPaging = Arrays.stream(method.getParameterTypes())\n        .anyMatch(t -> Pageable.class.isAssignableFrom(t) || Sort.class.equals(t));\n    if (hasPaging) throw new IllegalArgumentException(\"@Modifying methods cannot take Pageable/Sort\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    compile();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"doesn't support Pageable and Sort\")) {\n        log.error(\"Strip Pageable/Sort from the modifying method\");\n    }\n    throw e;\n}","preventionTips":["Never add Pageable/Sort to @Modifying methods","Restrict bulk statements with WHERE clauses instead of pagination","Select ids first, then delete/update with IN","Double-check @Modifying is intended for the method"],"tags":["spring-data-jpa","quarkus","modifying-query","pageable","build-time"],"backgroundTag":"pageable-on-modifying-query","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}