Hibernate 5 change not to use fetch first rows only

老子叫甜甜 提交于 2020-06-23 06:33:35

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/49273992/hibernate-5-change-not-to-use-fetch-first-rows-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!