HHH-14519 improve error message

fix by @karge-itestra Tassilo Karge
This commit is contained in:
Gavin King 2024-11-24 21:49:58 +01:00
parent ceb7e565fe
commit 16141487d5

View File

@ -1216,7 +1216,16 @@ public void addColumnNameBinding(Table table, Identifier logicalName, Column col
@Override
public String getPhysicalColumnName(Table table, String logicalName) throws MappingException {
return getPhysicalColumnName( table, getDatabase().toIdentifier( logicalName ) );
final Identifier identifier = getDatabase().toIdentifier( logicalName );
if ( identifier == null ) {
throw new MappingException( String.format(
Locale.ENGLISH,
"Column with logical name '%s' in table '%s' cannot be mapped to column identifier",
logicalName,
table.getName()
) );
}
return getPhysicalColumnName( table, identifier );
}
@Override