Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle where in limitation to 1000 / hibernate

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?

like image 811
paweloque Avatar asked Nov 04 '09 12:11

paweloque


1 Answers

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.

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.

like image 65
Tendayi Mawushe Avatar answered Sep 20 '22 11:09

Tendayi Mawushe