use of org.simpleflatmapper.db.ConnectionParam in project mapping-benchmark by arnaudroger.
the class BatooBenchmark method init.
@Setup
public void init() throws Exception {
ConnectionParam connParam = new ConnectionParam();
connParam.db = db;
connParam.init();
sf = Persistence.createEntityManagerFactory("jpa");
}
use of org.simpleflatmapper.db.ConnectionParam 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);
}
use of org.simpleflatmapper.db.ConnectionParam 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.db.ConnectionParam in project mapping-benchmark by arnaudroger.
the class EclipseLinkBenchmark method main.
public static void main(String[] args) throws Exception {
ConnectionParam connParam = new ConnectionParam();
connParam.db = DbTarget.HSQLDB;
connParam.init();
EntityManagerFactory sf = Persistence.createEntityManagerFactory("jpa");
EntityManager session = sf.createEntityManager();
try {
Query query = session.createQuery("select s from MappedObject4 s");
query.setMaxResults(2);
List<?> sr = query.getResultList();
for (Object o : sr) {
System.out.println(o.toString());
}
} finally {
session.close();
}
}
use of org.simpleflatmapper.db.ConnectionParam in project mapping-benchmark by arnaudroger.
the class MyBatisBenchmark method init.
@Setup
public void init() throws Exception {
ConnectionParam connParam = new ConnectionParam();
connParam.db = db;
connParam.init();
this.sqlSessionFactory = SqlSessionFact.getSqlSessionFactory(connParam);
}
Aggregations