当我当前使用Jooq进行查询时,我明确将每个记录对象转换为预期的记录类型。从jooq到特定记录的映射提取/结果
Result<Record> result = sql.select().from(Tables.COUNTRY).fetch();
for (Record r : result) {
CountryRecord countryRecord = (CountryRecord) r;
//Extract data from countryRecord
countryRecord.getId();
}
是它与Jooq,可能对结果投直入所需的记录型?
如(不编译):
Result<CountryRecord> countryRecords = (Result<CountryRecord>) sql.select().from(Tables.COUNTRY).fetch();
for (CountryRecord cr : countryRecords) {
cr.getNamet();
//etc...
}
谢谢,按预期工作。 – aksamit