JOOQ fetch over foreign keys table
问题 I have three tables: Users Keys UserKeys The UserKeys table has both primary keys from Users and Keys tables to establish the relation between users and keys. How to fetch a User with all it's related keys? What if additional tables exist (for instance UserRoles ), etc. In general, how to fetch a user and all associated rows, related via foreign keys tables? 回答1: Using standard SQL JOIN I'm assuming you're using jOOQ's code generator. You write a join just like you would write a join in SQL: