{"record":{"id":"6d31192bf5751b75","repo":"hibernate/hibernate-orm","slug":"attempting-to-get-a-execute-update-a-selection-que","errorCode":null,"errorMessage":"Attempting to get a execute-update a selection query","messagePattern":"Attempting to get a execute-update a selection query","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/internal/SelectionQueryImpl.java","lineNumber":1092,"sourceCode":"\t\tif ( keyedPage.getKeyInterpretation() == KEY_OF_FIRST_ON_NEXT_PAGE ) {\n\t\t\t// the results come in reverse order\n\t\t\tfinal int pageSize = keyedPage.getPage().getSize();\n\t\t\treturn results.size() == pageSize + 1\n\t\t\t\t\t? keyedPage.previousPage( results.get(pageSize - 1).getKey() )\n\t\t\t\t\t: null;\n\t\t}\n\t\telse {\n\t\t\treturn !results.isEmpty()\n\t\t\t\t\t? keyedPage.previousPage( results.get(0).getKey() )\n\t\t\t\t\t: null;\n\t\t}\n\t}\n\n\t@Override @Deprecated\n\t@SuppressWarnings({\"deprecation\", \"removal\"})\n\tpublic int executeUpdate() {\n\t\tfinal var message = \"Attempting to get a execute-update a selection query\";\n\t\tthrow new IllegalStateException( message, new IllegalMutationQueryException( message, hql ) );\n\t}\n\n\n\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t// CacheabilityInfluencers\n\n\t@Override\n\tpublic Object getQueryStringCacheKey() {\n\t\treturn queryStringCacheKey;\n\t}\n\n\t@Override\n\tpublic @Nullable int[] unnamedParameterIndices() {\n\t\treturn QueryHelper.unnamedParameterIndices( domainParameterXref );\n\t}\n\n\t@Override\n\t@Nonnull","sourceCodeStart":1074,"sourceCodeEnd":1110,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/internal/SelectionQueryImpl.java#L1074-L1110","documentation":"Error \"Attempting to get a execute-update a selection query\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Attempting to get a execute-update a selection query","commonSituations":"Application code or configuration calls the query API in a way that violates its documented contract; the interpolated values in the message identify the offending input.","solutions":["executeUpdate() was called on a selection query. Use a mutation query (HQL update/delete/insert) for executeUpdate()."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}