title: QueryDSL exception: query specified join fetching, but the owner of the fetched association was not present in the select list
body: <p>I'm having a lot of trouble understanding why I'm running into a QueryException
  <code>query specified join fetching, but the owner of the fetched association was not present in the select list</code></p>
  <p>In my project, I need to do the following:</p>
  <pre><code>projectRequest.getName();
  ...... a bunch of different projectRequest gets...
  
  projectRequest.getProject().getName()
  ...... a bunch of project gets....
  
  projectRequest.getProject().getProjectStatus().getName();
  </code></pre>
  <p>and here is how the entities look like:</p>
  <pre><code>public class ProjectRequest {
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = &quot;ProjectId&quot;, referencedColumnName = &quot;ProjectId&quot;, insertable = false, updatable = false)
      private Project project;
  }
  
  public class Project {
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = &quot;StatusId&quot;, insertable = false, updatable = false)
      private ProjectStatus projectStatus;
  }
  </code></pre>
  <p>So I need to get a bunch of ProjectRequests and their associated Projects, and also need to access the Project's status. This is leading me to the N+1 issue. I'm reading that a solution is to fetch join the lazily fetched resources, so that's what I did:</p>
  <pre><code>select projectRequest
  from com.api.integration.entities.ProjectRequest projectRequest
    left join fetch projectRequest.project as project
    left join fetch projectRequest.project.projectStatus as projectStatus
  </code></pre>
  <p>But upon adding the <code>left join fetch projectRequest.project.projectStatus as projectStatus</code> part, I ran into  <code>query specified join fetching, but the owner of the fetched association was not present in the select list</code>. How do I solve this? Why is it happening?</p>
  <p>Here is my query in the api:</p>
  <pre><code>new JPAQuery&lt;ProjectRequest&gt;()
      .from(projectRequest)
      .leftJoin(projectRequest.project, project).fetchJoin()
      .leftJoin(projectRequest.project.projectStatus, projectStatus).fetchJoin();
  </code></pre>