As you mentioned because you are supplying a collection (ArrayList) to a single ?
Astyanax throws an exception. I think you need to add a ?
for each element you want to have inside the IN
clause.
Say you want to have 2 ints stored in an ArrayList called arrayListObj the where clause, your statement looks like this:
SELECT & FROM users WHERE somevalue IN (arrayListObj);
Because you are suppling a collection, this cant work, so you will need multiple ?
's. I.e. you want :
SELECT name, occupation FROM users WHERE userid IN (arrayListObj.get(0), arrayListObj.get(1));
I couldn't find anything on the Astyanax wiki about using the IN
clause with prepared statements.