title: Nice way to select a tuple using JPA
body: <pre><code>final List&lt;Tuple&gt; data =
                      em.createQuery("SELECT p.id AS i, p.membership AS m FROM Player p WHERE p.id IN :ids", Tuple.class)
                      .setParameter("ids", ids)
                      .getResultList();
  </code></pre>
  
  <p>This gives the error "<code>Cannot create TypedQuery for query with more than one return</code>". I could work around that by leaving out the type parameter (and using Object[] instead of Tuple, as I later found out):</p>
  
  <pre><code>@SuppressWarnings("unchecked")
  final List&lt;Object[]&gt; data =
                      em.createQuery("SELECT p.id AS i, p.membership AS m FROM Player p WHERE p.id IN :ids")
                      .setParameter("ids", ids)
                      .getResultList();
  </code></pre>
  
  <p>But is there a solution that doesn't require unchecked code?</p>