How does work foreign key relations in JOOQ? Let me clarify a bit:
- Main table - A
- Foreign table - B
In code you can call a method to access main table using foreign table B.a().
Let's say I am calling
dsl.select(B.a().ID).from(B).fetchInto(String.class);
Does it use left join inside the box of JOOQ?
Implicit path joins default to using a
LEFT JOINif your foreign key is nullable, andINNER JOINif your foreign key is non-nullable.But you can override this behaviour if you always prefer a
LEFT JOIN, for example: