Possible Duplicate:
How do you do a limit query in HQL
I am new to HQL. I have following working HQL query:
from Order as o where o.account.profile.userId='abc' order by o.orderID desc
This query returns me list of orders placed by user abc . User can have 0 to 5000+ orders placed in DB. But I want to display only First 5 records(Orders). I am using sublist function of java List.
Can I directly fetch only first 5 records using HQL query? which is more efficient way to write this query?