Spring Data Neo4j中的@Query shortestPath返回类型 [英] @Query shortestPath return type in Spring Data Neo4j
本文介绍了Spring Data Neo4j中的@Query shortestPath返回类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下查询的返回类型是什么,如何使用?我尝试了诸如Path
,Iterable<Path>
之类的几种方法,但是我总是遇到某种异常.它似乎是一个LinkedHashMap
,但是还有其他更方便使用的对象类型吗?
What's the return Type of the following query and how do I use it? I tried several things like Path
, Iterable<Path>
, and others but I always hit some sort of exceptions. It seems to be a LinkedHashMap
but are there any other handier object types that I can use?
@Query( "START u1=node:User(key= {0}), u2=node:User(key = {1}) " +
"MATCH p = shortestPath(u1-[*]-u2) " +
"RETURN p")
public ??? findShortestPath(String u1, String u2);
我是否缺少任何依赖关系?这是我正在使用的唯一一个:
Am I missing any dependencies? This is the only one that I'm using:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
推荐答案
返回类型为EndResult<EntityPath<S, E>
,其中S是路径的开始节点,E是结束类型.
The return type is EndResult<EntityPath<S, E>
, where S is the start node of the path, and E the end type.
这篇关于Spring Data Neo4j中的@Query shortestPath返回类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文