public static class SimpleCatalog.SimpleTable extends Object implements Table
Table.| Constructor and Description |
|---|
SimpleTable(String name,
String tableType,
SimpleCatalog.SimpleSchema schema) |
| Modifier and Type | Method and Description |
|---|---|
SimpleCatalog.SimpleTable |
addColumn(SimpleCatalog.SimpleColumn column)
Adds a column to this table.
|
SimpleCatalog.SimpleTable |
addPrimaryKey(String columnName)
Adds a primary key column.
|
SimpleCatalog.SimpleColumn |
createColumn(String columnName,
String typeName,
boolean nullable)
Creates and adds a new column to this table.
|
Column |
getColumn(String columnName)
Returns a column by name, or null if not found.
|
List<Column> |
getColumns()
Returns all columns in this table, in ordinal order.
|
String |
getComment()
Returns the comment or description of the table.
|
String |
getName()
Returns the name of the table.
|
List<String> |
getPrimaryKeys()
Returns the primary key columns.
|
Schema |
getSchema()
Returns the schema that this table belongs to.
|
String |
getTableType()
Returns the type of the table (e.g., "TABLE", "VIEW", "SYSTEM TABLE").
|
SimpleCatalog.SimpleTable |
setComment(String comment)
Sets the comment for this table.
|
SimpleCatalog.SimpleTable |
setPrimaryKeys(List<String> primaryKeys)
Sets the primary key columns.
|
public SimpleTable(String name, String tableType, SimpleCatalog.SimpleSchema schema)
public String getName()
Tablepublic String getTableType()
TablegetTableType in interface Tablepublic Schema getSchema()
Tablepublic List<Column> getColumns()
TablegetColumns in interface Tablepublic Column getColumn(String columnName)
Tablepublic String getComment()
TablegetComment in interface Tablepublic List<String> getPrimaryKeys()
TablegetPrimaryKeys in interface Tablepublic SimpleCatalog.SimpleTable addColumn(SimpleCatalog.SimpleColumn column)
column - Column to addpublic SimpleCatalog.SimpleColumn createColumn(String columnName, String typeName, boolean nullable)
columnName - Column nametypeName - SQL type namenullable - Whether the column is nullablepublic SimpleCatalog.SimpleTable setComment(String comment)
comment - Table commentpublic SimpleCatalog.SimpleTable setPrimaryKeys(List<String> primaryKeys)
primaryKeys - Primary key column namespublic SimpleCatalog.SimpleTable addPrimaryKey(String columnName)
columnName - Primary key column name