Interface Schema
-
- All Known Implementing Classes:
SchemaImpl
public interface Schema extends Named
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 beTable
,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 asSQLDialect.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Catalog
getCatalog()
The catalog of this schema.Sequence<?>
getSequence(java.lang.String name)
Get a sequence by its name (case-sensitive) in this schema, ornull
if no such sequence exists.java.util.List<Sequence<?>>
getSequences()
List all sequences contained in this schema.Table<?>
getTable(java.lang.String name)
Get a table by its name (case-sensitive) in this schema, ornull
if no such table exists.java.util.List<Table<?>>
getTables()
List all tables contained in this schema.UDT<?>
getUDT(java.lang.String name)
Get a UDT by its name (case-sensitive) in this schema, ornull
if no such UDT exists.java.util.List<UDT<?>>
getUDTs()
List all UDTs contained in this schema.java.util.stream.Stream<Sequence<?>>
sequenceStream()
Stream all sequences contained in this schema.java.util.stream.Stream<Table<?>>
tableStream()
Stream all tables contained in this schema.java.util.stream.Stream<UDT<?>>
udtStream()
Stream all UDTs contained in this schema.-
Methods inherited from interface org.jooq.Named
getComment, getName, getQualifiedName, getUnqualifiedName
-
-
-
-
Method Detail
-
getCatalog
Catalog getCatalog()
The catalog of this schema.
-
tableStream
java.util.stream.Stream<Table<?>> tableStream()
Stream all tables contained in this schema.
-
getTables
java.util.List<Table<?>> getTables()
List all tables contained in this schema.
-
getTable
Table<?> getTable(java.lang.String name)
Get a table by its name (case-sensitive) in this schema, ornull
if no such table exists.
-
udtStream
java.util.stream.Stream<UDT<?>> udtStream()
Stream all UDTs contained in this schema.
-
getUDTs
java.util.List<UDT<?>> getUDTs()
List all UDTs contained in this schema.
-
getUDT
UDT<?> getUDT(java.lang.String name)
Get a UDT by its name (case-sensitive) in this schema, ornull
if no such UDT exists.
-
sequenceStream
java.util.stream.Stream<Sequence<?>> sequenceStream()
Stream all sequences contained in this schema.
-
getSequences
java.util.List<Sequence<?>> getSequences()
List all sequences contained in this schema.
-
getSequence
Sequence<?> getSequence(java.lang.String name)
Get a sequence by its name (case-sensitive) in this schema, ornull
if no such sequence exists.
-
-