public abstract class BasicTable extends DataGrainElement implements TableElement
Table and ReadOnlyTable that encompasses common logic
for both table types.MAX_IDENTIFIER_LENGTHYOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Column<?> column)
Adds a column to the table.
|
void |
finalizePK()
Finalizes the creation of the primary key.
|
Column<?> |
getColumn(String colName)
Returns a column by its name or throws an exception with a message that
the column is not found.
|
int |
getColumnIndex(String name)
Column index in the list of columns.
|
Map<String,Column<?>> |
getColumns()
Unmodified list of table columns.
|
Set<ForeignKey> |
getForeignKeys()
Returns a set of foreign keys for the table.
|
List<String> |
getImplements()
Returns interfaces that are implemented by the cursor (values of
'implements' property) for this table.
|
Set<Index> |
getIndices()
Returns a set of indices for the table.
|
String |
getPkConstraintName()
Returns PK constraint name.
|
Map<String,Column<?>> |
getPrimaryKey()
Returns unmodified map of primary key columns.
|
boolean |
isAutoUpdate()
Whether autoupdate is on/off.
false value indicates that the table was created with the option
WITH NO STRUCTURE UPDATE and it won't take part in the DB autoupdate. |
void |
removeColumn(Column<?> column)
Removes a column from the table.
|
void |
setAutoUpdate(boolean autoUpdate)
Sets or clears the option WITH NO STRUCTURE UPDATE.
|
void |
setPK(String... columnNames)
Sets primary key on the table in a form of array of columns.
|
void |
setPkConstraintName(String pkConstraintName)
Sets the name of constraint for the primary key.
|
String |
toString() |
deletegetGrain, getGrainPartequals, getCelestaDoc, getName, getQuotedName, getQuotedNameIfNeeded, hashCode, limitName, limitName, setCelestaDocgetGrain, getName, getQuotedName, hasPrimeKeypublic Map<String,Column<?>> getColumns()
getColumns in interface HasColumnsgetColumns in interface TableElementpublic final Column<?> getColumn(String colName) throws ParseException
TableElementgetColumn in interface TableElementcolName - column nameParseException - if a column with the specified name is not found in the tablepublic final Map<String,Column<?>> getPrimaryKey()
TableElementgetPrimaryKey in interface TableElementpublic void addColumn(Column<?> column) throws ParseException
addColumn in interface TableElementcolumn - new columnParseException - if a column with the same name is already definedpublic void setPK(String... columnNames) throws ParseException
columnNames - array of columnsParseException - in case when an empty array is passed inpublic final void removeColumn(Column<?> column) throws ParseException
TableElementremoveColumn in interface TableElementcolumn - existing columnParseException - if the column couldn't be removedpublic void finalizePK()
throws ParseException
ParseException - if the primary key is empty.public Set<ForeignKey> getForeignKeys()
public final String getPkConstraintName()
TableElementgetPkConstraintName in interface TableElementpublic void setPkConstraintName(String pkConstraintName) throws ParseException
pkConstraintName - PK constraint nameParseException - incorrect namepublic boolean isAutoUpdate()
false value indicates that the table was created with the option
WITH NO STRUCTURE UPDATE and it won't take part in the DB autoupdate.
Default is true.public void setAutoUpdate(boolean autoUpdate)
autoUpdate - true if the table is updated automatically,
false - in the opposite case.public final int getColumnIndex(String name)
HasColumnsgetColumnIndex in interface HasColumnsname - column name.Copyright © 2020 CURS. All rights reserved.