{"record":{"id":"50bd0bc849697b30","repo":"hibernate/hibernate-orm","slug":"unable-to-find-column-with-physical-name-in-t","errorCode":null,"errorMessage":"Unable to find column with physical name '{}' in table '{}'","messagePattern":"Unable to find column with physical name '(.+?)' in table '(.+?)'","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java","lineNumber":1213,"sourceCode":"\t\tIdentifier logicalName = null;\n\t\tTable currentTable = table;\n\t\twhile ( currentTable != null ) {\n\t\t\tfinal TableColumnNameBinding binding = columnNameBindingByTableMap.get( currentTable );\n\t\t\tif ( binding != null ) {\n\t\t\t\tlogicalName = binding.physicalToLogical.get( physicalNameString );\n\t\t\t\tif ( logicalName != null ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentTable =\n\t\t\t\t\tcurrentTable instanceof DenormalizedTable denormalizedTable\n\t\t\t\t\t\t\t? denormalizedTable.getIncludedTable()\n\t\t\t\t\t\t\t: null;\n\t\t}\n\n\t\tif ( logicalName == null ) {\n\t\t\tassert table != null;\n\t\t\tthrow new MappingException( \"Unable to find column with physical name '\"\n\t\t\t\t\t+ physicalNameString + \"' in table '\" + table.getName() + \"'\" );\n\t\t}\n\n\t\treturn logicalName.render();\n\t}\n\n\t@Override\n\tpublic void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {\n\t\tgetDatabase().addAuxiliaryDatabaseObject( auxiliaryDatabaseObject );\n\t}\n\n\tprivate final Map<String,AnnotatedClassType> annotatedClassTypeMap = new HashMap<>();\n\n\t@Override\n\tpublic AnnotatedClassType getClassType(ClassDetails clazz) {\n\t\tfinal var type = annotatedClassTypeMap.get( clazz.getName() );\n\t\treturn type == null ? addClassType( clazz ) : type;\n\t}","sourceCodeStart":1195,"sourceCodeEnd":1231,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java#L1195-L1231","documentation":"Error \"Unable to find column with physical name '{}' in table '{}'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A referenced column name does not exist in the named table's logical/physical column mappings.","commonSituations":"@JoinColumn or @Column referencing a column name that was never declared on the target table, often due to mismatched naming strategies or typos.","solutions":["Verify the physical column name exists in the table metadata, accounting for quoting and case sensitivity.","Check the applied PhysicalNamingStrategy; the physical name may differ from what you expect (e.g. snake_case conversion).","Enable mapping debug logging to print the table's registered physical column names."],"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"}