I was running
new Update(Table.class).set("columnName = ?", false);
new Select().from(Table.class).where("columnName = ?", false);
The select returns 0 results. The issue is that Where actually looks at the parameter type and converts it correctly, whereas Set simply runs .toString() on all arguments, which results in booleans being stored in the db as true and false instead of 1 and 0.
This is from Set.java:
public String[] getArguments() {
final int setSize = mSetArguments.size();
final int whereSize = mWhereArguments.size();
final String[] args = new String[setSize + whereSize];
for (int i = 0; i < setSize; i++) {
args[i] = mSetArguments.get(i).toString();
}
for (int i = 0; i < whereSize; i++) {
args[i + setSize] = mWhereArguments.get(i).toString();
}
return args;
}
This is from From.java:
void addArguments(Object[] args) {
for(Object arg : args) {
if (arg.getClass() == boolean.class || arg.getClass() == Boolean.class) {
arg = (arg.equals(true) ? 1 : 0);
}
mArguments.add(arg);
}
}
Set needs to handle booleans like Where, otherwise you end up with a table that looks like this:

I was running
The select returns 0 results. The issue is that
Whereactually looks at the parameter type and converts it correctly, whereasSetsimply runs.toString()on all arguments, which results in booleans being stored in the db astrueandfalseinstead of1and0.This is from Set.java:
This is from From.java:
Setneeds to handle booleans likeWhere, otherwise you end up with a table that looks like this: