HHH-16570 Batch fetch with FetchMode JOIN might lead to multiplication in OneToMany items
This commit is contained in:
parent
4dd37075ee
commit
87f0dfc9d6
|
@ -354,6 +354,14 @@ public class LoaderSelectBuilder {
|
||||||
this.entityGraphTraversalState = entityGraphTraversalState;
|
this.entityGraphTraversalState = entityGraphTraversalState;
|
||||||
this.forceIdentifierSelection = forceIdentifierSelection;
|
this.forceIdentifierSelection = forceIdentifierSelection;
|
||||||
this.jdbcParameterConsumer = jdbcParameterConsumer;
|
this.jdbcParameterConsumer = jdbcParameterConsumer;
|
||||||
|
if ( loadable instanceof PluralAttributeMapping ) {
|
||||||
|
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) loadable;
|
||||||
|
if ( pluralAttributeMapping.getMappedType()
|
||||||
|
.getCollectionSemantics()
|
||||||
|
.getCollectionClassification() == CollectionClassification.BAG ) {
|
||||||
|
rowCardinality = RowCardinality.BAG;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LoaderSelectBuilder(
|
private LoaderSelectBuilder(
|
||||||
|
@ -440,15 +448,6 @@ public class LoaderSelectBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private SelectStatement generateSelect() {
|
private SelectStatement generateSelect() {
|
||||||
if ( loadable instanceof PluralAttributeMapping ) {
|
|
||||||
final PluralAttributeMapping pluralAttributeMapping = (PluralAttributeMapping) loadable;
|
|
||||||
if ( pluralAttributeMapping.getMappedType()
|
|
||||||
.getCollectionSemantics()
|
|
||||||
.getCollectionClassification() == CollectionClassification.BAG ) {
|
|
||||||
rowCardinality = RowCardinality.BAG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final NavigablePath rootNavigablePath = new NavigablePath( loadable.getRootPathName() );
|
final NavigablePath rootNavigablePath = new NavigablePath( loadable.getRootPathName() );
|
||||||
|
|
||||||
final QuerySpec rootQuerySpec = new QuerySpec( true );
|
final QuerySpec rootQuerySpec = new QuerySpec( true );
|
||||||
|
|
Loading…
Reference in New Issue