這是what myBATIS has on their own documentation for foreach
。myBATIS foreach命中限制爲1000
<select id="selectPostIn" resultType="domain.blog.Post">
SELECT *
FROM POST P
WHERE ID in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
但是,如果list
包含超過1000個項目,你正在使用Oracle數據庫,你得到這個異常:
java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
我能做些什麼來解決這個問題,以便它可以與超過1000元?
[ora-01795](https://stackoverflow.com/questions/17842453/is-there-a-workaround-for-ora-01795-maximum-number-of-expressions-in-a-list-is )看看這個,可以幫助你。 – BobJiang