public interface DatabaseDialect
SchemaTool
to generate SQL which conforms to
the dialect of a special database.Modifier and Type | Method and Description |
---|---|
String |
areColumnsEqual(TableColumn target,
TableColumn current)
Determines if two given column are equal or not.
|
Table |
completeTableInfos(Table table)
Performs DB-specific functions after a
Table was read from the
DB-metadata. |
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
|
String |
generateDropTable(Table table)
Builds a DROP TABLE statement.
|
String |
getEffectiveKeyName(Table targetTable,
Key key)
Computes the effective name used for a key.
|
int |
getJDBCType(Class<?> clazz)
Converts the given class into the JDBC-Value (@see
Types ). |
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.
|
String |
translateColumnName(String name)
Converts the name (casing) to the one, used by the DB.
|
Table completeTableInfos(Table table)
Table
was read from the
DB-metadata. This can be used to change column types or default values.table
- the table object to enhanceint getJDBCType(Class<?> clazz)
Types
).clazz
- the type to convertString areColumnsEqual(TableColumn target, TableColumn current)
target
- the target column as expected by the schemacurrent
- the current database column was read from the metadataString generateCreateTable(Table table)
table
- the table to createString generateDropTable(Table table)
table
- the table to dropList<String> generateAlterColumnTo(Table table, @Nullable String oldName, TableColumn toColumn)
table
- the table to alteroldName
- the old name of the column (if it was renamed)toColumn
- the column as expected in the schemaString generateAddColumn(Table table, TableColumn col)
table
- the table to altercol
- the column to createString generateDropColumn(Table table, TableColumn col)
table
- the table to altercol
- the column to dropList<String> generateAlterPrimaryKey(Table table)
table
- the table to alterList<String> generateAlterKey(Table table, Key from, Key to)
table
- the table to alterfrom
- the key as currently present in the databaseto
- the key as defined in the schemaString generateAddKey(Table table, Key key)
table
- the table to alterkey
- the key to addString generateDropKey(Table table, Key key)
table
- the table to alterkey
- the key to dropList<String> generateAlterForeignKey(Table table, ForeignKey from, ForeignKey to)
table
- the table to alterfrom
- the key as currently present in the databaseto
- the key as defined in the schemaString generateAddForeignKey(Table table, ForeignKey key)
table
- the table to alterkey
- the key to addString generateDropForeignKey(Table table, ForeignKey key)
table
- the table to alterkey
- the key to dropString translateColumnName(String name)
name
- the name of the columnboolean isColumnCaseSensitive()
boolean shouldDropKey(Table targetTable, Table currentTable, Key key)
targetTable
- the table being referencedcurrentTable
- the table referencing anotherkey
- the key which defines the referenceCopyright © 2018. All rights reserved.