Skip to content

Commit 1614148

Browse files
committed
HHH-14519 improve error message
fix by @karge-itestra Tassilo Karge
1 parent ceb7e56 commit 1614148

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,16 @@ public void addColumnNameBinding(Table table, Identifier logicalName, Column col
12161216

12171217
@Override
12181218
public String getPhysicalColumnName(Table table, String logicalName) throws MappingException {
1219-
return getPhysicalColumnName( table, getDatabase().toIdentifier( logicalName ) );
1219+
final Identifier identifier = getDatabase().toIdentifier( logicalName );
1220+
if ( identifier == null ) {
1221+
throw new MappingException( String.format(
1222+
Locale.ENGLISH,
1223+
"Column with logical name '%s' in table '%s' cannot be mapped to column identifier",
1224+
logicalName,
1225+
table.getName()
1226+
) );
1227+
}
1228+
return getPhysicalColumnName( table, identifier );
12201229
}
12211230

12221231
@Override

0 commit comments

Comments
 (0)