Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.3.7
-
Fix Version/s: 2.0-M2
-
Component/s: Persistence
-
Labels:None
Description
Sample code:
MyEntity.createCriteria().list(sort:'associatedObject.name',order:'asc') {
associatedObject {
....
}
}
This will cause org.hibernate.QueryException: duplicate association path: associatedObject.
I think its caused by the code in GrailsHibernateUtil.addOrderPossiblyNested: it doesn't reuse existing alias and always tried to create a new one.
attach an example that reproduces the issue