Hello
I have a question about Criteria.add(expression.or
What I am trying to do is to dynamically add OR expression, for example: I have a string array that contains some string values, lets say names, now I want to select * where name=array[i];
I do Criteria cr=somethings;
for(int i;i<length;i++)
cr.add(expression("names",array[i]));
This will translate into name=array[0] AND name=array[1] AND....
How can I do the OR thing. Again I looked at expression.or but I don't know how to use it. The API states that you expression.eq(expression.or("name","smith"),expression.or("name","john"))
Thanks in advance.
|