Hi,
I have an HQL query that has a list of tuples in the where clause:
Code:
SELECT id FROM table t WHERE (t.col1, t.col2) in (('val1', 'val2'), ('val3', 'val4'), ('val5', 'val6'))
Now, I want to pass the values from the
in part as parameters, so that the query would look something like this:
Code:
SELECT id FROM table t WHERE (t.col1, t.col2) in (:paramList)
How do I set the paramter list so that hibernate generates the correct SQL? I have tried
query.setParameterList('paramList', array) with a two-dimensional array containing the values. But that did not work out. Hibernate just creates a flat list of parameters and the database consequently complains about a mismatch between operand and operator.
Is there a type for a tuple maybe? So that I could create a list of tuples and pass that to the setParameterList() method?