Commit d6ecc6f0 authored by Michael Ritter's avatar Michael Ritter
Browse files

#27 Apply ordering when querying for groups, collections, and items

parent 783ebf23
......@@ -75,7 +75,7 @@ import java.util.Map;
@NamedQuery(name = "Collection.getCollectionByName", query =
"SELECT c FROM Collection c WHERE c.name = :name"),
@NamedQuery(name = "Collection.listGroups", query =
"SELECT DISTINCT c.group FROM Collection c WHERE c.group IS NOT NULL"),
"SELECT DISTINCT c.group FROM Collection c WHERE c.group IS NOT NULL ORDER BY c.group ASC"),
@NamedQuery(name = "Collection.getCollectionById", query =
"SELECT c FROM Collection c WHERE c.id = :id"),
@NamedQuery(name = "Collection.getCollectionsInGroup", query =
......
......@@ -110,6 +110,7 @@ public class ListController {
if (corrupt != null && corrupt) {
cq.where(cb.equal(coll.get("state"), CollectionState.ERROR));
}
cq.orderBy(cb.asc(coll.get("group")));
return entityManager.createQuery(cq).getResultList();
}
......@@ -148,6 +149,7 @@ public class ListController {
}
cq.where(predicate);
cq.orderBy(cb.asc(mi.get("path")));
return entityManager.createQuery(cq).getResultList();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment