@Query shortestPath return type in Spring Data Neo

2019-05-15 22:36发布

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>

1条回答
迷人小祖宗
2楼-- · 2019-05-15 23:00

The return type is EndResult<EntityPath<S, E>, where S is the start node of the path, and E the end type.

查看更多
登录 后发表回答