Package com.exasol.sql.ddl.create
Class CreateTable
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.ddl.create.CreateTable
-
- All Implemented Interfaces:
CreateTableFragment,Fragment,SqlStatement
public class CreateTable extends AbstractFragment implements SqlStatement, CreateTableFragment
This class implements an SQLCreateTablestatement
-
-
Field Summary
-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Constructor Description CreateTable(String tableName)Create a new instance of anCreateTablestatement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(CreateTableVisitor visitor)Accept a visitor (e.g.CreateTablebooleanColumn(String columnName)Add boolean columnCreateTablecharColumn(String columnName, int length)Add char column.CreateTabledateColumn(String columnName)Add date columnCreateTabledecimalColumn(String columnName, int precision, int scale)Add decimal column.CreateTabledoublePrecisionColumn(String columnName)Add double precision columnColumnsDefinitiongetColumnsDefinition()Get columns definition of the table.StringgetTableName()Get the table nameCreateTableintervalDayToSecondColumn(String columnName, int yearPrecision, int millisecondPrecision)Add interval day to second column.CreateTableintervalYearToMonthColumn(String columnName, int yearPrecision)Add interval year to month column.CreateTabletimestampColumn(String columnName)Add timestamp columnCreateTabletimestampWithLocalTimeZoneColumn(String columnName)Add timestamp with local time zone columnCreateTablevarcharColumn(String columnName, int length)Add varchar column.-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Constructor Detail
-
CreateTable
public CreateTable(String tableName)
Create a new instance of anCreateTablestatement- Parameters:
tableName- name of the table to create
-
-
Method Detail
-
booleanColumn
public CreateTable booleanColumn(String columnName)
Add boolean column- Parameters:
columnName- name of the column to be added- Returns:
thisfor fluent programming
-
charColumn
public CreateTable charColumn(String columnName, int length)
Add char column.- Parameters:
columnName- name of the column to be addedlength- pre-defined length for stored strings- Returns:
thisfor fluent programming
-
varcharColumn
public CreateTable varcharColumn(String columnName, int length)
Add varchar column.- Parameters:
columnName- name of the column to be addedlength- pre-defined length for stored strings- Returns:
thisfor fluent programming
-
dateColumn
public CreateTable dateColumn(String columnName)
Add date column- Parameters:
columnName- name of the column to be added- Returns:
thisfor fluent programming
-
decimalColumn
public CreateTable decimalColumn(String columnName, int precision, int scale)
Add decimal column.- Parameters:
columnName- name of the column to be addedprecision- precision for numeric valuescale- scale for numeric value- Returns:
thisfor fluent programming
-
doublePrecisionColumn
public CreateTable doublePrecisionColumn(String columnName)
Add double precision column- Parameters:
columnName- name of the column to be added- Returns:
thisfor fluent programming
-
timestampColumn
public CreateTable timestampColumn(String columnName)
Add timestamp column- Parameters:
columnName- name of the column to be added- Returns:
thisfor fluent programming
-
timestampWithLocalTimeZoneColumn
public CreateTable timestampWithLocalTimeZoneColumn(String columnName)
Add timestamp with local time zone column- Parameters:
columnName- name of the column to be added- Returns:
thisfor fluent programming
-
intervalDayToSecondColumn
public CreateTable intervalDayToSecondColumn(String columnName, int yearPrecision, int millisecondPrecision)
Add interval day to second column.- Parameters:
columnName- name of the column to be addedyearPrecision- year precision valuemillisecondPrecision- millisecond precision value- Returns:
thisfor fluent programming
-
intervalYearToMonthColumn
public CreateTable intervalYearToMonthColumn(String columnName, int yearPrecision)
Add interval year to month column.- Parameters:
columnName- name of the column to be addedyearPrecision- year precision value- Returns:
thisfor fluent programming
-
getTableName
public String getTableName()
Get the table name- Returns:
- table name
-
getColumnsDefinition
public ColumnsDefinition getColumnsDefinition()
Get columns definition of the table.- Returns:
- columns
-
accept
public void accept(CreateTableVisitor visitor)
Description copied from interface:CreateTableFragmentAccept a visitor (e.g. a renderer or validator)- Specified by:
acceptin interfaceCreateTableFragment- Parameters:
visitor- visitor to accept
-
-