hibernate/hibernate-orm · error · SemanticException

Assignment referred to column of a joined association: ${col

Error message

Assignment referred to column of a joined association: ${columnReference}

What it means

Error "Assignment referred to column of a joined association: ${columnReference}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedInsertHandler.java:1011

			}
		}
		return true;
	}

	private TableReference resolveTableReference(
			ColumnReference columnReference,
			Map<String, TableReference> tableReferenceByAlias) {
		if ( columnReference.getQualifier() == null ) {
			// This happens only for the special row_number column
			return null;
		}
		final var tableReferenceByQualifier =
				tableReferenceByAlias.get( columnReference.getQualifier() );
		if ( tableReferenceByQualifier != null ) {
			return tableReferenceByQualifier;
		}

		throw new SemanticException( "Assignment referred to column of a joined association: " + columnReference );
	}

	private NamedTableReference resolveUnionTableReference(TableReference tableReference, String tableExpression) {
		if ( tableReference instanceof UnionTableReference ) {
			return new NamedTableReference(
					tableExpression,
					tableReference.getIdentificationVariable(),
					tableReference.isOptional()
			);
		}
		else {
			return (NamedTableReference) tableReference;
		}
	}

	public SqmInsertStatement<?> getSqmInsertStatement() {
		return (SqmInsertStatement<?>) getSqmStatement();
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. The INSERT assignment targets a column of a joined association, which the temp-table insert handler does not support.
  2. Insert into the joined table separately or restructure the mapping.

When it happens

Trigger: An UPDATE/INSERT assignment targets columns that cannot be handled by the mutation strategy.

Common situations: Bulk HQL update/insert statements assigning columns spread across multiple tables or columns of joined associations.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/f3c7733974f6ccb7. Report an issue: GitHub.