Hi,
When i am trying to execute below query , i am getting column present in distinct must be present in order by. But as seen in below query it is working internal in JPQL.
I am trying to execute query in for loop , i had count of below query and i am trying to fetch and process data in chunk wise like 0 to 5000 the 5001 to 10000 depending on how data size.
One observation i found is if below query has output of more than 5000 data then this throws and error if less than 5000 it works, just an observation.
LogicalCondition condition;
dataManager.load(User.class)
.query("SELECT DISTINCT e FROM Cases e " +
" LEFT JOIN UserCase a " +
" ON e.Id = a.Id "
.condition(
condition
).maxResults(0).maxResults(5000).list();
Below order by getting printed in query if check in debug mode
ORDER BY ROW_NUMBER() OVER (ORDER BY (SELECT null)) OFFSET 0 ROWS FETCH NEXT 5000 ROWS ONLY