Hey guys,
Been struggling with this for a whole day now and can't find how to do what seems to be the simpliest thing ever!
I just want a subselect in the select clause, using hibernate criteria.
Code:
select id, result, generatedDate, (select max(sentdate) from energynotification notifications2 where notifications1.result = notifications2.result and status = 's') from notification notifications1 where status = 'p';
So I basically want to find all the pending notifications, and see when the same notification (result) was last sent.
I just have no idea how to do the subselect part of the criteria.
Can anyone help?