hi,
sorry, I was a bit unclear in my original question - yes I know you can do like your example.
But I was thinking of something like this:
Code:
String[] statuses = {"A", "B", "C"};
List result = session.find("from X x where x.status in (?)", statuses, Hibernate....);
Because I didn't want to hardcode the number of statuses that are looked for.
I know you can do this like this:
Code:
Query query = session.createQuery("from X x where x.status in (:statuses)");
query.setParameterList("statuses", statuses);
List result = query.list();
So I was wondering if this is somehow possible without creating a Query object.
But I think it is not because now I looked at the debug log from the Query it seems that it creates an HQL statement using three parameters inside IN clause.
best regards,
erik