Am Donnerstag, 5. Juli 2012 18:03:55 UTC+2 schrieb Lukas Eder:
// isNull could also translate to type == null && value == null, though
>
StatementSetter setter = lookup(type, dialect, isNull);
>
Why not
setter = dialect.getSetter(type)?
if( isNull ) {
setter.setNull(stmt, nextIndex());
} else {
setter.set(stmt, nextIndex(), value);
}
> setter.set(stmt, nextIndex(), value);
>
> So I think in this case, a bit of imperative programming with lots of
> comments beats OO design.
>
Why don't you compile the JDBC type (an int) into the generated fields?
That would replace the if() forest with either a switch or an array lookup.