Hooking jOOQ results (Result) and records (Record)
In the previous chapters, we've mapped the JDBC result set of our queries to POJOs via the jOOQ fetchInto()
method. But, in jOOQ, between the JDBC result set and a well-known List<POJO>
(or other data structure such as an array, map, and set), there is another fundamental layer referenced as Result<Record>
represented from the following two interfaces:
org.jooq.Record
: When we trigger aSELECT
query, we get back a result set that contains a list of columns and the corresponding list of values. Typically, we refer to the content of the result set as records. jOOQ maps each such record to itsRecord
interface. Think ofRecord
as the jOOQ internal representation of records.org.jooq.Result
: The jOOQResult
interface is ajava.util.List
oforg.jooq.Record
. In other words, jOOQ maps each record of the result set to aRecord
and collects this record inResult
. OnceResult<Record>
is complete (the whole...