类 DefaultUniqueDelegate
- java.lang.Object
-
- org.hibernate.dialect.unique.DefaultUniqueDelegate
-
- 所有已实现的接口:
UniqueDelegate
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.- 作者:
- Brett Meyer
-
-
构造器概要
构造器 构造器 说明 DefaultUniqueDelegate(Dialect dialect)Constructs DefaultUniqueDelegate
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)Get the SQL ALTER TABLE command to be used to create the given UniqueKey.StringgetAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.StringgetColumnDefinitionUniquenessFragment(Column column)Get the fragment that can be used to make a column unique as part of its column definition.protected StringgetDropUnique()StringgetTableCreationUniqueConstraintsFragment(Table table)Get the fragment that can be used to apply unique constraints as part of table creation.protected StringuniqueConstraintSql(UniqueKey uniqueKey)
-
-
-
字段详细资料
-
dialect
protected final Dialect dialect
-
-
构造器详细资料
-
DefaultUniqueDelegate
public DefaultUniqueDelegate(Dialect dialect)
Constructs DefaultUniqueDelegate- 参数:
dialect- The dialect for which we are handling unique constraints
-
-
方法详细资料
-
getColumnDefinitionUniquenessFragment
public String getColumnDefinitionUniquenessFragment(Column column)
从接口复制的说明:UniqueDelegateGet the fragment that can be used to make a column unique as part of its column definition. This is intended for dialects which do not support unique constraints- 指定者:
getColumnDefinitionUniquenessFragment在接口中UniqueDelegate- 参数:
column- The column to which to apply the unique- 返回:
- The fragment (usually "unique"), empty string indicates the uniqueness will be indicated using a different approach
-
getTableCreationUniqueConstraintsFragment
public String getTableCreationUniqueConstraintsFragment(Table table)
从接口复制的说明:UniqueDelegateGet the fragment that can be used to apply unique constraints as part of table creation. The implementation should iterate over theUniqueKeyinstances for the given table (seeTable.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.- 指定者:
getTableCreationUniqueConstraintsFragment在接口中UniqueDelegate- 参数:
table- The table for which to generate the unique constraints fragment- 返回:
- The fragment, typically in the form
", unique(col1, col2), unique( col20)". NOTE: The leading comma is important!
-
getAlterTableToAddUniqueKeyCommand
public String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)
从接口复制的说明:UniqueDelegateGet the SQL ALTER TABLE command to be used to create the given UniqueKey.- 指定者:
getAlterTableToAddUniqueKeyCommand在接口中UniqueDelegate- 参数:
uniqueKey- The UniqueKey instance. Contains all information about the columnsmetadata- Access to the bootstrap mapping information- 返回:
- The ALTER TABLE command
-
getAlterTableToDropUniqueKeyCommand
public String getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata)
从接口复制的说明:UniqueDelegateGet the SQL ALTER TABLE command to be used to drop the given UniqueKey.- 指定者:
getAlterTableToDropUniqueKeyCommand在接口中UniqueDelegate- 参数:
uniqueKey- The UniqueKey instance. Contains all information about the columnsmetadata- Access to the bootstrap mapping information- 返回:
- The ALTER TABLE command
-
getDropUnique
protected String getDropUnique()
-
-