title: SELECT NEW() with many-to-one collection inside the constructor - HQL
body: <p>I don't seem to find an answer to something that I refuse to accept as &quot;Not Possible&quot; :)</p>
  <p>Here is my HQL query:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT new TestTable(t.id,t.param1,t.param2,t.param3,stps) 
  FROM TestTable t left join t.steps as stps 
  WHERE t.someObj.id IN (:someObjIds)
  </code></pre>
  <p>TestTable has the following constructor:</p>
  <pre class="lang-java prettyprint-override"><code>public TestTable(Integer param1, Integer param2, Date param3, Date param4, Set steps)
  </code></pre>
  <p>I have tried to use Collection in constructor instead of a Set but it didn't work, the constructor will receive only the first item out of the collection as a parameter and not the entire collection as I expected.</p>
  <p>In the query I also tried to use <code>left join fetch t.steps</code>, tried without left join at all, tried to surround the &quot;stps&quot; parameter in the constructor with &quot;elements&quot; like this: <code>elements(stps)</code></p>
  <p>But nothing worked. The reason I'm doing this is because TestTable is very big and has a lot of columns and associations but in this case I want only 4 columns and one collection. When one query can return up to 400,000 objects this becomes necessary.</p>
  <p>Any ideas anyone?</p>