In some SQL variants (notably Oracle), the number of parameters one can pass to an IN
statement is limited. I.e. the following wouldn't work;
select * from molecules where id in (atom_1, atom_2, atom_3, ... atom_785534);
Multiple solutions have been suggested, including using a temporary table or split the parameters into smaller groups.
What is the optimal solution for an ORM, specifically Hibernate 5+? As far as I can tell, it's not possible to create a temporary table with Hibernate and looping through chunks is not ideal, particularly when you may have multiple lists of paramaters that run the risk of overflowing the limit.