Class SimpleCatalog.SimpleTable
Object
gudusoft.gsqlparser.ext.calcite.catalog.impl.SimpleCatalog.SimpleTable
- All Implemented Interfaces:
Table
- Enclosing class:
- SimpleCatalog
Simple, mutable implementation of
Table.-
Constructor Summary
ConstructorsConstructorDescriptionSimpleTable(String name, String tableType, SimpleCatalog.SimpleSchema schema) -
Method Summary
Modifier and TypeMethodDescriptionaddColumn(SimpleCatalog.SimpleColumn column) Adds a column to this table.addPrimaryKey(String columnName) Adds a primary key column.createColumn(String columnName, String typeName, boolean nullable) Creates and adds a new column to this table.Returns a column by name, or null if not found.Returns all columns in this table, in ordinal order.Returns the comment or description of the table.getName()Returns the name of the table.Returns the primary key columns.Returns the schema that this table belongs to.Returns the type of the table (e.g., "TABLE", "VIEW", "SYSTEM TABLE").setComment(String comment) Sets the comment for this table.setPrimaryKeys(List<String> primaryKeys) Sets the primary key columns.
-
Constructor Details
-
SimpleTable
-
-
Method Details
-
getName
Description copied from interface:TableReturns the name of the table. -
getTableType
Description copied from interface:TableReturns the type of the table (e.g., "TABLE", "VIEW", "SYSTEM TABLE").- Specified by:
getTableTypein interfaceTable- Returns:
- Table type
-
getSchema
Description copied from interface:TableReturns the schema that this table belongs to. -
getColumns
Description copied from interface:TableReturns all columns in this table, in ordinal order.- Specified by:
getColumnsin interfaceTable- Returns:
- List of columns
-
getColumn
Description copied from interface:TableReturns a column by name, or null if not found. -
getComment
Description copied from interface:TableReturns the comment or description of the table.- Specified by:
getCommentin interfaceTable- Returns:
- Table comment, or null if none
-
getPrimaryKeys
Description copied from interface:TableReturns the primary key columns.- Specified by:
getPrimaryKeysin interfaceTable- Returns:
- List of primary key column names
-
addColumn
Adds a column to this table.- Parameters:
column- Column to add- Returns:
- This table (for chaining)
-
createColumn
public SimpleCatalog.SimpleColumn createColumn(String columnName, String typeName, boolean nullable) Creates and adds a new column to this table.- Parameters:
columnName- Column nametypeName- SQL type namenullable- Whether the column is nullable- Returns:
- The newly created column
-
setComment
Sets the comment for this table.- Parameters:
comment- Table comment- Returns:
- This table (for chaining)
-
setPrimaryKeys
Sets the primary key columns.- Parameters:
primaryKeys- Primary key column names- Returns:
- This table (for chaining)
-
addPrimaryKey
Adds a primary key column.- Parameters:
columnName- Primary key column name- Returns:
- This table (for chaining)
-