Chapter 8: Fetching and Mapping
Fetching result sets and mapping them in the shape and format expected by the client is one of the most important tasks of querying a database. jOOQ excels in this area and provides a comprehensive API for fetching data and mapping it to scalars, arrays, lists, sets, maps, POJO, Java 16 records, JSON, XML, nested collections, and more. As usual, the jOOQ API hides the friction and challenges raised by different database dialects along with the boilerplate code necessary to map the result set to different data structures. In this context, our agenda covers the following topics:
- Simple fetching/mapping
- Fetching one record, a single record, or any record
- Fetching arrays, lists, sets, and maps
- Fetching groups
- Fetching via JDBC
ResultSet
- Fetching multiple result sets
- Fetching relationships
- Hooking POJOs
- jOOQ record mapper
- The mighty SQL/JSON and SQL/XML support
- Nested collections via the astonishing
MULTISET...