I have a requirement where the SQL should look like
Select * from EMPTABLE where UpperCase(EMP_NAME) in ('TOM','DICK',HARRY')
in this SQL :
I am trying to retrieve rows by converting the EMP_NAME column to uppercase ( or for that matter I can convert it to lowercase and put the condition in lower case ), and putting the 'in' clause ( a pool of values )
How do I do this in hibernate using criteria API:
EMPTABLE o;
1 Using Example
Example.create(o).IgnoreCase() - I cannot provide a pool of values
2 Using Expression
String[] s={'TOM','DICK','HARRY'};
Expression.in("EMP_NAME", s) - I cannot provide Case-insensitive
Any tips and tricks to this ?
Thanks
|