[EJBQL CMP2] The JOnAS extension LIMIT clause does not work on the H2 db.
The JOnAS extension LIMIT clause does not work on the H2 db. See the JOnAS conformance test to reproduce the bug : F_EjbqlEC2 testFindCustAllLimit_1
As the H2 db MEDOR mapper does not exist, the used mapper is the hsql adapter. Unfortunatly, the syntax for the LIMIT clause is different for SQL hsql and for H2 sql.
For HSQL, the syntax is : LIMIT n m Creates the result set for the SELECT statement first and then discards the first n rows (OFFSET) and returns the first m rows of the remaining result set (LIMIT). Special cases: LIMIT 0 m is equivalent to TOP m or FIRST m in other RDBMS's; LIMIT n 0 discards the first n rows and returns the rest of the result set.
For H2, the syntax is : LIMIT OFFSET SIMPLE_SIZE rowCountInt LIMIT limits the number of rows returned by the query (no limit if null or smaller than zero). OFFSET specified how many rows to skip. SAMPLE_SIZE limits the number of rows read for aggregate queries.