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
|
inheritanceStatePerClass
|
||||||
) );
|
) );
|
||||||
foreignJoinColumns.setJoins( joins );
|
foreignJoinColumns.setJoins( joins );
|
||||||
|
if ( foreignJoinColumns.hasMappedBy() ) {
|
||||||
|
collection.setCollectionTable( associatedClass.getRecursiveProperty( foreignJoinColumns.getMappedBy() ).getValue().getTable() );
|
||||||
|
}
|
||||||
|
else {
|
||||||
collection.setCollectionTable( foreignJoinColumns.getTable() );
|
collection.setCollectionTable( foreignJoinColumns.getTable() );
|
||||||
|
}
|
||||||
if ( LOG.isDebugEnabled() ) {
|
if ( LOG.isDebugEnabled() ) {
|
||||||
LOG.debugf( "Mapping collection: %s -> %s", collection.getRole(), collection.getCollectionTable().getName() );
|
LOG.debugf( "Mapping collection: %s -> %s", collection.getRole(), collection.getCollectionTable().getName() );
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ public TableGroup createTableGroupInternal(
|
|||||||
creationState
|
creationState
|
||||||
);
|
);
|
||||||
|
|
||||||
return new StandardTableGroup(
|
final TableGroup tableGroup = new StandardTableGroup(
|
||||||
canUseInnerJoins,
|
canUseInnerJoins,
|
||||||
navigablePath,
|
navigablePath,
|
||||||
this,
|
this,
|
||||||
@ -341,6 +341,9 @@ public TableGroup createTableGroupInternal(
|
|||||||
),
|
),
|
||||||
creationContext.getSessionFactory()
|
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