title: Criteria API - multiselect - Tuple which contains other Tuple/Collection
body: <p>I have following entities:</p>
  
  <pre><code>class Person {
     int id;
     String name;
     List&lt;Address&gt; addresses
  }
  
  class Address {
    int id;
    String city;
  }
  </code></pre>
  
  <p>I try to prepare query (based on Criteria-API) where result (each tuple  in result List) will contain three elements:</p>
  
  <ol>
  <li>persron.id </li>
  <li>person.name </li>
  <li>person.addresses &lt;-- collection with 0 or more elements</li>
  </ol>
  
  <p>(1, "Peter", Collection{2,3}) or 
  (1, "Peter", Tuple{2,3})</p>
  
  <p>I have tried something like this:</p>
  
  <pre><code>EntityManager em;
  CriteriaBuilder qb = em.getCriteriaBuilder();
  
  CriteriaQuery&lt;Tuple&gt; cq = qb.createTupleQuery()
  Root&lt;Person&gt; root = cq.from(Person.class);
  
  ListJoin&lt;PersonalData, Address&gt; join = (ListJoin)root.join("addresses", JoinType.LEFT);
  
  cq.multiselect(root.get("id"), root.get("name"), join.get("id"));
  
  TypedQuery&lt;Tuple&gt; tq = em.createQuery(cq);
  List&lt;Tuple&gt; result = tq.getResultList();
  </code></pre>
  
  <p>But received result is different that expected :(</p>
  
  <p>For model: Person(1, "Peter") </p>
  
  <p>which has two addresses </p>
  
  <p>Address(2, "London");
  Address(3, "Paris");</p>
  
  <p>my result list is something like Cartesian product:</p>
  
  <p>(1, "Peter", 2), (1, "Peter", 3)</p>
  
  <p>Is is possible to receive result which was requested at the beginning of this post?</p>