public class ClickhouseDatabaseDialect extends BasicDatabaseDialect
DEFAULT_MAX_CONSTRAINT_NAME_LENGTH, KEY_CURRENT, KEY_TARGET
Constructor and Description |
---|
ClickhouseDatabaseDialect() |
Modifier and Type | Method and Description |
---|---|
String |
generateAddColumn(Table table,
TableColumn col)
Generates an alter statement to add the given column.
|
String |
generateAddForeignKey(Table table,
ForeignKey key)
Alters the table so that the given foreign key is added
|
String |
generateAddKey(Table table,
Key key)
Alters the table so that the given key is added
|
List<String> |
generateAlterColumnTo(Table table,
String oldName,
TableColumn toColumn)
Alters the given column.
|
List<String> |
generateAlterForeignKey(Table table,
ForeignKey from,
ForeignKey to)
Alters the table so that the given foreign key is updated
* @param table the table to alter
|
List<String> |
generateAlterKey(Table table,
Key from,
Key to)
Alters the table so that the given key is updated
|
List<String> |
generateAlterPrimaryKey(Table table)
Alters the table so that the PK is updated.
|
String |
generateCreateTable(Table table)
Builds a CREATE TABLE statement.
|
String |
generateDropColumn(Table table,
TableColumn col)
Generates an alter statement to drop the given column.
|
String |
generateDropForeignKey(Table table,
ForeignKey key)
Alters the table so that the given foreign key is dropped
|
String |
generateDropKey(Table table,
Key key)
Alters the table so that the given key is dropped
|
protected String |
getTypeName(TableColumn column) |
boolean |
isColumnCaseSensitive()
Determines whether casing of columns should be fixed.
|
boolean |
shouldDropKey(Table targetTable,
Table currentTable,
Key key)
Determines if the given key should be dropped.
|
areColumnsEqual, areDefaultsDifferent, areTypesEqual, checkColumnSettings, checkForEquality, completeTableInfos, ensurePositiveLength, equalValue, generateDropTable, getConstraintCharacterLimit, getDefaultValueAsString, getEffectiveKeyName, getEngine, getJDBCType, hasEscapedDefaultValue, in, isNeedsQuotation, resolveType, translateColumnName
public String generateCreateTable(Table table)
DatabaseDialect
table
- the table to createprotected String getTypeName(TableColumn column)
getTypeName
in class BasicDatabaseDialect
public List<String> generateAlterColumnTo(Table table, @Nullable String oldName, TableColumn toColumn)
DatabaseDialect
table
- the table to alteroldName
- the old name of the column (if it was renamed)toColumn
- the column as expected in the schemapublic String generateAddColumn(Table table, TableColumn col)
DatabaseDialect
table
- the table to altercol
- the column to createpublic String generateAddForeignKey(Table table, ForeignKey key)
DatabaseDialect
generateAddForeignKey
in interface DatabaseDialect
generateAddForeignKey
in class BasicDatabaseDialect
table
- the table to alterkey
- the key to addpublic String generateAddKey(Table table, Key key)
DatabaseDialect
generateAddKey
in interface DatabaseDialect
generateAddKey
in class BasicDatabaseDialect
table
- the table to alterkey
- the key to addpublic List<String> generateAlterForeignKey(Table table, ForeignKey from, ForeignKey to)
DatabaseDialect
generateAlterForeignKey
in interface DatabaseDialect
generateAlterForeignKey
in class BasicDatabaseDialect
table
- the table to alterfrom
- the key as currently present in the databaseto
- the key as defined in the schemapublic List<String> generateAlterKey(Table table, Key from, Key to)
DatabaseDialect
generateAlterKey
in interface DatabaseDialect
generateAlterKey
in class BasicDatabaseDialect
table
- the table to alterfrom
- the key as currently present in the databaseto
- the key as defined in the schemapublic List<String> generateAlterPrimaryKey(Table table)
DatabaseDialect
generateAlterPrimaryKey
in interface DatabaseDialect
generateAlterPrimaryKey
in class BasicDatabaseDialect
table
- the table to alterpublic String generateDropColumn(Table table, TableColumn col)
DatabaseDialect
generateDropColumn
in interface DatabaseDialect
generateDropColumn
in class BasicDatabaseDialect
table
- the table to altercol
- the column to droppublic String generateDropForeignKey(Table table, ForeignKey key)
DatabaseDialect
generateDropForeignKey
in interface DatabaseDialect
generateDropForeignKey
in class BasicDatabaseDialect
table
- the table to alterkey
- the key to droppublic String generateDropKey(Table table, Key key)
DatabaseDialect
generateDropKey
in interface DatabaseDialect
generateDropKey
in class BasicDatabaseDialect
table
- the table to alterkey
- the key to droppublic boolean isColumnCaseSensitive()
DatabaseDialect
public boolean shouldDropKey(Table targetTable, Table currentTable, Key key)
DatabaseDialect
targetTable
- the table being referencedcurrentTable
- the table referencing anotherkey
- the key which defines the referenceCopyright © 2018. All rights reserved.