Top Description Methods
org.jooq

public Interface Schema

extends Named
Known Direct Implementers
org.jooq.impl.LazySchema, org.jooq.impl.SchemaImpl
Imports
java.util.List, java.util.stream.Stream, org.jooq.impl.DSL, org.jetbrains.annotations.NotNull, .Nullable

A schema.

Standard SQL object identifiers come in 3 parts: [catalog].[schema].[object]. The schema is an object that groups a set of objects, where objects can be Table, Sequence, Routine and many other types of objects.

If your RDBMS supports schemas, and jOOQ supports using schemas with your RDBMS, then generated schemas references can be used to qualify objects

Example:


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

using(configuration)
   .select(SCHEMA.ACTOR.FIRST_NAME, SCHEMA.ACTOR.LAST_NAME)
   .from(SCHEMA.ACTOR)
   .fetch();

Compatibility:

Database products like SQLDialect#MYSQL and related dialects, such as SQLDialect#MARIADB use catalogs ("databases") instead of schemas, and lack schema support. For historic reasons, jOOQ treats MySQL catalogs as schemas and does not support any catalog qualifier in MySQL.

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

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public @NotNull Stream<Domain<?>>
domainStream()

Stream all domains contained in this schema.

public @NotNull Stream<ForeignKey<?, ?>>
foreignKeyStream()

Stream all foreign keys contained in this schema.

public @Nullable Catalog
getCatalog()

The catalog of this schema.

public @Nullable Domain<?>
getDomain(String name)

Get a domain by its name (case-sensitive) in this schema, or null if no such domain exists.

public @Nullable Domain<?>
getDomain(Name name)

Get a domain by its qualified or unqualified name in this schema, or null if no such domain exists.

public @NotNull List<Domain<?>>
getDomains()

List all domains contained in this schema.

public @NotNull List<ForeignKey<?, ?>>
getForeignKeys()

List all foreign keys contained in this schema.

public @NotNull List<ForeignKey<?, ?>>
getForeignKeys(String name)

Get foreign keys by their name (case-sensitive) in this schema.

public @NotNull List<ForeignKey<?, ?>>
getForeignKeys(Name name)

Get foreign keys by their qualified or unqualified name in this schema.

public @NotNull List<Index>
getIndexes()

List all indexes contained in this schema.

public @NotNull List<Index>
getIndexes(String name)

Get indexes by their name (case-sensitive) in this schema.

public @NotNull List<Index>
getIndexes(Name name)

Get indexes by their qualified or unqualified name in this schema.

public @NotNull List<UniqueKey<?>>
getPrimaryKeys()

List all primary keys contained in this schema.

public @NotNull List<UniqueKey<?>>
getPrimaryKeys(String name)

Get primary keys by their name (case-sensitive) in this schema.

public @NotNull List<UniqueKey<?>>
getPrimaryKeys(Name name)

Get primary keys by their qualified or unqualified name in this schema.

public @Nullable Sequence<?>
getSequence(String name)

Get a sequence by its name (case-sensitive) in this schema, or null if no such sequence exists.

public @Nullable Sequence<?>
getSequence(Name name)

Get a sequence by its qualified or unqualified name in this schema, or null if no such sequence exists.

public @NotNull List<Sequence<?>>
getSequences()

List all sequences contained in this schema.

public @Nullable Table<?>
getTable(String name)

Get a table by its name (case-sensitive) in this schema, or null if no such table exists.

public @Nullable Table<?>
getTable(Name name)

Get a table by its qualified or unqualified name in this schema, or null if no such table exists.

public @NotNull List<Table<?>>
getTables()

List all tables contained in this schema.

public @Nullable UDT<?>
getUDT(String name)

Get a UDT by its name (case-sensitive) in this schema, or null if no such UDT exists.

public @Nullable UDT<?>
getUDT(Name name)

Get a UDT by its qualified or unqualified name in this schema, or null if no such UDT exists.

public @NotNull List<UDT<?>>
getUDTs()

List all UDTs contained in this schema.

public @NotNull List<UniqueKey<?>>
getUniqueKeys()

List all unique keys (including primary keys) contained in this schema.

public @NotNull List<UniqueKey<?>>
getUniqueKeys(String name)

Get unique keys (including primary keys) by their name (case-sensitive) in this schema.

public @NotNull List<UniqueKey<?>>
getUniqueKeys(Name name)

Get unique keys (including primary keys) by their qualified or unqualified name in this schema.

public @NotNull Stream<Index>
indexStream()

Stream all indexes contained in this schema.

public @NotNull Stream<UniqueKey<?>>
primaryKeyStream()

Stream all primary keys contained in this schema.

public @NotNull Stream<Sequence<?>>
sequenceStream()

Stream all sequences contained in this schema.

public @NotNull Stream<Table<?>>
tableStream()

Stream all tables contained in this schema.

public @NotNull Stream<UDT<?>>
udtStream()

Stream all UDTs contained in this schema.

public @NotNull Stream<UniqueKey<?>>
uniqueKeyStream()

Stream all unique keys (including primary keys) contained in this schema.

Inherited from org.jooq.Named:
$namegetCommentgetCommentPartgetNamegetQualifiedNamegetUnqualifiedName

Method Detail

domainStreamback to summary
public @NotNull Stream<Domain<?>> domainStream()

Stream all domains contained in this schema.

Annotations
@NotNull
foreignKeyStreamback to summary
public @NotNull Stream<ForeignKey<?, ?>> foreignKeyStream()

Stream all foreign keys contained in this schema.

Annotations
@NotNull
getCatalogback to summary
public @Nullable Catalog getCatalog()

The catalog of this schema.

Annotations
@Nullable
getDomainback to summary
public @Nullable Domain<?> getDomain(String name)

Get a domain by its name (case-sensitive) in this schema, or null if no such domain exists.

Annotations
@Nullable
getDomainback to summary
public @Nullable Domain<?> getDomain(Name name)

Get a domain by its qualified or unqualified name in this schema, or null if no such domain exists.

Annotations
@Nullable
getDomainsback to summary
public @NotNull List<Domain<?>> getDomains()

List all domains contained in this schema.

Annotations
@NotNull
getForeignKeysback to summary
public @NotNull List<ForeignKey<?, ?>> getForeignKeys()

List all foreign keys contained in this schema.

Annotations
@NotNull
getForeignKeysback to summary
public @NotNull List<ForeignKey<?, ?>> getForeignKeys(String name)

Get foreign keys by their name (case-sensitive) in this schema.

Annotations
@NotNull
getForeignKeysback to summary
public @NotNull List<ForeignKey<?, ?>> getForeignKeys(Name name)

Get foreign keys by their qualified or unqualified name in this schema.

Annotations
@NotNull
getIndexesback to summary
public @NotNull List<Index> getIndexes()

List all indexes contained in this schema.

Annotations
@NotNull
getIndexesback to summary
public @NotNull List<Index> getIndexes(String name)

Get indexes by their name (case-sensitive) in this schema.

Annotations
@NotNull
getIndexesback to summary
public @NotNull List<Index> getIndexes(Name name)

Get indexes by their qualified or unqualified name in this schema.

Annotations
@NotNull
getPrimaryKeysback to summary
public @NotNull List<UniqueKey<?>> getPrimaryKeys()

List all primary keys contained in this schema.

Annotations
@NotNull
getPrimaryKeysback to summary
public @NotNull List<UniqueKey<?>> getPrimaryKeys(String name)

Get primary keys by their name (case-sensitive) in this schema.

Annotations
@NotNull
getPrimaryKeysback to summary
public @NotNull List<UniqueKey<?>> getPrimaryKeys(Name name)

Get primary keys by their qualified or unqualified name in this schema.

Annotations
@NotNull
getSequenceback to summary
public @Nullable Sequence<?> getSequence(String name)

Get a sequence by its name (case-sensitive) in this schema, or null if no such sequence exists.

Annotations
@Nullable
getSequenceback to summary
public @Nullable Sequence<?> getSequence(Name name)

Get a sequence by its qualified or unqualified name in this schema, or null if no such sequence exists.

Annotations
@Nullable
getSequencesback to summary
public @NotNull List<Sequence<?>> getSequences()

List all sequences contained in this schema.

Annotations
@NotNull
getTableback to summary
public @Nullable Table<?> getTable(String name)

Get a table by its name (case-sensitive) in this schema, or null if no such table exists.

Annotations
@Nullable
getTableback to summary
public @Nullable Table<?> getTable(Name name)

Get a table by its qualified or unqualified name in this schema, or null if no such table exists.

Annotations
@Nullable
getTablesback to summary
public @NotNull List<Table<?>> getTables()

List all tables contained in this schema.

Annotations
@NotNull
getUDTback to summary
public @Nullable UDT<?> getUDT(String name)

Get a UDT by its name (case-sensitive) in this schema, or null if no such UDT exists.

Annotations
@Nullable
getUDTback to summary
public @Nullable UDT<?> getUDT(Name name)

Get a UDT by its qualified or unqualified name in this schema, or null if no such UDT exists.

Annotations
@Nullable
getUDTsback to summary
public @NotNull List<UDT<?>> getUDTs()

List all UDTs contained in this schema.

Annotations
@NotNull
getUniqueKeysback to summary
public @NotNull List<UniqueKey<?>> getUniqueKeys()

List all unique keys (including primary keys) contained in this schema.

Annotations
@NotNull
getUniqueKeysback to summary
public @NotNull List<UniqueKey<?>> getUniqueKeys(String name)

Get unique keys (including primary keys) by their name (case-sensitive) in this schema.

Annotations
@NotNull
getUniqueKeysback to summary
public @NotNull List<UniqueKey<?>> getUniqueKeys(Name name)

Get unique keys (including primary keys) by their qualified or unqualified name in this schema.

Annotations
@NotNull
indexStreamback to summary
public @NotNull Stream<Index> indexStream()

Stream all indexes contained in this schema.

Annotations
@NotNull
primaryKeyStreamback to summary
public @NotNull Stream<UniqueKey<?>> primaryKeyStream()

Stream all primary keys contained in this schema.

Annotations
@NotNull
sequenceStreamback to summary
public @NotNull Stream<Sequence<?>> sequenceStream()

Stream all sequences contained in this schema.

Annotations
@NotNull
tableStreamback to summary
public @NotNull Stream<Table<?>> tableStream()

Stream all tables contained in this schema.

Annotations
@NotNull
udtStreamback to summary
public @NotNull Stream<UDT<?>> udtStream()

Stream all UDTs contained in this schema.

Annotations
@NotNull
uniqueKeyStreamback to summary
public @NotNull Stream<UniqueKey<?>> uniqueKeyStream()

Stream all unique keys (including primary keys) contained in this schema.

Annotations
@NotNull