title: Use only subset of JPQL select columns for objects
body: <p>I have entities Team, Game and TeamInGame. To select teams ordered by their last games i use:</p>
  
  <pre><code>Query query = em.createQuery("select tg.team, max(tg.game.gameDate) as maxDate" +
  " from TeamInGame tg" +
  " group by tg.team" +
  " order by maxDate desc");
  
  return Lists.transform(query.getResultList(), new Function&lt;Object[], Team&gt;() {
              @Override
              public Team apply(Object[] input) {
                  return (Team) input[0];
              }
         });
  </code></pre>
  
  <p>Is there a way to get rid of this transformation? This query does not work:</p>
  
  <pre><code>return em.createQuery("select tg.team, max(tg.game.gameDate) as maxDate" +
      " from TeamInGame tg" +
      " group by tg.team" +
      " order by maxDate desc", Team.class).getResultList();
  </code></pre>