This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Generated global artefacts
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
For increased convenience at the use-site, jOOQ generates "global" artefacts at the code generation root location, referencing tables, routines, sequences, etc. In detail, these global artefacts include the following:
Keys.java: This file contains all of the required primary key, unique key, foreign key and identity references in the form of static members of type
Routines.java: This file contains all standalone routines (not in packages) in the form of static factory methods for
Sequences.java: This file contains all sequence objects in the form of static members of type
Tables.java: This file contains all table objects in the form of static member references to the actual singleton
UDTs.java: This file contains all UDT objects in the form of static member references to the actual singleton
When referencing global artefacts from your client application, you would typically static import them as such:
// Static imports for all global artefacts (if they exist) import static com.example.generated.Keys.*; import static com.example.generated.Routines.*; import static com.example.generated.Sequences.*; import static com.example.generated.Tables.*; // You could then reference your artefacts as follows: create.insertInto(MY_TABLE) .values(MY_SEQUENCE.nextval(), myFunction()) // as a more concise form of this: create.insertInto(com.example.generated.Tables.MY_TABLE) .values(com.example.generated.Sequences.MY_SEQUENCE.nextval(), com.example.generated.Routines.myFunction())
The generation of these artefacts can be turned off. For details, see the relevant section in the manual.