I like to have a query like this:
select data from table
where (x > 1 and x < 100)
or (x > 250 and x < 300)
In ORMlite, th
Do you understand what the ...
part of the declaration means? It means that you can pass in an array (and that the compiler will construct an array for you if you just specify values).
So just create a list if you want, then convert it to an array (for all but the first condition) and then call the method. You may well want to make a static method to do the last part easily:
public static void or(Where target,
List> conditions)
{
// TODO: Argument validation
Where first = conditions.get(0);
Where second = conditions.get(1);
List> rest = conditions.subList(2, conditions.size());
// You'll to suppress a warning here due to generics...
Where[] restArray = rest.toArray(new Where[0]);
target.where(first, second, restArray);
}