Hello everyone,
I was trying neo4j and I came up with this functionality which can be
implemented.
While using cypher from java application we can use Map<String,Object> to
match parameters of Cypher query to their
value.(engine.execute(query,params))).
It will be great if you can make the function "which is responsible for
mapping parameters and generate the final cypher query" Public
When the cypher query is too big it becomes cumbersome to maintain all the
parameters in a map or list.
Suppose the function defination is
*public String get_query(String query,Map<String,Object> params)*
*USE*
/*
Other half will be added back to the query to make a final query to execute
*/
public String get_first_half_of_the_query(String origin_id,String dest_id){
params.put("origin_id", origin_id)
params.put("dest_id", dest_id);
String query = "MATCH (origin:City),(dest:City) WHERE
origin.id={origin_id}
AND dest.id={dest_id} ";
return engine.get_query(query,params);
}
thus get_query will simply change {origin_id} to its value.This will avoid
me to write the query in this way:
"MATCH (origin:City),(dest:City) WHERE origin.id="+"'"+origin_id+"'"+" AND
dest.id="+"'""+dest_id+"'" ";
thus enhancing code readabilty..
--
Atul Agrawal
BITS Pilani Goa Campus
mob:+91-81491-95049
[image: View my profile on
LinkedIn]<http://in.linkedin.com/pub/atul-agrawal/60/775/6b8>
--
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/groups/opt_out.