Not sure whether there are other posts in the forums on this topic ("in", not surprisingly, appears to be a stop-word in the forum search), but anyway, here's my issue: I've got HQL something like this:
from ...item
where item.visibility in ?
--where visibility is a String. I want the SQL to work out to:
...from item
where item.visibility in ('A', 'B', 'C')
But I can't find an example of what object type my parameter should be. When I found that passing a string such as "A, B, C" or "'A', 'B', 'C'" wouldn't work, it was suggested to me that I should be passing a String[] or a Collection implementation such as an ArrayList, but neither of those has worked either. Is it that I need parens around the questionmark? I didn't think HQL was quite so finicky, but I'm at a loss to find a single example of usage as above.
Can anybody help with an example? Thanks.
|