title: Spring data Neo4j fetch relationships
body: <p>I am using spring-data-neo4j V4 and look for solution how to fetch entities which are not directly connected to the loaded entity. To explain:</p>
  
  <p>I do have 3 entities in my neo4j database.</p>
  
  <pre><code>@NodeEntity(label="membership")
  public class Membership extends AbstractEntity{
  
      public Membership(){ }
  
      private String membershipId;
  
      @Relationship(type = "IN_YEAR", direction = Relationship.OUTGOING)
      private Set&lt;Year&gt; year = new HashSet&lt;&gt;();
  
      //getter+setter
  
  }
  
  @NodeEntity(label="year")
  public class Year extends AbstractEntity{
  
      public Year(){}
  
      private String name;
      private String membershipId;
  
      @Relationship(type = "IN_MONTH", direction = Relationship.OUTGOING )
      private Set&lt;Month&gt; month = new HashSet&lt;&gt;();
  
      //getter+setter
  }
  
  @NodeEntity(label="month")
  public class Month extends AbstractEntity{
  
      private String name;
  
      //getter+setter
  }
  </code></pre>
  
  <p>When i call my <code>MembershipRepository</code> and load a <code>Membership</code> by Id:</p>
  
  <pre><code>membershipRepository.findByMembershipId(id);
  </code></pre>
  
  <p>the <code>year</code> entities will be fetched but the <code>month</code> entities not.
  Can anybody tell what is the best or recommended way to load the <code>month</code> entities when loading the <code>membership</code> entity? As written in <a href="http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/" rel="nofollow">http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/</a> the <code>@Fetch</code> is obsolete since version 4 so I need another solution. </p>
  
  <p>EDIT:
  I read in <a href="http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/" rel="nofollow">http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/</a> the workaround for fetch, just use the <code>load</code> methods from the <code>Neo4jTemplate</code>.
  So I load the months for every year by: </p>
  
  <pre><code>Set&lt;Year&gt; fetchedYear = new HashSet&lt;&gt;();
  for(Year year : ms.getYear()){
      fetchedYear.add(neo4jTemplate.load(Year.class, year.getId(), 1));
  }   
  ms.setYear(fetchedYear);
  </code></pre>
  
  <p>But is there a better solution?</p>