HHH-10437 - Fix NPE in PrimaryKey#addColumn(Column column) when getTable().getNameIdentifier() is null
This commit is contained in:
parent
a4dbbf447d
commit
5b42faa134
|
@ -35,7 +35,7 @@ public class PrimaryKey extends Constraint {
|
||||||
log.debugf(
|
log.debugf(
|
||||||
"Forcing column [%s] to be non-null as it is part of the primary key for table [%s]",
|
"Forcing column [%s] to be non-null as it is part of the primary key for table [%s]",
|
||||||
column.getCanonicalName(),
|
column.getCanonicalName(),
|
||||||
getTable().getNameIdentifier().getCanonicalName()
|
getTableNameForLogging( column )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,13 @@ public class PrimaryKey extends Constraint {
|
||||||
|
|
||||||
protected String getTableNameForLogging(Column column) {
|
protected String getTableNameForLogging(Column column) {
|
||||||
if ( getTable() != null ) {
|
if ( getTable() != null ) {
|
||||||
|
if ( getTable().getNameIdentifier() != null ) {
|
||||||
return getTable().getNameIdentifier().getCanonicalName();
|
return getTable().getNameIdentifier().getCanonicalName();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return "<unknown>";
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( column.getValue() != null && column.getValue().getTable() != null ) {
|
else if ( column.getValue() != null && column.getValue().getTable() != null ) {
|
||||||
return column.getValue().getTable().getNameIdentifier().getCanonicalName();
|
return column.getValue().getTable().getNameIdentifier().getCanonicalName();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue