public class DB2UniqueDelegate extends DefaultUniqueDelegate
DB2 does not allow unique constraints on nullable columns. Rather than forcing "not null", use unique indexes instead.
dialect| Constructor and Description |
|---|
DB2UniqueDelegate(Dialect dialect)
Constructs a DB2UniqueDelegate
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey,
Metadata metadata)
Get the SQL ALTER TABLE command to be used to create the given UniqueKey.
|
String |
getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey,
Metadata metadata)
Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.
|
getColumnDefinitionUniquenessFragment, getDropUnique, getTableCreationUniqueConstraintsFragment, uniqueConstraintSqlpublic DB2UniqueDelegate(Dialect dialect)
Constructs a DB2UniqueDelegate
dialect - The dialectpublic String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)
UniqueDelegateGet the SQL ALTER TABLE command to be used to create the given UniqueKey.
getAlterTableToAddUniqueKeyCommand in interface UniqueDelegategetAlterTableToAddUniqueKeyCommand in class DefaultUniqueDelegateuniqueKey - The UniqueKey instance. Contains all information about the columnsmetadata - Access to the bootstrap mapping informationpublic String getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)
UniqueDelegateGet the SQL ALTER TABLE command to be used to drop the given UniqueKey.
getAlterTableToDropUniqueKeyCommand in interface UniqueDelegategetAlterTableToDropUniqueKeyCommand in class DefaultUniqueDelegateuniqueKey - The UniqueKey instance. Contains all information about the columnsmetadata - Access to the bootstrap mapping informationCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.