|
After some internet search without finding any answer, I think this functionality doesn't exist in any Hibernate version but can be really useful. The code below will fail with "java.sql.SQLSyntaxErrorException: ORA-00920: opérateur relationnel non valide" when executed on Oracle.
So, it doesn't seem possible to add a where clause to a query that check if a tuple is in a tuple list parameter.
{{ String queryTest = "select customer from CustomerEntity customer where (customer.fistname, customer.lastname) in (:pairsList)";
List<Object[]> values = new ArrayList<>();
values.add(new Object[] {"firstname1", "lastname1"}
); values.add(new Object[] {"firstname2", "lastname2"}
);
Query q = em.createQuery(queryTest);
q.setParameter("pairsList", values);
return q.getResultList();}}
|