SpringDataNeo4J4.0.0:按属性查找的正确调用顺序是什么?
我正在Neo4J 4.0.0.M1中的一个节点上执行一个简单的驼峰大小写查找: e、 g 我可以在日志文件中看到生成了正确的密码查询:SpringDataNeo4J4.0.0:按属性查找的正确调用顺序是什么?,neo4j,spring-data-neo4j,spring-data-neo4j-4,Neo4j,Spring Data Neo4j,Spring Data Neo4j 4,我正在Neo4J 4.0.0.M1中的一个节点上执行一个简单的驼峰大小写查找: e、 g 我可以在日志文件中看到生成了正确的密码查询: match (u:User) where u.userId = {0} return u 我可以在Neo4J浏览器中运行这段代码,预期结果是返回一个节点。我还可以看到生成了正确的JSON e、 g 我可以从PostMaster处运行它,并获得返回一个节点的预期结果 但是,在graphrespository中使用命名查询运行这段代码将返回当前在Neo4JSess
match (u:User) where u.userId = {0} return u
我可以在Neo4J浏览器中运行这段代码,预期结果是返回一个节点。我还可以看到生成了正确的JSON
e、 g
我可以从PostMaster处运行它,并获得返回一个节点的预期结果
但是,在graphrespository
中使用命名查询运行这段代码将返回当前在Neo4JSession
中的每个节点
以下是UserRepository:
@Repository
public interface UserNodeRepository extends GraphRepository<User> {
@Query ("match (u:User) where u.userId = {0} return u")
public List<User> findByUserId(String userId);
}
这将返回MappingContext中具有给定类类型的所有节点。我认为,它应该调用Neo4JSession.loadByProperty
,它在节点上进行查找
是否有我缺少的设置?
@Query
返回不需要的结果已在M1发布后修复。能否使用快照生成重试此操作
谢谢。我不确定这是一个bug还是4.0.0的一个新特性,需要一些额外的配置。
21:53:39.819 [tomcat-http--37] INFO o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/commit, request: {"statements":[{"statement":"match (u:User) where u.userId = {0} return u","parameters":{"0":"145"},"resultDataContents":["graph"]}]}
@Repository
public interface UserNodeRepository extends GraphRepository<User> {
@Query ("match (u:User) where u.userId = {0} return u")
public List<User> findByUserId(String userId);
}
return getResponseHandler().loadAll(type, response);