You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Many-to-many queries followed by sorting raise exception when sorting is done by queried table properties #14636
The title (as convoluted as it is) probably says it all. The issue is demonstrated in this example app, specifically by the included test case. Briefly, when a simple where query is performed using a domain class that represents a many-to-many relationship between two other domain classes, sorting by the queried table requires that aliases are created for each table.
This issue has been verified as fixed in Grails 7.x / GORM 8.x.
We wrote a reproduction test that exercises the exact scenario (many-to-many where query followed by sorting on queried table properties) and it passes on the current 7.0.x codebase. The fix was part of commit ddae6ee795 which auto-creates aliases for joined association projections.
If you are still experiencing this issue on Grails 7.x, please reopen with a minimal reproduction.
Thanks for the report. The many-to-many where query with sorting across user.username is now covered by the issue-specific WhereQueryIssueVerificationSpec. The fix and regression coverage landed through PR #15460, shipped in Grails 7.0.8, and remain in current 8.0.x. Closing this as fixed.
Activity
jamesfredley commentedon Feb 26, 2026
This issue has been verified as fixed in Grails 7.x / GORM 8.x.
We wrote a reproduction test that exercises the exact scenario (many-to-many
wherequery followed by sorting on queried table properties) and it passes on the current 7.0.x codebase. The fix was part of commitddae6ee795which auto-creates aliases for joined association projections.If you are still experiencing this issue on Grails 7.x, please reopen with a minimal reproduction.
fix: remove @PendingFeatureIf from many-to-many sorting test in H5
jamesfredley commentedon Jul 24, 2026
Thanks for the report. The many-to-many
wherequery with sorting acrossuser.usernameis now covered by the issue-specificWhereQueryIssueVerificationSpec. The fix and regression coverage landed through PR #15460, shipped in Grails 7.0.8, and remain in current8.0.x. Closing this as fixed.