{"record":{"id":"42269359c8783fc2","repo":"hibernate/hibernate-orm","slug":"assignment-referred-to-columns-from-multiple-table-422693","errorCode":null,"errorMessage":"Assignment referred to columns from multiple tables: ${assignment.getAssignable()}","messagePattern":"Assignment referred to columns from multiple tables: (.+?)","errorType":"exception","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java","lineNumber":233,"sourceCode":"\t\tif ( sessionUidParameter != null ) {\n\t\t\tjdbcParameterBindings.addBinding( sessionUidParameter,\n\t\t\t\t\tnew JdbcParameterBindingImpl( idTable.getSessionUidColumn().getJdbcMapping(),\n\t\t\t\t\t\t\tUUID.fromString( sessionUidAccess.apply( context.getSession() ) ) ) );\n\t\t}\n\n\n\t\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t// segment the assignments by table-reference\n\n\t\tfor ( int i = 0; i < assignments.size(); i++ ) {\n\t\t\tfinal var assignment = assignments.get( i );\n\t\t\tfinal var assignmentColumnRefs = assignment.getAssignable().getColumnReferences();\n\t\t\tTableReference assignmentTableReference = null;\n\t\t\tfor ( int c = 0; c < assignmentColumnRefs.size(); c++ ) {\n\t\t\t\tfinal var columnReference = assignmentColumnRefs.get( c );\n\t\t\t\tfinal var tableReference = resolveTableReference( columnReference, tableReferenceByAlias );\n\t\t\t\tif ( assignmentTableReference != null && assignmentTableReference != tableReference ) {\n\t\t\t\t\tthrow new SemanticException( \"Assignment referred to columns from multiple tables: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ assignment.getAssignable() );\n\t\t\t\t}\n\t\t\t\tassignmentTableReference = tableReference;\n\t\t\t}\n\t\t\tassignmentsByTable.computeIfAbsent( assignmentTableReference, k -> new ArrayList<>() )\n\t\t\t\t\t.add( assignment );\n\t\t}\n\n\t\tfinal var executionContext = omittingLockingAndPaging( context );\n\t\tthis.matchingIdsIntoIdTableInsert = createMatchingIdsIntoIdTableInsert(\n\t\t\t\tconverterDelegate,\n\t\t\t\tsuppliedPredicate,\n\t\t\t\tidTable,\n\t\t\t\tsessionUidParameter,\n\t\t\t\tjdbcParameterBindings,\n\t\t\t\texecutionContext\n\t\t);\n","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java#L215-L251","documentation":"Error \"Assignment referred to columns from multiple tables: ${assignment.getAssignable()}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An UPDATE/INSERT assignment targets columns that cannot be handled by the mutation strategy.","commonSituations":"Bulk HQL update/insert statements assigning columns spread across multiple tables or columns of joined associations.","solutions":["An UPDATE assignment referred to columns from multiple tables.","Restrict each update's assignments to columns of a single table, or split into multiple updates."],"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"}