hibernate/hibernate-orm · error · MappingException

Unable to find column with physical name '{}' in table '{}'

Error message

Unable to find column with physical name '{}' in table '{}'

What it means

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

Source

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

		Identifier logicalName = null;
		Table currentTable = table;
		while ( currentTable != null ) {
			final TableColumnNameBinding binding = columnNameBindingByTableMap.get( currentTable );
			if ( binding != null ) {
				logicalName = binding.physicalToLogical.get( physicalNameString );
				if ( logicalName != null ) {
					break;
				}
			}
			currentTable =
					currentTable instanceof DenormalizedTable denormalizedTable
							? denormalizedTable.getIncludedTable()
							: null;
		}

		if ( logicalName == null ) {
			assert table != null;
			throw new MappingException( "Unable to find column with physical name '"
					+ physicalNameString + "' in table '" + table.getName() + "'" );
		}

		return logicalName.render();
	}

	@Override
	public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
		getDatabase().addAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
	}

	private final Map<String,AnnotatedClassType> annotatedClassTypeMap = new HashMap<>();

	@Override
	public AnnotatedClassType getClassType(ClassDetails clazz) {
		final var type = annotatedClassTypeMap.get( clazz.getName() );
		return type == null ? addClassType( clazz ) : type;
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Verify the physical column name exists in the table metadata, accounting for quoting and case sensitivity.
  2. Check the applied PhysicalNamingStrategy; the physical name may differ from what you expect (e.g. snake_case conversion).
  3. Enable mapping debug logging to print the table's registered physical column 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/50bd0bc849697b30. Report an issue: GitHub.