Commit 8081b6c5 authored by Michael Ritter's avatar Michael Ritter
Browse files

Return List<String> instead of json array

parent 9bc7fd1e
...@@ -2,7 +2,6 @@ package edu.umiacs.ace.rest; ...@@ -2,7 +2,6 @@ package edu.umiacs.ace.rest;
import edu.umiacs.ace.monitor.core.Collection; import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.util.PersistUtil; import edu.umiacs.ace.util.PersistUtil;
import org.codehaus.jettison.json.JSONArray;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.Query; import javax.persistence.Query;
...@@ -28,11 +27,10 @@ public class ListController { ...@@ -28,11 +27,10 @@ public class ListController {
@GET @GET
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Path("groups") @Path("groups")
public JSONArray getGroups() { public List<String> getGroups() {
EntityManager em = PersistUtil.getEntityManager(); EntityManager em = PersistUtil.getEntityManager();
Query q = em.createNamedQuery("Collection.listGroups"); Query q = em.createNamedQuery("Collection.listGroups");
List<String> groups = q.getResultList(); return q.getResultList();
return new JSONArray(q.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