Reader small image

You're reading from  jOOQ Masterclass

Product typeBook
Published inAug 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800566897
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Anghel Leonard
Anghel Leonard
author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard

Right arrow

Altering the jOOQ code generation process

We already know that jOOQ comes with three Code Generators (for Java, Scala, and Kotlin). For Java, we use org.jooq.codegen.JavaGenerator, which can be shaped/customized declaratively (or, programmatically) via a comprehensive set of configurations grouped under <configuration> (Maven), configurations (Gradle), or org.jooq.meta.jaxb.Configuration. But, sometimes, we need more control, or in other words, we need a custom generator implementation.

Implementing a custom generator

Imagine a scenario where we need a query method and it would be very handy if it was provided by the built-in jOOQ DAO. Obviously, the jOOQ goal is to maintain a thin DAO layer that avoids a large number of methods caused by different types of query combinations (don't expect to see in the default DAO a query method such as fetchByField1AndField2() since trying to cover all combinations of fields (even for only two fields) leads to a heavy DAO layer that...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
jOOQ Masterclass
Published in: Aug 2022Publisher: PacktISBN-13: 9781800566897

Author (1)

author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard