I'm joining some tables from jOOQ and I'd like to use a RecordMapper
to parse the result into my pojo AType
.
final List<AType> typeList = dsl.select()
.from(TABLEA)
.join(TABLEB).on(TABLEA.ID.equal(TABLEB.ID))
.fetch()
.map((RecordMapper<Record, AType>) record -> {
//Extract field values from Record
return new AType(....);
});
As I explained in a comment, I would like to know how to convert a Field
object from the Record
into the contained value.
The method you're looking for is Record.getValue(Field)
(or also Record.get(Field)
from jOOQ 3.8 onwards):
.map((RecordMapper<Record, AType>) record -> {
//Extract field values from Record
return new AType(record.getValue(TABLEA.ID), ...);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With