use of org.simpleflatmapper.jooq.DSLContextProvider in project SimpleFlatMapper by arnaudroger.
the class JooqUnmapperTest method testUnmapping.
@Test
public void testUnmapping() throws Exception {
Connection conn = DbHelper.objectDb();
Configuration cfg = new DefaultConfiguration().set(conn).set(SQLDialect.HSQLDB);
cfg.set(JooqMapperFactory.newInstance().newRecordUnmapperProvider(new DSLContextProvider() {
@Override
public DSLContext provide() {
return DSL.using(cfg);
}
}));
DSLContext dsl = DSL.using(cfg);
Label label = new Label(1, UUID.randomUUID(), "label", false);
LabelsRecord labelsRecord = dsl.newRecord(Labels.LABELS, label);
assertEquals(label.getId(), labelsRecord.getId());
assertEquals(label.getName(), labelsRecord.getName());
assertEquals(label.getUuid(), labelsRecord.getUuid());
assertEquals(label.getObsolete(), labelsRecord.getObsolete());
}
Aggregations