Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Neo4j + Eclipse(Retrieving data Neo4j)
Neo4j + Eclipse [message #1385344] Thu, 05 June 2014 18:13
Danny Alex Lachos Perez is currently offline Danny Alex Lachos PerezFriend
Messages: 1
Registered: June 2014
Junior Member
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
Previous Topic:eclipse randomly renames package
Next Topic:Eclipse Source Build
Goto Forum:
  


Current Time: Tue May 21 11:14:16 GMT 2024

Powered by FUDForum. Page generated in 0.03012 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top