

Generated Tables


Most of the times, when thinking about a table expression you're probably thinking about an actual table in your database schema. If you're using jOOQ's code generator, you will have all tables from your database schema available to you as type safe Java objects. You can then use these tables in SQL FROM clauses, JOIN clauses or in other SQL statements, just like any other table expression. An example is given here:

FROM AUTHOR -- Table expression AUTHOR
JOIN BOOK   -- Table expression BOOK
      .from(AUTHOR) // Table expression AUTHOR
      .join(BOOK)   // Table expression BOOK

The above example shows how AUTHOR and BOOK tables are joined in a SELECT statement. It also shows how you can access table columns by dereferencing the relevant Java attributes of their tables.

See the manual's section about generated tables for more information about what is really generated by the code generator

The jOOQ Logo