I have a query like this with pagination support,
select *
from (select distinct field1
from table
where field2 = 'some_value'
and filed3 > 'somevalue'
and field4 in('somevalues')
and field5 is null order by field1)
where ROWNUM <= <page_size> ;
How can i equally represent in hibernate.I don't want to hand construct the query.Instead i want the set the criteria in hibernate which matches the above query.