Details
-
Type:
Bug
-
Status:
In Progress
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0-RC1
-
Fix Version/s: 2.3-M2
-
Component/s: Persistence
-
Labels:None
-
Environment:Lion,JDK 6
Description
the original url: http://grails.1312388.n4.nabble.com/How-to-Order-by-association-in-DetachedCriteria-td3988989.html
I have tried like these:
bookingType
{ order('code','asc') }
--there is no error and no expected result
or
order('bookingType.code','asc')
--there is an exception.
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
On a related note, it would be extremely useful if the parameters passed to .list() on DetachedCriteria worked the same way.
Example:
new DetachedCriteria(SomeDomain).build { /* Some criteria */ }.list(sort: 'someAssociatedProperty.name', order: 'asc')