org.hibernate.dialect.unique
Class DefaultUniqueDelegate

java.lang.Object
  extended by org.hibernate.dialect.unique.DefaultUniqueDelegate
All Implemented Interfaces:
UniqueDelegate
Direct Known Subclasses:
DB2UniqueDelegate, InformixUniqueDelegate

public class DefaultUniqueDelegate
extends Object
implements UniqueDelegate

The default UniqueDelegate implementation for most dialects. Uses separate create/alter statements to apply uniqueness to a column.


Field Summary
protected  Dialect dialect
           
 
Constructor Summary
DefaultUniqueDelegate(Dialect dialect)
           
 
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dialect

protected final Dialect dialect
Constructor Detail

DefaultUniqueDelegate

public DefaultUniqueDelegate(Dialect dialect)
Method Detail

applyUniqueToColumn

public String applyUniqueToColumn(Column column)
Description copied from interface: UniqueDelegate
If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").

Specified by:
applyUniqueToColumn in interface UniqueDelegate
Returns:
String

applyUniqueToColumn

public String applyUniqueToColumn(Column column)
Description copied from interface: UniqueDelegate
If the dialect does not supports unique constraints, this method should return the syntax necessary to mutate the column definition (usually "unique").

Specified by:
applyUniqueToColumn in interface UniqueDelegate
Returns:
String

applyUniquesToTable

public String applyUniquesToTable(Table table)
Description copied from interface: UniqueDelegate
If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.

Specified by:
applyUniquesToTable in interface UniqueDelegate
Returns:
String

applyUniquesToTable

public String applyUniquesToTable(Table table)
Description copied from interface: UniqueDelegate
If constraints are supported, but not in seperate alter statements, return uniqueConstraintSql in order to add the constraint to the original table definition.

Specified by:
applyUniquesToTable in interface UniqueDelegate
Returns:
String

applyUniquesOnAlter

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

Specified by:
applyUniquesOnAlter in interface UniqueDelegate
Returns:
String

applyUniquesOnAlter

public String applyUniquesOnAlter(UniqueKey uniqueKey)
Description copied from interface: UniqueDelegate
If creating unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Specified by:
applyUniquesOnAlter in interface UniqueDelegate
Returns:
String

dropUniquesOnAlter

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

Specified by:
dropUniquesOnAlter in interface UniqueDelegate
Returns:
String

dropUniquesOnAlter

public String dropUniquesOnAlter(UniqueKey uniqueKey)
Description copied from interface: UniqueDelegate
If dropping unique constraints in separate alter statements is supported, generate the necessary "alter" syntax for the given key.

Specified by:
dropUniquesOnAlter in interface UniqueDelegate
Returns:
String

uniqueConstraintSql

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

Specified by:
uniqueConstraintSql in interface UniqueDelegate
Returns:
String

uniqueConstraintSql

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

Specified by:
uniqueConstraintSql in interface UniqueDelegate
Returns:
String


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