Skip to content

Commit be5ea65

Browse files
baranyitbeikov
authored andcommitted
HHH-19207 - propose solution
1 parent 8961fbb commit be5ea65

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
@@ -8494,6 +8494,15 @@ else if ( getLoadQueryInfluencers().hasEnabledFetchProfiles() ) {
84948494
}
84958495
else {
84968496
tableGroup = compatibleTableGroup;
8497+
8498+
if ( joinProducer instanceof PluralAttributeMapping attributeMapping ) {
8499+
if ( attributeMapping.getOrderByFragment() != null ) {
8500+
applyOrdering( tableGroup, attributeMapping.getOrderByFragment() );
8501+
}
8502+
if ( attributeMapping.getManyToManyOrderByFragment() != null ) {
8503+
applyOrdering( tableGroup, attributeMapping.getManyToManyOrderByFragment() );
8504+
}
8505+
}
84978506
}
84988507

84998508
// and return the joined group

0 commit comments

Comments
 (0)