Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate 5 change not to use fetch first rows only

I'm using Hibernate 5.2 with oracle 11 which does not support fetch first rows only and I need to get back to old style hibernate. is there any hibernate configuration to do that ?

like image 318
Omid P Avatar asked Mar 14 '18 09:03

Omid P


1 Answers

You can force Hibernate to use the Oracle 10g dialect, this way you will get the old limit rule with rownum instead of fetch first.

Looking at the official documentation, you can force the dialect with this property:

hibernate.dialect=org.hibernate.dialect.Oracle10gDialect

Or, if you are using Spring Boot 2 with JPA, you can set this way:

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect

Best regards.

like image 121
Rafael Renan Pacheco Avatar answered Sep 28 '22 10:09

Rafael Renan Pacheco