UniqueDelegate which uses alter table commands to create and drop
the unique constraint. When possible, prefer CreateTableUniqueDelegate.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getAlterTableToAddUniqueKeyCommand(UniqueKey
The uniqueKey, Metadata UniqueKey instance. Contains all information about the columnsAccess to the bootstrap mapping information metadata, SqlStringGenerationContext A context for SQL string generation context)Implements org.
Deprecated
as a consequence of
Get the Metadata being deprecated.
alter table command used to create the given unique key
constraint, or return the empty string if the constraint was already included in the create table statement by getTableCreationUniqueConstraintsFragment.
|
| public String | getAlterTableToDropUniqueKeyCommand(UniqueKey
The uniqueKey, Metadata UniqueKey instance. Contains all information about the columnsAccess to the bootstrap mapping information metadata, SqlStringGenerationContext A context for SQL string generation context)Implements org.
Deprecated
as a consequence of
Get the Metadata being deprecated.
alter table command used to drop the given unique key
which was previously created by getAlterTableToAddUniqueKeyCommand.
|
| public String | getColumnDefinitionUniquenessFragment(Column
The column to which to apply the unique column, SqlStringGenerationContext A context for SQL string generation context)Implements org. " unique", or return an empty string if uniqueness does not belong in
the column definition.
|
| public String | getTableCreationUniqueConstraintsFragment(Table
The table for which to generate the unique constraints fragment table, SqlStringGenerationContext A context for SQL string generation context)Implements org. create table command, with a leading comma, usually something like:
|
| protected String |
| dialect | back to summary |
|---|---|
| protected final Dialect dialect | |
| AlterTableUniqueDelegate | back to summary |
|---|---|
public AlterTableUniqueDelegate(Dialect dialect)
| |
| getAlterTableToAddUniqueKeyCommand | back to summary |
|---|---|
| public String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Implements org. Doc from org. Deprecated as a consequence of Get the | |
| getAlterTableToDropUniqueKeyCommand | back to summary |
|---|---|
| public String getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Implements org. Doc from org. Deprecated as a consequence of Get the | |
| getColumnDefinitionUniquenessFragment | back to summary |
|---|---|
| public String getColumnDefinitionUniquenessFragment(Column column, SqlStringGenerationContext context) Implements org. Doc from org. Get the SQL fragment used to make the given column unique as part of its column definition,
usually just This is for handling single columns explicitly marked unique, not for dealing with unique keys.
| |
| getTableCreationUniqueConstraintsFragment | back to summary |
|---|---|
| public String getTableCreationUniqueConstraintsFragment(Table table, SqlStringGenerationContext context) Implements org. Doc from org. Get the SQL fragment used to specify the unique constraints on the given table as part of
the
or return an empty string if there are no unique constraints or if the unique constraints do not belong in the table definition.
The implementation should iterate over the unique keys of the given
table by calling
| |
| uniqueConstraintSql | back to summary |
|---|---|
| protected String uniqueConstraintSql(UniqueKey uniqueKey) | |