Hi Michael,
Yes I do, here is an example:
@RequestMapping(value = "/node/{id}", method = RequestMethod.GET,
headers = "Accept=application/xml, application/json")
@ResponseBody
public Entity getEntity(@PathVariable Long id) {
Node entityNode = neoService.getEntityById(id);
return entityNode;
}
This is one of my controller methods. The 'Entity' here is a domain
object that reflects a table (used by hibernate) and annotated by
@XmlRootElement tag, that marshals to XML fine with Spring. However,
when I return the same entity as a Neo4j "node" it does not get
converted automatically back to XML or JSon. Based on your earlier
reply I converted the node to a map as follows:
Map<String, Object> result =
objectSerializer.getMapForNode(entityNode);
At this point, I get all the node and its properties in the map -
thanks to your inputs.
Now I need to return this map somehow to Spring to render it into XML
and JSON. The configuration of both converters are as posted in my
earlier reply in this thread.
Please let me know if you require any further information.
Greets,
On May 2, 7:47 am, Michael Hunger <
michael.hun...@neopersistence.com>
wrote:
> Did you use @ResponseBody ?
>
> Sent from mobile device
>
> >> If you want to stream the json you can also use jacksons JsonGenerator as in here:
https://github.com/neo4j-contrib/streaming-cypherhttps://github.com/n......