use of org.simpleflatmapper.beans.MappedObject4 in project mapping-benchmark by arnaudroger.
the class JooqSfmRecordMapperBenchmark method main.
public static void main(String[] args) throws SQLException, NamingException {
ConnectionParam cp = new ConnectionParam();
cp.db = DbTarget.H2;
cp.init();
DSLContext dsl = DSL.using(new DefaultConfiguration().set(cp.dataSource).set(JooqMapperBenchmark.getSqlDialect(cp.db)).set(new SfmRecordMapperProvider()));
SelectOffsetStep<TestSmallBenchmarkObjectRecord> query = dsl.selectFrom(TestSmallBenchmarkObject.TEST_SMALL_BENCHMARK_OBJECT).limit(1);
for (MappedObject4 o : query.fetchInto(MappedObject4.class)) {
System.out.println("o = " + o);
}
for (MappedObject4 o : query.fetchInto(MappedObject4.class)) {
System.out.println("o = " + o);
}
}
use of org.simpleflatmapper.beans.MappedObject4 in project mapping-benchmark by arnaudroger.
the class JdbcManualBenchmark method init.
@Setup
public void init() {
mapper4 = new RowMapper<MappedObject4>() {
@Override
public MappedObject4 map(ResultSet rs) throws Exception {
MappedObject4 o = new MappedObject4();
o.setId(rs.getLong(1));
o.setName(rs.getString(2));
o.setEmail(rs.getString(3));
o.setYearStarted(rs.getInt(4));
return o;
}
};
mapper16 = new RowMapper<MappedObject16>() {
@Override
public MappedObject16 map(ResultSet rs) throws Exception {
MappedObject16 o = new MappedObject16();
o.setId(rs.getLong(1));
o.setName(rs.getString(2));
o.setEmail(rs.getString(3));
o.setYearStarted(rs.getInt(4));
o.setField5(rs.getShort(5));
o.setField6(rs.getInt(6));
o.setField7(rs.getLong(7));
o.setField8(rs.getFloat(8));
o.setField9(rs.getDouble(9));
o.setField10(rs.getShort(10));
o.setField11(rs.getInt(11));
o.setField12(rs.getLong(12));
o.setField13(rs.getFloat(13));
o.setField14(rs.getDouble(14));
o.setField14(rs.getDouble(14));
o.setField15(rs.getInt(15));
o.setField16(rs.getInt(16));
return o;
}
};
}
Aggregations