use of org.jooq.impl.DefaultConfiguration in project SimpleFlatMapper by arnaudroger.
the class JooqMapperTest method testMapperDbObject.
@Test
public void testMapperDbObject() throws Exception {
Connection conn = DbHelper.objectDb();
DSLContext dsl = DSL.using(new DefaultConfiguration().set(conn).set(SQLDialect.HSQLDB).set(new SfmRecordMapperProvider()));
List<DbObject> list = dsl.select().from("TEST_DB_OBJECT").fetchInto(DbObject.class);
assertEquals(2, list.size());
DbHelper.assertDbObjectMapping(list.get(0));
}
use of org.jooq.impl.DefaultConfiguration in project SimpleFlatMapper by arnaudroger.
the class JooqMapperTest method testIgnoreFields.
@Test
public void testIgnoreFields() throws Exception {
Connection conn = DbHelper.objectDb();
DSLContext dsl = DSL.using(new DefaultConfiguration().set(conn).set(SQLDialect.HSQLDB).set(SfmRecordMapperProviderFactory.newInstance().addAlias("id", "noId").ignorePropertyNotFound().newProvider()));
List<DbObject> list = dsl.select().from("TEST_DB_OBJECT").fetchInto(DbObject.class);
assertEquals(2, list.size());
assertEquals(0, list.get(0).getId());
list.get(0).setId(1);
DbHelper.assertDbObjectMapping(list.get(0));
}
use of org.jooq.impl.DefaultConfiguration in project mapping-benchmark by arnaudroger.
the class JooqMapperBenchmark method init.
@Setup
public void init() throws Exception {
ConnectionParam cp = new ConnectionParam();
cp.db = db;
cp.init();
dsl = DSL.using(new DefaultConfiguration().set(cp.dataSource).set(getSqlDialect(db)));
select4 = dsl.selectFrom(TestSmallBenchmarkObject.TEST_SMALL_BENCHMARK_OBJECT);
select16 = dsl.selectFrom(TestBenchmarkObject_16.TEST_BENCHMARK_OBJECT_16);
}
use of org.jooq.impl.DefaultConfiguration in project mapping-benchmark by arnaudroger.
the class JooqSfmBenchmark method init.
@Setup
public void init() throws Exception {
ConnectionParam cp = new ConnectionParam();
cp.db = db;
cp.init();
dsl = DSL.using(new DefaultConfiguration().set(cp.dataSource).set(JooqMapperBenchmark.getSqlDialect(db)).set(new SfmRecordMapperProvider()));
select4 = dsl.selectFrom(TestSmallBenchmarkObject.TEST_SMALL_BENCHMARK_OBJECT);
select16 = dsl.selectFrom(TestBenchmarkObject_16.TEST_BENCHMARK_OBJECT_16);
}
use of org.jooq.impl.DefaultConfiguration in project mapping-benchmark by arnaudroger.
the class JooqRecordBenchmark method init.
@Setup
public void init() throws Exception {
ConnectionParam cp = new ConnectionParam();
cp.db = db;
cp.init();
dsl = DSL.using(new DefaultConfiguration().set(cp.dataSource).set(JooqMapperBenchmark.getSqlDialect(db)));
select4 = dsl.selectFrom(TestSmallBenchmarkObject.TEST_SMALL_BENCHMARK_OBJECT);
select16 = dsl.selectFrom(TestBenchmarkObject_16.TEST_BENCHMARK_OBJECT_16);
}
Aggregations