I have an SQL query
select t.id as id, t.color as color from test_data t where t.id = ANY(?1) and t.color=?2
how can I pass an array of values to ANY(?1)
i.e
em.createNamedQuery("Test.getTestData", Tuple.class)
.setParameter(1, arrayOfIds<----___can_I_pass_an_array___?____)
.setParameter(2, yellow)
.unwrap(NativeQuery.class)
.addScalar("id", LongType())
.addScalar("color", new StringType())
I get an error
Caused by: org.postgresql.util.PSQLException: ERROR: op ANY/ALL (array) requires array on right side
Position: 507
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) ~[postgresql-42.2.18.jar!/:42.2.18]