In oracle 12c we can use fetch first
clause to select first n rows of a table.
Is there equivalent clause in hibernate to Oracle 12c's fetch first ...
clause?
example of fetch first
:
select *
from tbl_order t
order by t.orderDate desc
fetch first 1 rows only;
Note that i don't want to use rownum
clause.
I want a solution in HQL
itself not in hibernate methods like setMaxResults()
.