Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

Implicit JOIN

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

One of HQL's greatest features is the implicit JOIN feature, which is generated from path expressions when you follow foreign key "paths" from child entities to parent entities. The same feature is available in jOOQ as well, if you're using code generation.

In HQL, you might write:

from Book as book
where book.language.cd = 'en'

And in jOOQ, this just translates to:

create.selectFrom(BOOK)
      .where(BOOK.language().CD.eq("en"))
      .fetch();

Some of the jOOQ features used in this section are:

  • implicit joins (these are optional to the task of nesting, but greatly simplify it)
In Hibernate, implicit joins always produce an INNER JOIN, which may be surprising on nullable foreign keys, or on to-many path navigations. jOOQ generates LEFT JOIN by default, though you can override this behaviour with Settings.

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo