Fixed sorting not being applied if provided via method parameter.
AbstractQueryCreator now uses the Sort object from the parameters if the PartTree not already contains a Sort object (which got there due to a OrderBy directive in the method name).
This commit is contained in:
@@ -62,7 +62,10 @@ public abstract class AbstractQueryCreator<T, S> {
|
||||
*/
|
||||
public T createQuery() {
|
||||
|
||||
return complete(createCriteria(tree), tree.getSort());
|
||||
Sort treeSort = tree.getSort();
|
||||
Sort sort = treeSort != null ? treeSort : parameters.getSort();
|
||||
|
||||
return complete(createCriteria(tree), sort);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user