title: converting a NodeProxy to NodeEntity in spring-data-neo4j
body: <p>I have the below Cypher query. It returns a list of players and list of all the leagues played by each player. Now For each of the returned players, I would like to create the <code>Person</code> <code>NodeEntity</code> instead of using the <code>NodeProxy</code>. Wondering what is the efficient way of doing this.</p>
  
  <pre><code>String q = "START t=node({teamId}) MATCH player-[:PLAYED_WITH_TEAM]-&gt;t-[:CONTESTED_IN]-&gt;league WITH player AS player, league.startDate AS startDate, league.name AS leagueName ORDER BY startDate RETURN player,  collect(leagueName) AS leagueNames";
  
  Map&lt;String, Object&gt; params = Maps.newHashMap();
  params.put("teamId", selectedTeam);
  
  Result&lt;Map&lt;String, Object&gt;&gt; result = template.query(q, params);
  
  final List&lt;Player&gt; players = new ArrayList&lt;Player&gt;();
  
  result.handle(new Handler&lt;Map&lt;String, Object&gt;&gt;()
  {
      @Override
      public void handle(Map&lt;String, Object&gt; value)
      {       
          players.add((Player) value.get("player"));
      }
  });
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [appServlet] in context with path [/avl] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.neo4j.kernel.impl.core.NodeProxy cannot be cast to com.aravind.avl.domain.Player] with root cause
  java.lang.ClassCastException: org.neo4j.kernel.impl.core.NodeProxy cannot be cast to com.aravind.avl.domain.Player
      at com.aravind.avl.controller.RegistrationController$1.handle(RegistrationController.java:103)
  </code></pre>