Hibernate 5更改为不仅使用获取第一行 [英] Hibernate 5 change not to use fetch first rows only

查看:105
本文介绍了Hibernate 5更改为不仅使用获取第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Hibernate 5.2与oracle 11一起使用,它不仅支持获取第一行,我需要回到旧式的hibernate. 是否有任何休眠配置可以做到这一点?

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 ?

推荐答案

您可以强制Hibernate使用Oracle 10g方言,这样,您将获得具有rownum的旧限制规则,而不是先获取.

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

或者,如果您将Spring Boot 2与JPA结合使用,则可以这样设置:

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

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

最诚挚的问候.

这篇关于Hibernate 5更改为不仅使用获取第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆