org.hibernate.dialect.unique
Interface UniqueDelegate

All Known Implementing Classes:
DB2UniqueDelegate, DefaultUniqueDelegate, InformixUniqueDelegate

public interface UniqueDelegate

Dialect-level delegate in charge of applying "uniqueness" to a column. Uniqueness can be defined in 1 of 3 ways: 1.) Add a unique constraint via separate alter table statements. 2.) Add a unique constraint via dialect-specific syntax in table create statement. 3.) Add "unique" syntax to the column itself. #1 & #2 are preferred, if possible -- #3 should be solely a fall-back. TODO: This could eventually be simplified. With AST, 1 "applyUniqueness" method might be possible. But due to .cfg and .mapping still resolving around StringBuilders, separate methods were needed. See HHH-7797.


Method Summary
 String applyUniquesOnAlter(UniqueKey uniqueKey)
          If creating unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.
 String applyUniquesOnAlter(UniqueKey uniqueKey, String defaultCatalog, String defaultSchema)
          If creating unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.
 String applyUniquesToTable(Table table)
          If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.
 String applyUniquesToTable(Table table)
          If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.
 String applyUniqueToColumn(Column column)
          If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").
 String applyUniqueToColumn(Column column)
          If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").
 String dropUniquesOnAlter(UniqueKey uniqueKey)
          If dropping unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.
 String dropUniquesOnAlter(UniqueKey uniqueKey, String defaultCatalog, String defaultSchema)
          If dropping unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.
 String uniqueConstraintSql(UniqueKey uniqueKey)
          Generates the syntax necessary to create the unique constraint (reused by all methods).
 String uniqueConstraintSql(UniqueKey uniqueKey)
          Generates the syntax necessary to create the unique constraint (reused by all methods).
 

Method Detail

applyUniqueToColumn

String applyUniqueToColumn(Column column)
If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").

Parameters:
column -
Returns:
String

applyUniqueToColumn

String applyUniqueToColumn(Column column)
If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").

Parameters:
column -
Returns:
String

applyUniquesToTable

String applyUniquesToTable(Table table)
If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.

Parameters:
table -
Returns:
String

applyUniquesToTable

String applyUniquesToTable(Table table)
If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.

Parameters:
table -
Returns:
String

applyUniquesOnAlter

String applyUniquesOnAlter(UniqueKey uniqueKey,
                           String defaultCatalog,
                           String defaultSchema)
If creating unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Parameters:
uniqueKey -
defaultCatalog -
defaultSchema -
Returns:
String

applyUniquesOnAlter

String applyUniquesOnAlter(UniqueKey uniqueKey)
If creating unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Parameters:
uniqueKey -
Returns:
String

dropUniquesOnAlter

String dropUniquesOnAlter(UniqueKey uniqueKey,
                          String defaultCatalog,
                          String defaultSchema)
If dropping unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Parameters:
uniqueKey -
defaultCatalog -
defaultSchema -
Returns:
String

dropUniquesOnAlter

String dropUniquesOnAlter(UniqueKey uniqueKey)
If dropping unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Parameters:
uniqueKey -
Returns:
String

uniqueConstraintSql

String uniqueConstraintSql(UniqueKey uniqueKey)
Generates the syntax necessary to create the unique constraint (reused by all methods). Ex: "unique (column1, column2, ...)"

Parameters:
uniqueKey -
Returns:
String

uniqueConstraintSql

String uniqueConstraintSql(UniqueKey uniqueKey)
Generates the syntax necessary to create the unique constraint (reused by all methods). Ex: "unique (column1, column2, ...)"

Parameters:
uniqueKey -
Returns:
String


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.