java - Converting ExecutionResult object to json -


i need expose public api, , need convert result of cypher query json. have begun process, having problems serializing object of type scala.collection.convert.wrappers$seqwrapper gets returned when using collect() in cypher.

here cypher query:

match (orders:orders {id:'locationrestaurant'}), (order:order),    (orders)-[:hasorder]-(order),(order)-[:orderedproduct]->(product),(client)-[:ordered]->(order) return (order),(client), collect(product) products; 

how can handle type of object? can cast list? also, there libraries converting executionresult json?

if need more details, please ask. here code

public queryresult runcypher(string query, map<string,object> params) {     queryresult result = new queryresult();     transaction tx = service.begintx();     executionresult execresult = null;     boolean success = true;      system.out.println(query);     try     {         if(params!=null) execresult = engine.execute(query, params);         else             execresult = engine.execute(query);         result.result = getreturnedobjectstojson(execresult);     }     catch(exception e)     {         system.out.println(e.getmessage()+" exception message");         result.result = e.getmessage();         success = false;     }         {         if(success) tx.success();         else        tx.failure();     }      tx.close();      result.success = success;      return result; } 

basically, getreturnedobjectstojson work.

how can handle type of object?

data.get("labels") instanceof java.util.collection

can cast list?

yes

also, there libraries converting executionresult json?

executionresult iterable, think can use popular java json framework, example gson or jackson


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -