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:
Oliver Gierke
2011-03-01 20:42:14 +01:00
parent ff844d7cbc
commit 695f4ca9c0

View File

@@ -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);
}