title: JPA - single query with multiple new objects
body: <p>Is it possible to initialize multiple objects in a single query? I'm trying to introduce mapping of multiple attributes to corresponding DTOs, but am getting syntax error. The query is as follows:</p>
  <pre><code>em.createQuery(&quot;SELECT &quot;
                                        + &quot;new com.x.y.z(fte.attr1 &quot;
                                        + &quot;fte.attr2, fte.attr3),&quot;
  
                                        + &quot;new com.x.y.a(fet.attr4, fet.attr5,&quot;
                                        + &quot;fet.attr6, fet.attr7, fet.attr8, fet.attr9), &quot;
  
                                        + &quot;new com.x.y.b(fte.attr10,&quot;
                                        + &quot; fte.attr11, fte.attr12, fte.attr13, fte.attr14), &quot;
  
                                        + &quot;new com.x.y.c(fte.attr15, &quot;
                                        + &quot;fte.attr16, v.attr17, v.attr18) &quot;
  
                                        + &quot;FROM Table1 fte &quot;
                                        + &quot;LEFT JOIN Table2fet ON fte.attr1= fet.attr1 AND fte.attr1= fet.attr1&quot;
                                        + &quot;LEFT JOIN Table3 v ON v.attr1= fte.attr1&quot;
                                        + &quot;WHERE fte.attr1= :attr1 AND fte.attr1= :attr1&quot;,
                                Object[].class)
                  .getResultStream()
  </code></pre>
  <p>however the JPA indicates a problem org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: , near line 1, column 115 which is resolved into <code>new com.x.y.a</code> location</p>