-
Book Overview & Buying
-
Table Of Contents
jOOQ Masterclass
By :
By simple fetching/mapping, we refer to the jOOQ fetching techniques that you learned earlier in this book (for instance, the ubiquitous into() methods) but also to the new jOOQ utility, org.jooq.Records. This utility is available from jOOQ 3.15 onward, and it contains two types of utility methods, as we will discuss next.
The collector methods are named intoFoo(), and their goal is to create a collector (java.util.stream.Collector) for collecting records (org.jooq.Record[N]) into arrays, lists, maps, groups, and more. These collectors can be used in ResultQuery.collect() as any other collector. ResultQuery<R> implements Iterable<R> and comes with convenience methods such as collect() on top of it. Besides the fact that collect() handles resources internally (there is no need to use try-with-resources), you can use it for any collectors such as standard JDK collectors, jOOλ collectors, Records collectors, or your own...