I have the following code (Using Eclipse with sample database Neo4j
DataBase -"Movie") which returns the name and born of the actors of the
film "The Matrix":
String query = "match (a:Person)-->(m {title:'The Matrix'}) return
a.name,a.born;" final String txUri = SERVER_ROOT_URI +
"transaction/commit";WebResource resource = Client.create().resource( txUri
);String payload = "{\"statements\" : [ {\"statement\" : \"" +query + "\"}
]}";ClientResponse response = resource
.accept( MediaType.APPLICATION_JSON )
.type( MediaType.APPLICATION_JSON )
.entity( payload )
.post( ClientResponse.class );
System.out.println(response.getEntity( String.class ));
The result is:
{"results":[{"columns":["a.name","a.born"],"data":[{"row":["Keanu
Reeves",1964]},{"row":["Carrie-Anne Moss",1967]},{"row":["Laurence
Fishburne",1961]},{"row":["Hugo Weaving",1960]},{"row":["Andy
Wachowski",1967]},{"row":["Lana Wachowski",1965]},{"row":["Joel
Silver",1952]},{"row":["Emil Eifrem",1978]}]}],"errors":[]}
But now i want to
now I want to pass data to a list, for example:
public class Person {
String name;
int born;}
java.util.List<Person> lstPerson = new java.util.ArrayList<Person>();
As I load the results of response.getEntity( String.class ) to my list or
would be a better way of working using Eclipse?
Thank you
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.