Hi, i'm trying to combine the in(..) operator and the upper(..) function with no success.
My starting point is the following HQL query, which works correctly:
Code:
Query q = session.createQuery("from Worker w where w.workType in (:param)");
q.setParameterList("param", new String[] { "Director", "Actor"});
Without transforming to upper case the string array, i would like to combine the in(..) operator with the upper(..) operator, for performing a case insensitive search of "director", "DIRECTOR", "Director", etc... but it doesn't work:
Code:
Query q = session.createQuery("from Worker w where upper(w.workType) in (upper(:param))");
q.setParameterList("param", new String[] { "Director", "Actor"});
The resulting SQL query is not correct, because the in clause is expanded into
Code:
in (upper(?, ?))
Is there a way to modify the HQL query for it to work, without changing the input string array ?
Thanks