Thanks! The following is working fine:
Code:
try {
GraphDatabaseAPI graphDatabaseService = new EmbeddedGraphDatabase("testdb");
GraphDatabase graphDatabase = new DelegatingGraphDatabase(graphDatabaseService);
PlatformTransactionManager transactionManager = new JtaTransactionManager(new SpringTransactionManager(graphDatabaseService));
Neo4jTemplate template = new Neo4jTemplate(graphDatabase, transactionManager);
Transaction tx = template.beginTx();
template.save(new Movie("Node 1", "Test 1"));
template.save(new Movie("Node 2", "Test 2"));
tx.success();
tx.finish();
graphDatabaseAPI.shutdown();
} catch (Exception e) {
e.printStackTrace();
}
1) Are there any alternatives to the deprecated beginTx()?
Neoclipse doesn't visualize the graph, but a simple Cypher query lists the nodes:
Code:
[{"n":{"relation":[],"id":0,"propertyMap":{}}},{"n":{"relation":[],"id":1,"propertyMap":{"moons":0,"b":"Test 1","__type__":"Movie","a":"Node 1"}}},{"n":{"relation":[],"id":2,"propertyMap":{"moons":0,"b":"Test 2","__type__":"Movie","a":"Node 2"}}}]
2) I guess it has to do something with the #0 root node. How can I visualize at least one of the Movie nodes?