mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-07 19:58:16 +00:00
HHH-10437 - Fix NPE in PrimaryKey#addColumn(Column column) when getTable().getNameIdentifier() is null
This commit is contained in:
parent
64430890a4
commit
a84eb2f47c
@ -35,7 +35,7 @@ public void addColumn(Column column) {
|
||||
log.debugf(
|
||||
"Forcing column [%s] to be non-null as it is part of the primary key for table [%s]",
|
||||
column.getCanonicalName(),
|
||||
getTable().getNameIdentifier().getCanonicalName()
|
||||
getTableNameForLogging( column )
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,12 @@ public void addColumn(Column column) {
|
||||
|
||||
protected String getTableNameForLogging(Column column) {
|
||||
if ( getTable() != null ) {
|
||||
return getTable().getNameIdentifier().getCanonicalName();
|
||||
if ( getTable().getNameIdentifier() != null ) {
|
||||
return getTable().getNameIdentifier().getCanonicalName();
|
||||
}
|
||||
else {
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
else if ( column.getValue() != null && column.getValue().getTable() != null ) {
|
||||
return column.getValue().getTable().getNameIdentifier().getCanonicalName();
|
||||
|
Loading…
x
Reference in New Issue
Block a user