public interface Table extends Document, HasParent<Schema>, HasDeepCopy, HasEnabled, HasId, HasName, HasChildren, HasAlias, HasPackageName, HasMainInterface, HasMutator<TableMutator<? extends Table>>
Document
that represents a table instance in the database. A
Table
is located inside a Schema
and can have multiple
Columns
as children.Modifier and Type | Field and Description |
---|---|
static String |
COLUMNS |
static String |
FOREIGN_KEYS |
static String |
INDEXES |
static String |
IS_VIEW |
static String |
PRIMARY_KEY_COLUMNS |
ENABLED, ENABLED_DEFAULT
PACKAGE_NAME
Modifier and Type | Method and Description |
---|---|
Stream<? extends Column> |
columns()
Creates a stream of columns located in this document.
|
default Table |
deepCopy()
Returns a mutable copy of this document.
|
default Optional<? extends Column> |
findColumn(String id)
Locate the
Column child with the specified id if it exists, else
return an empty Optional . |
default Optional<? extends ForeignKey> |
findForeignKey(String id)
Locate the
ForeignKey child with the specified id if it exists,
else return an empty Optional . |
default Optional<? extends Index> |
findIndex(String id)
Locate the
Index child with the specified id if it exists, else
return an empty Optional . |
default Optional<? extends PrimaryKeyColumn> |
findPrimaryKeyColumn(String id)
Locate the
PrimaryKeyColumn child with the specified id if it
exists, else return an empty Optional . |
Stream<? extends ForeignKey> |
foreignKeys()
Creates a stream of foreign keys located in this document.
|
Stream<? extends Index> |
indexes()
Creates a stream of indexes located in this document.
|
default boolean |
isView()
Returns
true if this Table represents a VIEW in the
database. |
default Class<Table> |
mainInterface()
Returns the
Class of the interface of this node. |
default TableMutator<? extends Table> |
mutator()
Returns a
DocumentMutator for this Document. |
Stream<? extends PrimaryKeyColumn> |
primaryKeyColumns()
Creates a stream of primary key columns located in this document.
|
getParent, getParentOrThrow
isEnabled, of, test
defaultNameFor
getAlias, getJavaName, of
getPackageName, of
static final String COLUMNS
static final String INDEXES
static final String FOREIGN_KEYS
static final String PRIMARY_KEY_COLUMNS
static final String IS_VIEW
default boolean isView()
true
if this Table
represents a VIEW in the
database. VIEW Tables are not necessarily writable and might not have
all the functionality a regular Table has.
The default value for this property is false
.
true
if this is just a SQL VIEW, else false
Stream<? extends Column> columns()
Stream<? extends Index> indexes()
Stream<? extends ForeignKey> foreignKeys()
Stream<? extends PrimaryKeyColumn> primaryKeyColumns()
default Optional<? extends Column> findColumn(String id)
Column
child with the specified id if it exists, else
return an empty Optional
.id
- the HasId.getId()
of the columnOptional
default Optional<? extends Index> findIndex(String id)
Index
child with the specified id if it exists, else
return an empty Optional
.id
- the HasId.getId()
of the indexOptional
default Optional<? extends ForeignKey> findForeignKey(String id)
ForeignKey
child with the specified id if it exists,
else return an empty Optional
.id
- the HasId.getId()
of the foreign keyOptional
default Optional<? extends PrimaryKeyColumn> findPrimaryKeyColumn(String id)
PrimaryKeyColumn
child with the specified id if it
exists, else return an empty Optional
.id
- the HasId.getId()
of the primary key columnOptional
default Class<Table> mainInterface()
HasMainInterface
Class
of the interface of this node.
This should not be overridden by implementing classes!
mainInterface
in interface HasMainInterface
default TableMutator<? extends Table> mutator()
HasMutator
DocumentMutator
for this Document. A DocumentMutator
allows a Document to be updated in a type safe way.mutator
in interface HasMutator<TableMutator<? extends Table>>
default Table deepCopy()
HasDeepCopy
deepCopy
in interface HasDeepCopy
Copyright © 2019 Speedment, Inc.. All rights reserved.