{"record":{"id":"2b6b8edf0386ff87","repo":"hibernate/hibernate-orm","slug":"mutation-target-types-do-not-match-s-s","errorCode":null,"errorMessage":"Mutation target types do not match : %s / %s","messagePattern":"Mutation target types do not match : (.+?) / (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/specification/internal/MutationSpecificationImpl.java","lineNumber":364,"sourceCode":"\t\t\tthrow new IllegalMutationQueryException(\n\t\t\t\t\t\"MutationSpecification only supports HQL or criteria statement references: \"\n\t\t\t\t\t\t\t+ statementReference.getName()\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Used during construction. Mainly used to group extracting and\n\t * validating the root.\n\t */\n\t@Nonnull\n\tprivate static <T> SqmRoot<T> resolveSqmRoot(\n\t\t\t@Nonnull SqmDeleteOrUpdateStatement<T> sqmStatement,\n\t\t\t@Nonnull Class<T> mutationTarget) {\n\t\tfinal var mutationTargetRoot = sqmStatement.getTarget();\n\t\tfinal var javaType = mutationTargetRoot.getJavaType();\n\t\tif ( javaType != null && !mutationTarget.isAssignableFrom( javaType ) ) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"Mutation target types do not match : %s / %s\",\n\t\t\t\t\t\t\tjavaType.getName(),\n\t\t\t\t\t\t\tmutationTarget.getName()\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\treturn mutationTargetRoot;\n\t\t}\n\t}\n\n}\n","sourceCodeStart":346,"sourceCodeEnd":379,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/specification/internal/MutationSpecificationImpl.java#L346-L379","documentation":"Error \"Mutation target types do not match : %s / %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A runtime precondition of the Hibernate query API is violated: Mutation target types do not match : <value> / <value>","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":["The mutation target types differ between specification and query. Use matching entity types."],"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"}