Sorry Atul

I don't understand what you mean

There is no place where a query gets concatenated

It evaluates the parameters in the map at execution-time when needed with their 
value

Sent from mobile device

Am 22.01.2014 um 19:00 schrieb Atul Agrawal <[email protected]>:

> 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
> 
> 
> -- 
> 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.

-- 
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.

Reply via email to