Package ru.curs.celesta.score
Interface TableElement
-
- All Known Implementing Classes:
BasicTable
,MaterializedView
,ReadOnlyTable
,Table
public interface TableElement
Interface that defines meta entity as a table in the DB.- Since:
- 2017-06-13
- Author:
- ioann
-
-
Field Summary
Fields Modifier and Type Field Description static String
YOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
ConstantYOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addColumn(Column<?> column)
Adds a column to the table.Column<?>
getColumn(String colName)
Returns a column by its name or throws an exception with a message that the column is not found.Map<String,Column<?>>
getColumns()
Returns a map of columns with names.Grain
getGrain()
Returns grain that the table element belongs to.String
getName()
Returns table element name.String
getPkConstraintName()
Returns PK constraint name.Map<String,Column<?>>
getPrimaryKey()
Returns unmodified map of primary key columns.String
getQuotedName()
Returns name in ANSI quotes ("name").String
getQuotedNameIfNeeded()
Returns the name in ANSI quotes if needed.boolean
hasPrimeKey()
Whether the table has primary key.void
removeColumn(Column<?> column)
Removes a column from the table.
-
-
-
Field Detail
-
YOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
static final String YOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
ConstantYOU_CANNOT_DROP_A_COLUMN_THAT_BELONGS_TO
.- See Also:
- Constant Field Values
-
-
Method Detail
-
getGrain
Grain getGrain()
Returns grain that the table element belongs to.- Returns:
-
getName
String getName()
Returns table element name.- Returns:
-
getQuotedName
String getQuotedName()
Returns name in ANSI quotes ("name").- Returns:
-
getQuotedNameIfNeeded
String getQuotedNameIfNeeded()
Returns the name in ANSI quotes if needed.- Returns:
-
getColumn
Column<?> getColumn(String colName) throws ParseException
Returns a column by its name or throws an exception with a message that the column is not found.- Parameters:
colName
- column name- Returns:
- Throws:
ParseException
- if a column with the specified name is not found in the table
-
addColumn
void addColumn(Column<?> column) throws ParseException
Adds a column to the table.- Parameters:
column
- new column- Throws:
ParseException
- if the column couldn't be added
-
removeColumn
void removeColumn(Column<?> column) throws ParseException
Removes a column from the table.- Parameters:
column
- existing column- Throws:
ParseException
- if the column couldn't be removed
-
hasPrimeKey
boolean hasPrimeKey()
Whether the table has primary key.- Returns:
-
getPkConstraintName
String getPkConstraintName()
Returns PK constraint name.- Returns:
-
-