mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-28 06:49:09 +00:00
HHH-16860 Fix joined inheritance associations on root class
This commit is contained in:
parent
79fe21648c
commit
382037ec91
@ -1658,7 +1658,12 @@ protected void bindOneToManySecondPass(Map<String, PersistentClass> persistentCl
|
||||
inheritanceStatePerClass
|
||||
) );
|
||||
foreignJoinColumns.setJoins( joins );
|
||||
if ( foreignJoinColumns.hasMappedBy() ) {
|
||||
collection.setCollectionTable( associatedClass.getRecursiveProperty( foreignJoinColumns.getMappedBy() ).getValue().getTable() );
|
||||
}
|
||||
else {
|
||||
collection.setCollectionTable( foreignJoinColumns.getTable() );
|
||||
}
|
||||
if ( LOG.isDebugEnabled() ) {
|
||||
LOG.debugf( "Mapping collection: %s -> %s", collection.getRole(), collection.getCollectionTable().getName() );
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ public TableGroup createTableGroupInternal(
|
||||
creationState
|
||||
);
|
||||
|
||||
return new StandardTableGroup(
|
||||
final TableGroup tableGroup = new StandardTableGroup(
|
||||
canUseInnerJoins,
|
||||
navigablePath,
|
||||
this,
|
||||
@ -341,6 +341,9 @@ public TableGroup createTableGroupInternal(
|
||||
),
|
||||
creationContext.getSessionFactory()
|
||||
);
|
||||
// Make sure the association key's table is resolved in the table group
|
||||
tableGroup.getTableReference( null, resolveFetchAssociationKey().getTable(), true );
|
||||
return tableGroup;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user