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

Practicing more types of JOINs

Next, let's cover more JOINs, such as Implicit/Self Joins, NATURAL JOIN, STRAIGHT JOIN, Semi/Anti Joins, and LATERAL Joins. Let's continue with Implicit/Self Joins.

Implicit and Self Join

Implicit and Self Joins can be easily expressed in jOOQ via type-safe navigation methods produced by the jOOQ generator in classes that mirror the database tables. Let's dissect this aspect of Implicit Joins.

Implicit Join

As an example, an explicit join that fetches a parent table's column from a given child table can be expressed as an Implicit Join. Here is the explicit join:

SELECT o.office_code, e.first_name, e.last_name
FROM employee AS e
JOIN office AS o ON e.office_code = o.office_code

Here is the less verbose Implicit Join version:

SELECT e.office.office_code, e.first_name, e.last_name
FROM employee AS e

If we check the generated Java-based schema, then we notice that the jooq.generated.tables.Employee class mirroring...

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