Skip to content

Commit 48ac928

Browse files
baranyitbeikov
authored andcommitted
HHH-19207 - propose solution
1 parent 741f8aa commit 48ac928

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8370,6 +8370,15 @@ else if ( getLoadQueryInfluencers().hasEnabledFetchProfiles() ) {
83708370
}
83718371
else {
83728372
tableGroup = compatibleTableGroup;
8373+
8374+
if ( joinProducer instanceof PluralAttributeMapping attributeMapping ) {
8375+
if ( attributeMapping.getOrderByFragment() != null ) {
8376+
applyOrdering( tableGroup, attributeMapping.getOrderByFragment() );
8377+
}
8378+
if ( attributeMapping.getManyToManyOrderByFragment() != null ) {
8379+
applyOrdering( tableGroup, attributeMapping.getManyToManyOrderByFragment() );
8380+
}
8381+
}
83738382
}
83748383

83758384
// and return the joined group

0 commit comments

Comments
 (0)