Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
jOOQ Masterclass

You're reading from  jOOQ Masterclass

Product type Book
Published in Aug 2022
Publisher Packt
ISBN-13 9781800566897
Pages 764 pages
Edition 1st Edition
Languages
Author (1):
Anghel Leonard Anghel Leonard
Profile icon Anghel Leonard

Table of Contents (26) Chapters

Preface Part 1: jOOQ as a Query Builder, SQL Executor, and Code Generator
Chapter 1: Starting jOOQ and Spring Boot Chapter 2: Customizing the jOOQ Level of Involvement Part 2: jOOQ and Queries
Chapter 3: jOOQ Core Concepts Chapter 4: Building a DAO Layer (Evolving the Generated DAO Layer) Chapter 5: Tackling Different Kinds of SELECT, INSERT, UPDATE, DELETE, and MERGE Chapter 6: Tackling Different Kinds of JOINs Chapter 7: Types, Converters, and Bindings Chapter 8: Fetching and Mapping Part 3: jOOQ and More Queries
Chapter 9: CRUD, Transactions, and Locking Chapter 10: Exporting, Batching, Bulking, and Loading Chapter 11: jOOQ Keys Chapter 12: Pagination and Dynamic Queries Part 4: jOOQ and Advanced SQL
Chapter 13: Exploiting SQL Functions Chapter 14: Derived Tables, CTEs, and Views Chapter 15: Calling and Creating Stored Functions and Procedures Chapter 16: Tackling Aliases and SQL Templating Chapter 17: Multitenancy in jOOQ Part 5: Fine-tuning jOOQ, Logging, and Testing
Chapter 18: jOOQ SPI (Providers and Listeners) Chapter 19: Logging and Testing Other Books You May Enjoy

Fetching groups

The jOOQ fetching groups feature is similar to fetching maps, except that it allows us to fetch a list of records as the value of each key-value pair. There are over 40 flavors of the fetchGroups(), intoGroups(), and intoResultGroup() methods; therefore, take your time to practice (or, at the very least, read about) each of them.

We can distinguish between the fetchGroups(key) and intoGroups(Function keyMapper) methods that allow us to specify the field(s) representing the key, while the value is inferred from the SELECT result as the Result<Record>/List<Record> and fetchGroups(key, value)/intoGroups(Function keyMapper, Function valueMapper) methods in which we specify the field(s) that represents the key and the value, respectively, which could be Result<Record>, List<POJO>, List<scalar>, and more. The Records.intoGroups() method without any arguments is only useful if you have a two-column ResultQuery, and you want to map the first...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}