Share jOOQ on Facebook
Share jOOQ on Twitter

All versions: 3.10 | 3.9 | 3.8 | 3.7 | 3.6 | 3.5 | 3.4 | 3.3 | Development versions: 3.11 | Unsupported versions: 3.2 | 3.1 | 3.0 | 2.6

Every table in your database will generate a org.jooq.Table implementation that looks like this:

public class Book extends TableImpl<BookRecord> {

    // The singleton instance
    public static final Book BOOK = new Book();

    // Generated columns
    public final TableField<BookRecord, Integer> ID        = createField("ID",        SQLDataType.INTEGER, this);
    public final TableField<BookRecord, Integer> AUTHOR_ID = createField("AUTHOR_ID", SQLDataType.INTEGER, this);
    public final TableField<BookRecord, String>  ITLE      = createField("TITLE",     SQLDataType.VARCHAR, this);

    // Covariant aliasing method, returning a table of the same type as BOOK
    @Override
    public Book as(java.lang.String alias) {
        return new Book(alias);
    }
    
    // [...]
}

Flags influencing generated tables

These flags from the code generation configuration influence generated tables:

  • recordVersionFields: Relevant methods from super classes are overridden to return the VERSION field
  • recordTimestampFields: Relevant methods from super classes are overridden to return the TIMESTAMP field
  • syntheticPrimaryKeys: This overrides existing primary key information to allow for "custom" primary key column sets
  • overridePrimaryKeys: This overrides existing primary key information to allow for unique key to primary key promotion
  • dateAsTimestamp: This influences all relevant columns
  • unsignedTypes: This influences all relevant columns
  • relations: Relevant methods from super classes are overridden to provide primary key, unique key, foreign key and identity information
  • instanceFields: This flag controls the "static" keyword on table columns, as well as aliasing convenience
  • records: The generated record type is referenced from tables allowing for type-safe single-table record fetching

Flags controlling table generation

Table generation cannot be deactivated

The jOOQ Logo