I am trying to execute the following query in my DAO.
@Query("SELECT * FROM objects WHERE obj_id IN :ids")
List<Object> queryObjects(List<String> ids);
This gives me a compile time error:
Error: no viable alternative at input 'SELECT * FROM objects WHERE obj_id IN :ids'
Both List<String> ids
, as well String... ids
, and Sring[] ids
do not work. However, since I do not know how many identifiers I will have at compile time, and therefore I need a list / array, not varargs.
How can I make this SQL query work?
source
share