title: Want to fetch only 5 records with HQL
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1239723/how-do-you-do-a-limit-query-in-hql">How do you do a limit query in HQL</a>  </p>
  </blockquote>
  
  
  
  <p>I am new to HQL. I have following working HQL query:</p>
  
  <pre><code>from Order as o where o.account.profile.userId='abc' order by o.orderID desc
  </code></pre>
  
  <p>This query returns me list of orders placed by user <strong>abc</strong> . User can have 0 to 5000+ orders placed in DB. But I want to display only <strong>First 5</strong> records(Orders). I am using sublist function of java List.</p>
  
  <p>Can I directly fetch only first 5 records using HQL query? which is more efficient way to write this query?</p>