Module org.jooq
Package org.jooq

Interface Table<R extends Record>

Type Parameters:
R - The record type associated with this table
All Superinterfaces:
Fields, GroupField, Named, Qualified, QueryPart, RecordQualifier<R>, SelectField<R>, SelectFieldOrAsterisk, Serializable, TableLike<R>, Typed<R>
All Known Subinterfaces:
CommonTableExpression<R>, JSONTableColumnPathStep, JSONTableColumnsStep, QOM.DataChangeDeltaTable<R>, QOM.DerivedTable<R>, QOM.Dual, QOM.GenerateSeries<T>, QOM.Lateral<R>, QOM.LinkedTable<R>, QOM.RowsFrom, QOM.TableAlias<R>, QOM.Values<R>, TableOnConditionStep<R>, TableOptionalOnStep<R>, XMLTableColumnPathStep, XMLTableColumnsStep
All Known Implementing Classes:
CustomTable, TableImpl

public non-sealed interface Table<R extends Record> extends TableLike<R>, RecordQualifier<R>, GroupField, SelectField<R>
A table.

Like Field, a Table is a basic building block of any Query, as they all operate on at least one table. There are many different types of tables, including:

Example:


 // Assuming import static org.jooq.impl.DSL.*;

 using(configuration)
    .select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME)
    .from(ACTOR) // Table reference
    .fetch();
 

Instances can be created using DSL.table(Name) and overloads.

Using table references as field expressions

Table references can be used like Field in queries. This includes:

  • A GroupField is an expression that is used in a Select query's GROUP BY clause.
  • A SelectField is an expression that is used in a Select query's SELECT clause, or in a DML query's RETURNING clause, such as INSERT … RETURNING.

Other types of Table cannot be used this way, even if the type system cannot prevent this.

Author:
Lukas Eder