title: How to select in join fetch QueryDSL JPAQuery?
body: <p>I have an application with QueryDSL JPAQuery. Here it is:</p>
  
  <pre><code>JPAQuery&lt;MyWrapper&gt; searchQuery
          = queryFactory.select(Projections.constructor(MyWrapper.class,
          deviceGroup.id,
          deviceGroup.name,
          deviceGroup.orientation,
          deviceGroup.location,
          deviceGroup.customer,
          workgroup.account,
          Expressions.as(queryFactory.select(device.count())
              .from(device)
              .where(device.group.id.eq(deviceGroup.id)), "displaysQty"),
          Expressions.as(queryFactory.select(device.count())
              .from(device)
              .where(device.group.id.eq(deviceGroup.id),
                  device.status.eq(DeviceStatus.HEALTHY)), "healthyQty"),
          Expressions.as(queryFactory.select(device.count())
              .from(device)
              .where(device.group.id.eq(deviceGroup.id),
                  device.status.eq(DeviceStatus.NO_SYNC)), "noSyncQty"),
          Expressions.as(queryFactory.select(device.count())
              .from(device)
              .where(device.group.id.eq(deviceGroup.id),
                  device.status.eq(DeviceStatus.NEED_SERVICE)), "needServiceQty"),
          Expressions.as(queryFactory.select(device.count())
              .from(device)
              .where(device.group.id.eq(deviceGroup.id),
                  device.status.eq(DeviceStatus.OUT_OF_SERVICE)), "outOfServiceQty")))
          .from(deviceGroup)
          .leftJoin(deviceGroup.customer, workgroup).fetchJoin()
          .leftJoin(workgroup.account, account).fetchJoin()
          .where(predicate)
          .orderBy(sortingParams.toArray(new OrderSpecifier[0]));
  </code></pre>
  
  <p><strong>MyWrapper</strong> looks like:</p>
  
  <pre><code>@Data
  @AllArgsConstructor
  @NoArgsConstructor
  public class MyWrapper{
  
    private Long id;
    private String name;
    private DsmsOrientationType orientation;
    private String location;
    private WorkgroupEntityJpa customer;
    private AccountEntityJpa account;
  
    private long displaysQty;
    private long healthyQty;
    private long noSyncQty;
    private long needServiceQty;
    private long outOfServiceQty;
  }
  </code></pre>
  
  <p>And I've got the exception <strong>query specified join fetching, but the owner of the fetched association was not present in the select list</strong>.</p>
  
  <p>I've already tried <strong>deviceGroup.customer.account</strong> instead of <strong>workgroup.account</strong>, result was the same.</p>
  
  <p><strong>UPD</strong>
  Here is the <strong>JPAQuery.toString():</strong></p>
  
  <pre><code>select deviceGroupEntityJpa.id, 
          deviceGroupEntityJpa.name, 
          deviceGroupEntityJpa.orientation, 
          deviceGroupEntityJpa.location, 
          deviceGroupEntityJpa.customer, 
          workgroupEntityJpa.account, 
          (select count(deviceEntityJpa)
              from DeviceEntityJpa deviceEntityJpa
              where deviceEntityJpa.group.id = deviceGroupEntityJpa.id) as displaysQty, 
          (select count(deviceEntityJpa)
              from DeviceEntityJpa deviceEntityJpa
              where deviceEntityJpa.group.id = deviceGroupEntityJpa.id and deviceEntityJpa.status = ?1) as healthyQty, 
          (select count(deviceEntityJpa)
              from DeviceEntityJpa deviceEntityJpa
              where deviceEntityJpa.group.id = deviceGroupEntityJpa.id and deviceEntityJpa.status = ?2) as noSyncQty, 
          (select count(deviceEntityJpa)
              from DeviceEntityJpa deviceEntityJpa
              where deviceEntityJpa.group.id = deviceGroupEntityJpa.id and deviceEntityJpa.status = ?3) as needServiceQty, 
          (select count(deviceEntityJpa)
              from DeviceEntityJpa deviceEntityJpa
              where deviceEntityJpa.group.id = deviceGroupEntityJpa.id and deviceEntityJpa.status = ?4) as outOfServiceQty
  from DeviceGroupEntityJpa deviceGroupEntityJpa
    left join fetch deviceGroupEntityJpa.customer as workgroupEntityJpa
    left join fetch workgroupEntityJpa.account as accountEntityJpa
  </code></pre>