@Override
public void afterPropertiesSet() throws Exception {
setRowMapper(new RowMapper<Tuple>() {
@Override
public Tuple mapRow(ResultSet rs, int rowNum) throws SQLException {
TupleBuilder builder = TupleBuilder.tuple();
for (int i=1; i <= rs.getMetaData().getColumnCount(); i++) {
String name = JdbcUtils.lookupColumnName(rs.getMetaData(), i);
builder.put(name, JdbcUtils.getResultSetValue(rs, i, String.class));
}
return builder.build();
}
});
super.afterPropertiesSet();
}