Problem with DB2 Dialect on AS/400

Description

Take a look at the following two Queries:
#Hibernate generated query with Session.createQuery on SYS_CAT table:
select * from (
select rownumber() over() as row_, syscat0_.SYS_CAT_ID as SYS_CAT_ID
from SYS_CAT syscat0_
) as temp_ where row_ <= 10

#The problem with this is: AS/400-DB2 has a function called
"rrn(table_name)" to fetch the row number, so when I replaced
"rownumber() over()" with "rrn()", it worked without any problems
which is given below:

select * from (
select rrn(syscat0_) as row_, syscat0_.SYS_CAT_ID as SYS_CAT_ID from
SYS_CAT syscat0_
) as temp_ where row_<=10

Does this mean that I will not be able to use Criteria Queries with
Hibernate and wiill have to fall back on jdbc api to be able to
retrieve desired number of rows of records at a time? Please let me know!

Environment

Fedora Core2, Sun jdk 1.5, Tomcat 5.5.7, Hibernate 2.1.6, AS/400-DB2

Assignee

Unassigned

Reporter

sudip shrestha

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Affects versions

Priority

Major
Configure