UniqueDelegate which includes the unique constraint in the create table
statement, except when called during schema migration.
unique column definition.
constraint abc unique(a,b,c) after the column list in create table.
unique(x, y) after the
column list.
Counterintuitively, this class extends AlterTableUniqueDelegate, since it falls back
to using alter table for schema migration.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| 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)Overrides org. 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)Overrides org. 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)Overrides org. 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)Overrides org. Implements org. create table command, with a leading comma, usually something like:
|
| private static boolean |
| CreateTableUniqueDelegate | back to summary |
|---|---|
| public CreateTableUniqueDelegate(Dialect dialect) | |
| appendUniqueConstraint | back to summary |
|---|---|
| protected void appendUniqueConstraint(StringBuilder fragment, UniqueKey uniqueKey) | |
| getAlterTableToAddUniqueKeyCommand | back to summary |
|---|---|
| public String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Overrides org. 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) Overrides org. Implements org. Doc from org. Deprecated as a consequence of Get the | |
| getColumnDefinitionUniquenessFragment | back to summary |
|---|---|
| public String getColumnDefinitionUniquenessFragment(Column column, SqlStringGenerationContext context) Overrides org. 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) Overrides org. 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
| |
| isSingleColumnUnique | back to summary |
|---|---|
| private static boolean isSingleColumnUnique(Table table, UniqueKey uniqueKey) | |