org.simpleflatmapper.jooq.JooqRecordMapperWrapper Maven / Gradle / Ivy
package org.simpleflatmapper.jooq;
import org.jooq.Record;
import org.jooq.RecordMapper;
import org.simpleflatmapper.map.SourceMapper;
import org.simpleflatmapper.map.context.MappingContextFactory;
public class JooqRecordMapperWrapper implements RecordMapper {
private final SourceMapper mapper;
private final MappingContextFactory super Record> mappingContextFactory;
public JooqRecordMapperWrapper(SourceMapper mapper, MappingContextFactory super Record> mappingContextFactory) {
this.mapper = mapper;
this.mappingContextFactory = mappingContextFactory;
}
@Override
public E map(R record) {
return mapper.map(record, mappingContextFactory.newContext());
}
public SourceMapper getMapper() {
return mapper;
}
}