public interface UniqueDelegate
getAlterTableToAddUniqueKeyCommand(org.hibernate.mapping.UniqueKey, org.hibernate.boot.Metadata, org.hibernate.boot.model.relational.SqlStringGenerationContext)
.
Also, see getAlterTableToDropUniqueKeyCommand(org.hibernate.mapping.UniqueKey, org.hibernate.boot.Metadata, org.hibernate.boot.model.relational.SqlStringGenerationContext)
getTableCreationUniqueConstraintsFragment(org.hibernate.mapping.Table, org.hibernate.boot.model.relational.SqlStringGenerationContext)
getColumnDefinitionUniquenessFragment(org.hibernate.mapping.Column, org.hibernate.boot.model.relational.SqlStringGenerationContext)
Modifier and Type | Method and Description |
---|---|
String |
getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey,
Metadata metadata,
SqlStringGenerationContext context)
Get the SQL ALTER TABLE command to be used to create the given UniqueKey.
|
String |
getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey,
Metadata metadata,
SqlStringGenerationContext context)
Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.
|
String |
getColumnDefinitionUniquenessFragment(Column column,
SqlStringGenerationContext context)
Get the fragment that can be used to make a column unique as part of its column definition.
|
String |
getTableCreationUniqueConstraintsFragment(Table table,
SqlStringGenerationContext context)
Get the fragment that can be used to apply unique constraints as part of table creation.
|
String getColumnDefinitionUniquenessFragment(Column column, SqlStringGenerationContext context)
column
- The column to which to apply the uniquecontext
- A context for SQL string generationString getTableCreationUniqueConstraintsFragment(Table table, SqlStringGenerationContext context)
UniqueKey
instances for the given table (see
Table.getUniqueKeyIterator()
and generate the whole fragment for all
unique keys
Intended for Dialects which support unique constraint definitions, but just not in separate ALTER statements.table
- The table for which to generate the unique constraints fragmentcontext
- A context for SQL string generation", unique(col1, col2), unique( col20)"
. NOTE: The leading
comma is important!String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context)
uniqueKey
- The UniqueKey instance. Contains all information about the columnsmetadata
- Access to the bootstrap mapping informationcontext
- A context for SQL string generationString getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context)
uniqueKey
- The UniqueKey instance. Contains all information about the columnsmetadata
- Access to the bootstrap mapping informationcontext
- A context for SQL string generationCopyright © 2001-2021 Red Hat, Inc. All Rights Reserved.