{"record":{"id":"a239cc2c13bad410","repo":"hibernate/hibernate-orm","slug":"logical-column-name-cannot-be-null","errorCode":null,"errorMessage":"Logical column name cannot be null","messagePattern":"Logical column name cannot be null","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java","lineNumber":1163,"sourceCode":"\n\t@Override\n\tpublic String getPhysicalColumnName(Table table, String logicalName) throws MappingException {\n\t\tfinal Identifier identifier = getDatabase().toIdentifier( logicalName );\n\t\tif ( identifier == null ) {\n\t\t\tthrow new MappingException( String.format(\n\t\t\t\t\tLocale.ENGLISH,\n\t\t\t\t\t\"Column with logical name '%s' in table '%s' cannot be mapped to column identifier\",\n\t\t\t\t\tlogicalName,\n\t\t\t\t\ttable.getName()\n\t\t\t) );\n\t\t}\n\t\treturn getPhysicalColumnName( table, identifier );\n\t}\n\n\t@Override\n\tpublic String getPhysicalColumnName(Table table, Identifier logicalName) throws MappingException {\n\t\tif ( logicalName == null ) {\n\t\t\tthrow new MappingException( \"Logical column name cannot be null\" );\n\t\t}\n\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\tfinal String physicalName = binding.logicalToPhysical.get( logicalName );\n\t\t\t\tif ( physicalName != null ) {\n\t\t\t\t\treturn physicalName;\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\tassert table != null;","sourceCodeStart":1145,"sourceCodeEnd":1181,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java#L1145-L1181","documentation":"Error \"Logical column name cannot be null\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A null logical column name is passed when linking logical-to-physical column mappings.","commonSituations":"Internal binding of a mapping that did not produce a column name, typically a formula or an incomplete mapping annotation combination.","solutions":["Pass a non-null logical column name when looking up or registering a column mapping.","Check annotation/mapping configuration for a column definition with a missing or empty name.","Use @Column(name=...) explicitly if the implicit naming produces a null."],"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"}