Share jOOQ on Facebook
Share jOOQ on Twitter

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

While optional, source code generation is one of jOOQ's main assets if you wish to increase developer productivity. jOOQ's code generator takes your database schema and reverse-engineers it into a set of Java classes modelling tables, records, sequences, POJOs, DAOs, stored procedures, user-defined types and many more.

The essential ideas behind source code generation are these:

  • Increased IDE support: Type your Java code directly against your database schema, with all type information available
  • Type-safety: When your database schema changes, your generated code will change as well. Removing columns will lead to compilation errors, which you can detect early.

The following chapters will show how to configure the code generator and how to generate various artefacts.

Table of contents

6.1.
Configuration and setup of the generator
6.2.
Advanced generator configuration
6.2.1.
Logging
6.2.2.
Jdbc
6.2.3.
Generator
6.2.4.
Database, name, and properties
6.2.5.
RegexFlags
6.2.6.
Includes and Excludes
6.2.7.
Include object types
6.2.8.
Record Version and Timestamp Fields
6.2.9.
Synthetic identities
6.2.10.
Synthetic primary keys
6.2.11.
Override primary keys
6.2.12.
Date as timestamp
6.2.13.
Ignore procedure return values (deprecated)
6.2.14.
Unsigned types
6.2.15.
Catalog and schema mapping
6.2.16.
Catalog and schema version providers
6.2.17.
Forced types
6.2.18.
Table valued functions
6.3.
Programmatic generator configuration
6.4.
Custom generator strategies
6.5.
Matcher strategies
6.6.
Custom code sections
6.7.
Generated global artefacts
6.8.
Generated tables
6.9.
Generated records
6.10.
Generated POJOs
6.11.
Generated Interfaces
6.12.
Generated DAOs
6.13.
Generated sequences
6.14.
Generated procedures
6.15.
Generated UDTs
6.16.
Data type rewrites
6.17.
Custom data types and type conversion
6.18.
Custom data type binding
6.19.
Mapping generated catalogs and schemas
6.20.
Code generation for large schemas
6.21.
Code generation and version control
6.22.
JPADatabase: Code generation from entities
6.23.
XMLDatabase: Code generation from XML files
6.24.
XMLGenerator: Generating XML
6.25.
Running the code generator with Maven
6.26.
Running the code generator with Ant
6.27.
Running the code generator with Gradle

The jOOQ User Manual. Multiple Pages : Code generationprevious : next
The jOOQ Logo