Skip to content

Commit 0922fb1

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

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -8494,6 +8494,16 @@ else if ( getLoadQueryInfluencers().hasEnabledFetchProfiles() ) {
84948494
}
84958495
else {
84968496
tableGroup = compatibleTableGroup;
8497+
8498+
if ( joinProducer instanceof PluralAttributeMapping ) {
8499+
final PluralAttributeMapping attributeMapping = (PluralAttributeMapping) joinProducer;
8500+
if ( attributeMapping.getOrderByFragment() != null ) {
8501+
applyOrdering( tableGroup, attributeMapping.getOrderByFragment() );
8502+
}
8503+
if ( attributeMapping.getManyToManyOrderByFragment() != null ) {
8504+
applyOrdering( tableGroup, attributeMapping.getManyToManyOrderByFragment() );
8505+
}
8506+
}
84978507
}
84988508

84998509
// and return the joined group

0 commit comments

Comments
 (0)