It seems that I did not find the answer to what I refuse to accept as "Impossible" :)
Here is my HQL query: "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)"
TestTable has the following consturtor: public TestTable (Integer param1, Integer param2, Date param3, Date param4, Set steps)
I tried to use Collection in constructor instead of Set, but it did not work, the constructor will receive only the first element from the collection as a parameter, and not the entire collection, as I expected.
in the request, I also tried to use the left connection fetch t.steps, tried without the left connection at all, tried to surround the "stps" parameter in the constructor with "elements" as follows: elements (stps)
but it didn’t work out ... the reason I am doing this is because TestTable is very large and has many columns and associations, but in this case I want only 4 columns and one collection. when a single request can return up to 400,000 objects, it becomes necessary.
any ideas anyone ??? (by the way, my name is Tomer)
source
share