Top Description Fields Constructors Methods
org.hibernate.dialect.unique

public Class DB2UniqueDelegate

extends DefaultUniqueDelegate
Class Inheritance
Imports
java.util.Iterator, org.hibernate.boot.Metadata, org.hibernate.boot.model.relational.SqlStringGenerationContext, org.hibernate.dialect.Dialect, org.hibernate.mapping.UniqueKey

DB2 does not allow unique constraints on nullable columns. Rather than forcing "not null", use unique *indexes* instead.
Author
Brett Meyer

Field Summary

Inherited from org.hibernate.dialect.unique.DefaultUniqueDelegate:
dialect

Constructor Summary

AccessConstructor and Description
public
DB2UniqueDelegate(Dialect
The dialect
dialect
)

Constructs a DB2UniqueDelegate

Method Summary

Modifier and TypeMethod and Description
public String
getAlterTableToAddUniqueKeyCommand(UniqueKey
The UniqueKey instance. Contains all information about the columns
uniqueKey
,
Metadata
Access to the bootstrap mapping information
metadata
,
SqlStringGenerationContext
A context for SQL string generation
context
)

Overrides org.hibernate.dialect.unique.DefaultUniqueDelegate.getAlterTableToAddUniqueKeyCommand.

Overrides default org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToAddUniqueKeyCommand.

Deprecated as a consequence of UniqueKey being deprecated.
Get the SQL ALTER TABLE command to be used to create the given UniqueKey.
public String
getAlterTableToDropUniqueKeyCommand(UniqueKey
The UniqueKey instance. Contains all information about the columns
uniqueKey
,
Metadata
Access to the bootstrap mapping information
metadata
,
SqlStringGenerationContext
A context for SQL string generation
context
)

Overrides org.hibernate.dialect.unique.DefaultUniqueDelegate.getAlterTableToDropUniqueKeyCommand.

Overrides default org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToDropUniqueKeyCommand.

Deprecated as a consequence of UniqueKey being deprecated.
Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.
private boolean
hasNullable(UniqueKey uniqueKey)

Deprecated as a consequence of UniqueKey being deprecated.
Inherited from org.hibernate.dialect.unique.DefaultUniqueDelegate:
getColumnDefinitionUniquenessFragmentgetDropUniquegetTableCreationUniqueConstraintsFragmentuniqueConstraintSql

Constructor Detail

DB2UniqueDelegateback to summary
public DB2UniqueDelegate(Dialect dialect)

Constructs a DB2UniqueDelegate

Parameters
dialect:Dialect

The dialect

Method Detail

getAlterTableToAddUniqueKeyCommandback to summary
public String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context)

Overrides org.hibernate.dialect.unique.DefaultUniqueDelegate.getAlterTableToAddUniqueKeyCommand.

Overrides default org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToAddUniqueKeyCommand.

Doc from org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToAddUniqueKeyCommand.

Deprecated

as a consequence of UniqueKey being deprecated. See corresponding docs for further information.

Get the SQL ALTER TABLE command to be used to create the given UniqueKey.

Parameters
uniqueKey:UniqueKey

The UniqueKey instance. Contains all information about the columns

metadata:Metadata

Access to the bootstrap mapping information

context:SqlStringGenerationContext

A context for SQL string generation

Returns:String

The ALTER TABLE command

Annotations
@Override
getAlterTableToDropUniqueKeyCommandback to summary
public String getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context)

Overrides org.hibernate.dialect.unique.DefaultUniqueDelegate.getAlterTableToDropUniqueKeyCommand.

Overrides default org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToDropUniqueKeyCommand.

Doc from org.hibernate.dialect.unique.UniqueDelegate.getAlterTableToDropUniqueKeyCommand.

Deprecated

as a consequence of UniqueKey being deprecated. See corresponding docs for further information.

Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.

Parameters
uniqueKey:UniqueKey

The UniqueKey instance. Contains all information about the columns

metadata:Metadata

Access to the bootstrap mapping information

context:SqlStringGenerationContext

A context for SQL string generation

Returns:String

The ALTER TABLE command

Annotations
@Override
hasNullableback to summary
private boolean hasNullable(UniqueKey uniqueKey)

Deprecated

as a consequence of UniqueKey being deprecated. See corresponding docs for further information.