HQL - row identifier for pagination
- by anna.ruk
Does anyone know if HQL has a keyword to identify rows such as ROWID or ROWNUM?
I would like to implement pagination with HQL but I am not able to use .setMaxResult() or .setFirstResult() because I don't work with the session object directly and therefore don't use the Query object but simply create my query as a string and use the .find() method.
I tried using LIMIT and OFFSET in my query, but HQL seems to be ignoring these keywords and is returning the whole result to me no matter what.
I'm also not able to use Hibernate criteria because it does not have support for the "HAVING" clause that appears in my query.
My last resort is to restrict the result set using the ROWNUM/ROWID keyword. Does anyone else have any other suggestions?