Search in sources :

Example 6 with SfmRecordMapperProvider

use of org.simpleflatmapper.jooq.SfmRecordMapperProvider in project mapping-benchmark by arnaudroger.

the class JooqSfmRecordMapperBenchmark 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);
}
Also used : SfmRecordMapperProvider(org.simpleflatmapper.jooq.SfmRecordMapperProvider) ConnectionParam(org.simpleflatmapper.db.ConnectionParam) DefaultConfiguration(org.jooq.impl.DefaultConfiguration)

Example 7 with SfmRecordMapperProvider

use of org.simpleflatmapper.jooq.SfmRecordMapperProvider 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);
    }
}
Also used : SfmRecordMapperProvider(org.simpleflatmapper.jooq.SfmRecordMapperProvider) TestSmallBenchmarkObjectRecord(org.simpleflatmapper.beans.tables.records.TestSmallBenchmarkObjectRecord) ConnectionParam(org.simpleflatmapper.db.ConnectionParam) DefaultConfiguration(org.jooq.impl.DefaultConfiguration) MappedObject4(org.simpleflatmapper.beans.MappedObject4)

Aggregations

SfmRecordMapperProvider (org.simpleflatmapper.jooq.SfmRecordMapperProvider)7 DefaultConfiguration (org.jooq.impl.DefaultConfiguration)4 Test (org.junit.Test)4 ConnectionParam (org.simpleflatmapper.db.ConnectionParam)3 DbObject (org.simpleflatmapper.test.beans.DbObject)2 Connection (java.sql.Connection)1 Field (org.jooq.Field)1 Record (org.jooq.Record)1 MappedObject4 (org.simpleflatmapper.beans.MappedObject4)1 TestSmallBenchmarkObjectRecord (org.simpleflatmapper.beans.tables.records.TestSmallBenchmarkObjectRecord)1 JooqRecordMapperWrapper (org.simpleflatmapper.jooq.JooqRecordMapperWrapper)1 Issue318Test.createField (org.simpleflatmapper.jooq.test.Issue318Test.createField)1