Why am I getting this?
- Get the SQL query by enable
DEBUGlog level on hibernate (org.hibernate). In my case, it looks like,
SELECT ... FROM table_name fetch first ? rows only;
- Test this query in
SQL developer(or other tools). You will likely get the same error.
In my case, the problem is
featch first ? rows only. This is a feature available to Oracle 12g+.
How can I solve it?
If your database is on a lower version, it should use
ROWNUM to limit the result.
SELECT * FROM (SELECT ... FROM table_name) WHERE ROWNUM <= ?
org.hibernate.dialect.Oracle10gDialect will produce the above query.
How to check the database version?
SELECT version FROM V$INSTANCE; // OR SELECT * FROM V$VERSION