@NotThreadSafe public interface TableEditor
| Modifier and Type | Method and Description |
|---|---|
default TableEditor |
addColumn(Column column)
Add one columns to this table, regardless of the
position of the supplied
columns. |
TableEditor |
addColumns(Column... columns)
Add one or more columns to this table, regardless of the
position of the supplied
columns. |
TableEditor |
addColumns(Iterable<Column> columns)
Add one or more columns to the end of this table's list of columns, regardless of the
position of the supplied columns. |
default List<String> |
columnNames()
Get the names of the columns in this table.
|
List<Column> |
columns()
Get the definitions for the columns in this table.
|
Column |
columnWithName(String name)
Get the definition for the column in this table with the supplied name.
|
Table |
create()
Obtain an immutable table definition representing the current state of this editor.
|
boolean |
hasDefaultCharsetName()
Determine if a
default character set has been set on this table. |
default boolean |
hasPrimaryKey()
Determine whether this table has a primary key.
|
boolean |
hasUniqueValues()
Determine whether this table's primary key contains all columns (via
setUniqueValues()) such that all rows
within the table are unique. |
static TableEditor |
noOp(TableId id)
Create a new editor that does nothing.
|
List<String> |
primaryKeyColumnNames()
The list of column names that make up the primary key for this table.
|
TableEditor |
removeColumn(String columnName)
Remove the column with the given name.
|
TableEditor |
renameColumn(String existingName,
String newName)
Rename the column with the given name to the new specified name.
|
TableEditor |
reorderColumn(String columnName,
String afterColumnName)
Reorder the column with the given name to be positioned after the designated column.
|
TableEditor |
setColumns(Column... columns)
Set this table's column definitions.
|
TableEditor |
setColumns(Iterable<Column> columns)
Set this table's column definitions.
|
TableEditor |
setDefaultCharsetName(String charsetName)
Set the name of the character set that should be used by default in the columns that require a character set but have
not defined one.
|
TableEditor |
setPrimaryKeyNames(List<String> pkColumnNames)
Set the columns that make up this table's primary key.
|
TableEditor |
setPrimaryKeyNames(String... pkColumnNames)
Set the columns that make up this table's primary key.
|
TableEditor |
setUniqueValues()
Sets this table's primary key to contain all columns, ensuring that all values are unique within the table.
|
TableId |
tableId()
Get the identifier for this table.
|
TableEditor |
tableId(TableId tableId)
Set the table identifier.
|
static TableEditor noOp(TableId id)
id - the table's identifier; may not be nullTableId tableId()
TableEditor tableId(TableId tableId)
tableId - the table identifierList<Column> columns()
addColumns(Column...),
addColumns(Iterable), setColumns(Column...), setColumns(Iterable), or
removeColumn(String).default List<String> columnNames()
addColumns(Column...),
addColumns(Iterable), setColumns(Column...), setColumns(Iterable), or
removeColumn(String).Column columnWithName(String name)
name - the case-insensitive name of the columnList<String> primaryKeyColumnNames()
setPrimaryKeyNames(String...).default boolean hasPrimaryKey()
true if this table has at least one primary key column, or false
if there are no primary key columnsdefault TableEditor addColumn(Column column)
position of the supplied
columns. However, if an existing column definition matches a supplied column, the new column definition will replace
the existing column definition.column - the definition for the column to be addedTableEditor addColumns(Column... columns)
position of the supplied
columns. However, if an existing column definition matches a supplied column, the new column definition will replace
the existing column definition.columns - the definitions for the columns to be addedTableEditor addColumns(Iterable<Column> columns)
position of the supplied columns. However, if an existing column definition matches a supplied column, the new column
definition will replace the existing column definition.columns - the definitions for the columns to be addedTableEditor setColumns(Column... columns)
columns - the definitions for the columns to be addedTableEditor setColumns(Iterable<Column> columns)
columns - the definitions for the columns to be addedTableEditor removeColumn(String columnName)
columnName - the name of the column to be removedTableEditor reorderColumn(String columnName, String afterColumnName)
afterColumnName is null,
the column will be moved to the first column.columnName - the name of the column to be removedafterColumnName - the name of the column after which the moved column is to be positioned; may be null if the column
is to be moved to the first columnTableEditor renameColumn(String existingName, String newName)
existingName - the existing name of the column to be renamed; may not be nullnewName - the new name of the column; may not be nullTableEditor setPrimaryKeyNames(String... pkColumnNames)
pkColumnNames - the names of this tables columns that make up the primary keyIllegalArgumentException - if a name does not correspond to an existing columnTableEditor setPrimaryKeyNames(List<String> pkColumnNames)
pkColumnNames - the names of this tables columns that make up the primary keyIllegalArgumentException - if a name does not correspond to an existing columnTableEditor setUniqueValues()
setPrimaryKeyNames(columnNames()) except that the primary key is updated
when columns are added or removed.IllegalArgumentException - if a name does not correspond to an existing columnTableEditor setDefaultCharsetName(String charsetName)
charsetName - the name of the character set that should be used by defaultboolean hasDefaultCharsetName()
default character set has been set on this table.true if this has a default character set, or false if one has not yet been setboolean hasUniqueValues()
setUniqueValues()) such that all rows
within the table are unique.true if setUniqueValues() was last called on this table, or false otherwiseTable create()
Copyright © 2020 JBoss by Red Hat. All rights reserved.