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
a1b133381f
commit
312ef5600f
|
@ -655,6 +655,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