brettwooldridge / SansOrm

A "No-ORM" sane SQL ←→ Java object mapping library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BigDecimal -> Double conversion

NicolaIsotta opened this issue · comments

Hello, is there any reason why BigDecimal is not converted to Double if fieldType == Double.class?

else if (columnType == BigDecimal.class) {
if (fieldType == BigInteger.class) {
columnValue = ((BigDecimal) columnValue).toBigInteger();
}
else if (fieldType == Integer.class) {
columnValue = (int) ((BigDecimal) columnValue).longValue();
}
else if (fieldType == Long.class) {
columnValue = ((BigDecimal) columnValue).longValue();
}
}

@NicolaIsotta Seems like an oversight. Pull requests welcome.