Available in versions: Dev (3.22)
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.
Glossary
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
This glossary defines the most important terms used throughout the jOOQ manual. Terms are listed in alphabetical order.
API
An API (Application Programming Interface) is the set of types, methods, and contracts that a library exposes to its users. jOOQ's API is mostly made of Java interfaces in the org.jooq package, which client code calls, but usually doesn't implement. Most of jOOQ's API is its query DSL, which is a fluent API.
Client side
The client side is the application that sends SQL statements to an RDBMS, e.g. a Java application running jOOQ, as opposed to the server side. Work done on the client side includes rendering SQL, applying converters, mapping records to DTOs, or computing client side computed columns. Moving work between the client side and the server side can affect correctness, performance, and the number of round trips, e.g. jOOQ's policies implement row level security on the client side, so they don't apply to clients that don't use jOOQ.
Commercial edition
A commercial edition of jOOQ is any edition licensed under the jOOQ License and Maintenance Agreement rather than the Apache Software License 2.0 (see licensing). A commercial edition is required to use jOOQ with at least one commercial RDBMS, and it offers features that aren't available in the Open Source Edition. Commercial editions (including a free trial edition) are distributed through jOOQ's own artifact repository, rather than through Maven Central, using groupIds like org.jooq.pro or org.jooq.trial (see downloading jOOQ).
Database catalog
The database catalog (or data dictionary) is the set of all objects in a database, such as schemas, tables, views, sequences, routines, and types, together with the meta data describing them. It is changed using DDL statements, and can usually be queried through the INFORMATION_SCHEMA or vendor-specific dictionary views, which jOOQ's meta data API and code generator read. Not to be confused with a SQL catalog, which is a namespace containing schemas, and which jOOQ models as a org.jooq.Catalog (see catalog and schema expressions).
Declarative
A declarative language describes the desired result, rather than the steps needed to compute it. SQL is a declarative language: a query only specifies what data to fetch, and the RDBMS decides how to fetch it by choosing an execution plan. Imperative and procedural code, on the other hand, spells out each step. Combining the two paradigms is one of the main challenges that jOOQ addresses (see SQL building).
Driver
A driver is a library, usually provided by the database vendor, which implements the JDBC or R2DBC SPI for a specific RDBMS. It is added as a dependency to an application (and to the code generator's configuration), and jOOQ communicates with the database through it (see JDBC connections and R2DBC connections). Drivers differ in their support for data types, fetch sizes, and other features, and some jOOQ features unwrap native driver implementations to access vendor-specific functionality.
DSL
A DSL (Domain Specific Language) is a language that is specialised for a particular application domain. SQL is an external DSL for querying and manipulating relational data. jOOQ implements SQL as an internal DSL in Java, i.e. as an API that models SQL syntax using Java types and method calls, the entry point of which is the org.jooq.impl.DSL class. See also the DSL API.
DTO
A DTO (Data Transfer Object) is a simple object without behaviour, such as a POJO or a Java record, which carries data between layers of an application. jOOQ can map query results to DTOs, e.g. using fetchInto(Class) or an ad-hoc converter, including nested DTO trees using nested records and MULTISET. Unlike the entities of an ORM, DTOs aren't managed, i.e. changes to them aren't tracked or persisted automatically.
Emulation
An emulation replaces a SQL feature that a SQL dialect doesn't support by equivalent SQL that it does support. jOOQ emulates many features transparently when rendering SQL, e.g. the LIMIT clause using ROW_NUMBER(), row value expression predicates using AND and OR, or MULTISET using SQL/JSON or SQL/XML. The manual's dialect support information indicates whether a feature is supported natively or emulated in a given dialect. Emulations are not always exactly equivalent to the native feature, e.g. with respect to performance, or edge cases.
Execution plan
An execution plan is the strategy an RDBMS chooses to execute a SQL statement, including which indexes to use, as well as the order and algorithms of joins. As SQL is declarative, the optimiser is free to choose any plan that produces the specified result. Many databases cache execution plans per SQL string, which is why bind values and consistently rendered SQL usually improve performance: identical SQL strings can reuse a cached plan (see also static statements vs. prepared statements, and duplicate statements).
Expression tree
jOOQ represents every query as an expression tree, also called an AST (abstract syntax tree) or query object model, made of QueryParts. The fluent API of the query DSL builds this tree, jOOQ renders it to a SQL string for a given dialect (applying any necessary emulations), and the model API lets users traverse and transform it.
External DSL
An external DSL is a language with its own syntax, which is parsed and interpreted independently of any host programming language. SQL is an external DSL. jOOQ can work with SQL as an external DSL using its parser, or using plain SQL templates. Compare with internal DSL.
Fluent API
A fluent API (or fluent interface) is an API designed around method chaining, so that client code reads almost like a sentence. Each method call returns a type that offers the methods that may come next. jOOQ's query DSL is a fluent API, which uses a variety of "step" types (e.g. org.jooq.SelectFromStep) to model the clauses of SQL statements in the order in which they may appear (see also why not to reference those step types in client code).
Internal DSL
An internal DSL (or embedded DSL) is a DSL that is implemented in a host programming language, using only that language's own syntax, such as types and method calls, usually in the form of a fluent API. jOOQ implements SQL, an external DSL, as an internal DSL in Java, much like LINQ implements a query language in C#. This allows the Java compiler to type check queries, but an internal DSL can never model its external counterpart completely (see the rules for mapping SQL onto Java, and plain SQL for how to work around missing syntax).
JDBC
JDBC (Java Database Connectivity) is Java's standard, blocking API for connecting to relational databases, executing SQL statements, and reading their results. Database vendors implement it as an SPI in their JDBC drivers. By default, jOOQ executes queries on top of JDBC, usually through a java.sql.Connection or javax.sql.DataSource supplied to its Configuration. See also jOOQ compared to JDBC, and R2DBC.
LINQ
LINQ (Language Integrated Query) is a query internal DSL that is built into C# and other .NET languages. It is often compared to jOOQ, but it models querying collections in general, rather than SQL specifically, and it inverts SQL's lexical order of clauses (e.g. FROM before SELECT). Other libraries inspired by LINQ are listed in the credits.
Open Source Edition
The jOOQ Open Source Edition is the edition of jOOQ that is licensed under the Apache Software License 2.0 (see licensing). It supports open source RDBMS only, and is distributed through Maven Central with the groupId org.jooq (see downloading jOOQ). Some features are available only in a commercial edition.
Optimiser
The optimiser (or optimizer) is the part of an RDBMS that chooses the execution plan for a statement, based on table statistics, indexes, constraints, and the statement itself. As SQL is declarative, the optimiser is free to choose any plan that produces the specified result. This is why seemingly equivalent queries, the use of inline values instead of bind values, or the existence of constraints can affect performance, and why some dialects support optimiser hints.
ORM
An ORM (Object-Relational Mapper), such as Hibernate or other JPA implementations, maps database tables to a graph of entity objects and manages their state, generating most SQL statements behind the scenes. jOOQ isn't an ORM: it treats SQL as a first-class language rather than hiding it, though it can map query results to objects, offers simple CRUD through updatable records, and can be used alongside an ORM (see jOOQ and JPA).
Procedural language
A procedural language extends SQL with variables, conditional statements, loops, exception handling, and other imperative constructs. It is used to write stored procedures and functions, triggers, and anonymous blocks. Examples include PL/SQL (Oracle), T-SQL (SQL Server, Sybase), PL/pgSQL (PostgreSQL), and SQL/PSM, which is part of the SQL standard. jOOQ supports calling stored procedures, and it offers an API for procedural statements, which helps reduce round trips. Basic anonymous blocks are supported in the Open Source Edition, other procedural logic is a commercial edition feature.
R2DBC
R2DBC (Reactive Relational Database Connectivity) is an SPI for reactive, non-blocking database drivers, based on the Reactive Streams org.reactivestreams.Publisher type. Unlike JDBC, it is meant to be implemented by drivers and used by libraries, rather than by application code directly. jOOQ can execute queries on top of R2DBC using an io.r2dbc.spi.ConnectionFactory (see R2DBC connections), and offers its own reactive API.
RDBMS
An RDBMS (Relational Database Management System) is a database product that stores data in tables, and that is queried using SQL, e.g. PostgreSQL, Oracle, or SQL Server. Each RDBMS implements its own SQL dialect, which deviates from the SQL standard to some extent, and which adds vendor-specific features. An ORDBMS (object-relational DBMS) additionally supports object-oriented features, such as user-defined types. jOOQ usually connects to an RDBMS through JDBC or R2DBC. See also the list of supported RDBMS.
Result set
A result set is the set of rows (and columns) produced by a query. In JDBC, it is consumed through a java.sql.ResultSet. jOOQ fetches result sets eagerly into a org.jooq.Result, or lazily through a org.jooq.Cursor or a java.util.stream.Stream (see lazy fetching), always closing the underlying resources. Some statements, e.g. calls to stored procedures, can produce several result sets, interleaved with update counts.
Round trip
A round trip is a single request from a client to the database server, and its response. Each round trip adds network latency and overhead, so it is often desirable to reduce their number, e.g. by using batching, by fetching nested collections with MULTISET instead of running N+1 queries, or by executing several statements in a single procedural block.
Server side
The server side is the RDBMS that executes SQL statements sent from the client side. Work done on the server side includes evaluating SQL expressions and predicates, running procedural logic and triggers, enforcing constraints, or computing computed columns. Work done on the server side applies to all clients of a database, and it is often more efficient, as data doesn't have to be transferred to the client first.
Session
A session is the server side state associated with a database connection. Depending on the RDBMS, this includes the current catalog or schema (see SET statements), session variables and settings, the contents of temporary tables, cached sequence values, and the current transaction (see transaction management). With connection pools (see Connection vs. DataSource), session state may persist from one use of a connection to the next, unless it is reset. Unlike an ORM's session, jOOQ itself doesn't maintain any session state.
SPI
An SPI (Service Provider Interface) is an API that is meant to be implemented by client code rather than called by it, in order to extend or customise a library's behaviour. Examples of jOOQ SPIs are the org.jooq.ExecuteListener, the org.jooq.ConnectionProvider, or the org.jooq.Converter, most of which are registered with a Configuration.
SQL standard
The SQL standard (ISO/IEC 9075) defines the SQL language independently of any database product. No RDBMS implements all of it, and most add vendor-specific syntax and semantics. jOOQ follows the standard's syntax, naming, and semantics wherever possible (e.g. using the term "degree" rather than "arity"), supports vendor-specific syntax per SQL dialect, and often provides an emulation of features where a dialect lacks them.
Feedback
Do you have any feedback about this page? We'd love to hear it!