#817 - SqlRow getBoolean() does not treat numeric 1 value as true (with MySql and other DB's without native boolean type)

This commit is contained in:
Robin Bygrave
2016-08-29 20:54:49 +12:00
parent d1e2176a5a
commit 59670d0303
3 changed files with 56 additions and 0 deletions
@@ -150,6 +150,9 @@ public final class BasicTypeConverter implements Serializable {
if (value instanceof Boolean) {
return (Boolean) value;
}
if (value instanceof Number) {
return ((Number)value).intValue() == 1;
}
String s = value.toString();
return s.equalsIgnoreCase(dbTrueValue);
}