Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Creating dynamic query for collection of objects with max value field
Hello!
I have collection of processInstanceIds and, I wanna find each
task with max lastUpdateTime by one processInstanceId.
That is I
have some tasks with same processInstanceId, but I need one task by
the processInstanceId with max lastUpdateTime. And I need collection
of tasks by the processInstanceIds.
I
use disjunction (RestrictionsFactoryUtil.disjunction()) for each task
criterion, but I dont know how I can do criterion with
max lastUpdateTime for each task. I found .max() function, but
its Projection and it returns the lastUpdateTime max values. I dont
need it.
Does dynamic query has tools for this query?
Hi ,
Have you checked below post , it might be helpful to you
https://liferay.dev/blogs/-/blogs/visiting-dynamicquery
https://liferay.dev/blogs/-/blogs/revisiting-dynamicquery
Powered by Liferay™