HHH-10352 - Fix HBM2DDL does not use described name for foreign key in join inheritance
(cherry picked from commit 2ea122aedd
)
This commit is contained in:
parent
dc0f99c4f4
commit
e9e7a703e7
|
@ -653,6 +653,13 @@ public final class AnnotationBinder {
|
|||
if ( fk != null && !BinderHelper.isEmptyAnnotationValue( fk.name() ) ) {
|
||||
key.setForeignKeyName( fk.name() );
|
||||
}
|
||||
else {
|
||||
final PrimaryKeyJoinColumn pkJoinColumn = clazzToProcess.getAnnotation( PrimaryKeyJoinColumn.class );
|
||||
if ( pkJoinColumn != null && pkJoinColumn.foreignKey() != null
|
||||
&& !StringHelper.isEmpty( pkJoinColumn.foreignKey().name() ) ) {
|
||||
key.setForeignKeyName( pkJoinColumn.foreignKey().name() );
|
||||
}
|
||||
}
|
||||
if ( onDeleteAnn != null ) {
|
||||
key.setCascadeDeleteEnabled( OnDeleteAction.CASCADE.equals( onDeleteAnn.action() ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue