hibernate/hibernate-orm · error · MappingException

Unable to find column with logical name {} in table {}

Error message

Unable to find column with logical name {} in table {}

What it means

Error "Unable to find column with logical name {} in table {}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java:1182

		}

		Table currentTable = table;
		while ( currentTable != null ) {
			final TableColumnNameBinding binding = columnNameBindingByTableMap.get( currentTable );
			if ( binding != null ) {
				final String physicalName = binding.logicalToPhysical.get( logicalName );
				if ( physicalName != null ) {
					return physicalName;
				}
			}
			currentTable =
					currentTable instanceof DenormalizedTable denormalizedTable
							? denormalizedTable.getIncludedTable()
							: null;
		}

		assert table != null;
		throw new MappingException( "Unable to find column with logical name " + logicalName.render()
				+ " in table " + table.getName() );
	}

	@Override
	public String getLogicalColumnName(Table table, String physicalName) throws MappingException {
		return getLogicalColumnName( table, getDatabase().toIdentifier( physicalName ) );
	}


	@Override
	public String getLogicalColumnName(Table table, Identifier physicalName) throws MappingException {
		final String physicalNameString = physicalName.render( getDialect() );
		Identifier logicalName = null;
		Table currentTable = table;
		while ( currentTable != null ) {
			final TableColumnNameBinding binding = columnNameBindingByTableMap.get( currentTable );
			if ( binding != null ) {
				logicalName = binding.physicalToLogical.get( physicalNameString );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Confirm the logical column name used in @JoinColumn/@Column matches the name defined on the target entity mapping (naming strategy applies).
  2. Check whether a physical naming strategy transforms the name; use the logical (pre-strategy) name.
  3. List the table's columns in the mapping metadata to see the actual registered logical names.

When it happens

Trigger: A referenced column name does not exist in the named table's logical/physical column mappings.

Common situations: @JoinColumn or @Column referencing a column name that was never declared on the target table, often due to mismatched naming strategies or typos.


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