oracle限制在1000个/休眠状态 [英] oracle where in limitation to 1000 / hibernate

查看:128
本文介绍了oracle限制在1000个/休眠状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Oracle知道where a in (..)子句中对1000个元素的限制.将Hibernate与Oracle结合使用时,是否也存在此限制?

Oracle knows the limitation to 1000 elements in the where a in (..) clause. Does this limitation also exist when using Hibernate in conjuction with Oracle?

推荐答案

hibernate仍然存在此数据库限制.如果in子句中确实需要1000多个项目,则必须自己在代码中拆分列表,并对每个1000个键块运行查询,然后将结果集附加在一起.

This database limitation still exists with hibernate. If you really need to have more than 1000 items in your in clause you will have to split the list yourself in the code and run the query for each block of 1000 keys, then append the result sets together.

请注意,如果您的查询需要排序或以其他方式汇总查询结果,则此hack会崩溃,因为完整的结果集仅在代码中是已知的.在这种情况下,您最好找到另一种不需要IN子句的查询写方法.

Note this hack breaks down if your query needs to sort or otherwise aggregate the results of the query because the full set of results will only be known in the code. In this case you are better of finding another way to write the query that does not require an IN clause.

这篇关于oracle限制在1000个/休眠状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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