title: row_number() over partition in hql
body: <p>What is the equivalent of row_number() over partition in hql
  I have the following query in hql:</p>
  
  <pre class="lang-sql prettyprint-override"><code>select s.Companyname, p.Productname, sum(od.Unitprice * od.Quantity - od.Discount) as SalesAmount FROM OrderDetails as od inner join od.Orders as o inner join od.Products as p " +
                                                                "inner join p.Suppliers as s" +
                                                        " where o.Orderdate between '2010/01/01' and '2014/01/01' GROUP BY s.Companyname,p.Productname"
  </code></pre>
  
  <p>I want to do partition by <code>s.Companyname</code> where <code>RowNumber &lt;= n</code>.</p>