title: How to get node ids with path query in Spring Data Neo4j 4.0.0?
body: <p>I have a graph built from the following nodes:</p>
  
  <pre><code>@NodeEntity
  public class Node {
      @GraphId
      private Long id;
      private String desc;
      @Relationship(type = "CONNECTED_WITH", direction = Relationship.UNDIRECTED)
      private Set&lt;Node&gt; nodes;
      //getters and setters
  }
  </code></pre>
  
  <p>My Spring Data repository contains a Cypher query for the shortest paths between these nodes:</p>
  
  <pre><code>@Query("START startNode = node({startId}), endNode = node({endId}) " +
         "MATCH paths = allShortestPaths((startNode)-[*]-(endNode)) " +
         "RETURN paths")
  Iterable&lt;Map&lt;String, Iterable&lt;Object&gt;&gt;&gt; findShortestPaths(@Param("startId") long startId, @Param("endId") long endId);
  </code></pre>
  
  <p>Second Iterable returns the actual path as a list of nodes and relationships where each of them is represented as a hash map with properties. For a simple graph like this:</p>
  
  <blockquote>
    <p>A -- B -- C</p>
  </blockquote>
  
  <p>the result path for the <code>findShortestPaths</code> method between <code>A</code> and <code>C</code> contains 5 elements:</p>
  
  <pre><code>{desc=DescA}, {}, {desc=DescA}, {}, {desc=DescA}
  </code></pre>
  
  <p>I guess that empty maps represent relationships between nodes and in this case they don't have any property. My problem is that maps, which represent nodes, don't contain the <code>id</code> property.</p>
  
  <p><strong>Question:</strong>
  Is it possible to return nodes as corresponding entity objects instead of hash maps? And if not, how can I get the ids of the path nodes in the returned hash maps?</p>