New versions: Dev (3.14) | Latest (3.13) | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3 | 2.6

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:

  • This file contains all of the required primary key, unique key, foreign key and identity references in the form of static members of type org.jooq.Key.
  • This file contains all standalone routines (not in packages) in the form of static factory methods for org.jooq.Routine types.
  • This file contains all sequence objects in the form of static members of type org.jooq.Sequence.
  • This file contains all table objects in the form of static member references to the actual singleton org.jooq.Table object
  • This file contains all UDT objects in the form of static member references to the actual singleton org.jooq.UDT object

Referencing global artefacts

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:
      .values(MY_SEQUENCE.nextval(), myFunction())
// as a more concise form of this:
      .values(com.example.generated.Sequences.MY_SEQUENCE.nextval(), com.example.generated.Routines.myFunction())

Configuring these artefacts

The generation of these artefacts can be turned off. For details, see the relevant section in the manual.

The jOOQ Logo