Hi,
I'm trying to make this query in a SDN repository:
start g=node:groups("name:*") match u-[b?:belongs]->g<-
[c?:contains*0..8]-p<-[n?:contains]-h where ((u.login AND u.login=~
{query}) OR
g.name=~ {query}) and n is null return distinct p order by
p.name skip {from} limit {total}
My code in repository is this:
@Query(value="start g=node:groups(\"name:*\") " +
"match u-[b?:belongs]->g<-[c?:contains*0..8]-p<-[n?:contains]-h " +
"where ((u.login AND u.login=~ {query}) " +
"and n is null " +
"return distinct p " + //, from, total " +
"order by
p.name skip {from} limit {total}" )
Iterable<Group> getGroups(
@Param( "query" ) String query,
@Param( "from" ) int from,
@Param( "total" ) int total );
When the query returns results, I get an exception caused by a
parameter not being found:
Caused by: org.neo4j.cypher.ParameterNotFoundException: Expected a
parameter named from
at org.neo4j.cypher.commands.Parameter$$anonfun$apply
$5.apply(Expression.scala:187)
at org.neo4j.cypher.commands.Parameter$$anonfun$apply
$5.apply(Expression.scala:187)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:122)
at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:187)
at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:186)
at org.neo4j.cypher.internal.pipes.SlicePipe.asInt$1(SlicePipe.scala:
37)
at
org.neo4j.cypher.internal.pipes.SlicePipe.createResults(SlicePipe.scala:
44)
at
org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilterPipe.scala:
33)
at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
$prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
$prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
at
org.neo4j.cypher.internal.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:
33)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55)
at
org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:
78)
at
org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:
63)
... 98 more
I have debugged it as far as I can and in the step createResults of
the SlicePipe I can see "from" and "total" with the correct values as
params.
My version of neo4j is 1.6.M02.
Do you have any idea about why is this error happening and how to
solve it?
Many thanks in advanced.