Skip to content

Commit 3406cc6

Browse files
committed
HHH-19207 - propose solution
1 parent 0d47e81 commit 3406cc6

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
@@ -8323,6 +8323,15 @@ else if ( getLoadQueryInfluencers().hasEnabledFetchProfiles() ) {
83238323
}
83248324
else {
83258325
tableGroup = compatibleTableGroup;
8326+
8327+
if ( joinProducer instanceof PluralAttributeMapping attributeMapping ) {
8328+
if ( attributeMapping.getOrderByFragment() != null ) {
8329+
applyOrdering( tableGroup, attributeMapping.getOrderByFragment() );
8330+
}
8331+
if ( attributeMapping.getManyToManyOrderByFragment() != null ) {
8332+
applyOrdering( tableGroup, attributeMapping.getManyToManyOrderByFragment() );
8333+
}
8334+
}
83268335
}
83278336

83288337
// and return the joined group

0 commit comments

Comments
 (0)