Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
adapt
ace
Commits
8081b6c5
Commit
8081b6c5
authored
Nov 10, 2016
by
Michael Ritter
Browse files
Return List<String> instead of json array
parent
9bc7fd1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ace-am/src/main/java/edu/umiacs/ace/rest/ListController.java
View file @
8081b6c5
...
...
@@ -2,7 +2,6 @@ package edu.umiacs.ace.rest;
import
edu.umiacs.ace.monitor.core.Collection
;
import
edu.umiacs.ace.util.PersistUtil
;
import
org.codehaus.jettison.json.JSONArray
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
...
...
@@ -28,11 +27,10 @@ public class ListController {
@GET
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"groups"
)
public
JSONArray
getGroups
()
{
public
List
<
String
>
getGroups
()
{
EntityManager
em
=
PersistUtil
.
getEntityManager
();
Query
q
=
em
.
createNamedQuery
(
"Collection.listGroups"
);
List
<
String
>
groups
=
q
.
getResultList
();
return
new
JSONArray
(
q
.
getResultList
());
return
q
.
getResultList
();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment