使用Spring数据从neo4j获取动态值 [英] Getting dynamic values from neo4j using Spring data

查看:155
本文介绍了使用Spring数据从neo4j获取动态值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


public interface WayPointRepository extends GraphRepository, NamedIndexRepository, RelationshipOperationsRepository {
    @Query( value = "start point=node:waypoints(\"name:{name1}\") return point", elementClass=WayPoint.class, type=QueryType.Cypher ) 
    public List getWayPointByName(@Param("name1") String name);
}

我有一个neo4j数据库,其中某些点存储在索引"waypoints"中,我想获取 通过一些点后动态地改变一些点.为此,我创建了占位符{name1},

i have a neo4j database with some points stored in it with index "waypoints", i want to get some points dynamically after passing some points. for this i have created placeholder {name1},

但是使用动态参数调用getWayPointByName会给我

but on calling the getWayPointByName with dynamic param gives me


nested exception is java.lang.RuntimeException: org.apache.lucene.queryParser.ParseException: Cannot parse 'name:{name1}': Encountered " "}" "} "" at line 1, column 11.
Was expecting one of:
    "TO" ...
     ...
     ...
    ] with root cause
org.apache.lucene.queryParser.ParseException: Encountered " "}" "} "" at line 1, column 11.
Was expecting one of:
    "TO" ...
     ...
     ...

例外

推荐答案

使用

start point=node:waypoints(name={name1}) return point

在字符串中没有发生参数替换.

Within strings there is no parameter substitution happening.

这篇关于使用Spring数据从neo4j获取动态值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆