Class DelegatingUniqueDelegate
java.lang.Object
org.hibernate.dialect.unique.spi.DelegatingUniqueDelegate
- All Implemented Interfaces:
UniqueDelegate
@SPI({USE,IMPLEMENT})
public abstract class DelegatingUniqueDelegate
extends Object
implements UniqueDelegate
Supported base for a provider which decorates another unique-key strategy.
Override only the operations whose database grammar differs. All other operations, including representation and capability answers, are forwarded.
- Since:
- 8.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDelegatingUniqueDelegate(UniqueDelegate delegate) Construct a decorator which forwards to the given strategy. -
Method Summary
Modifier and TypeMethodDescriptionprotected final UniqueDelegatedelegate()getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Render the complete command which adds the unique key.getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Render the complete command which drops the unique key previously emitted byUniqueDelegate.getAlterTableToAddUniqueKeyCommand(UniqueKey, Metadata, SqlStringGenerationContext).getColumnDefinitionUniquenessFragment(Column column, SqlStringGenerationContext context) Render the column-definition uniqueness fragment for a column explicitly marked [Column#isUnique() unique].getTableCreationUniqueConstraintsFragment(Table table, SqlStringGenerationContext context) Render all unique declarations embedded increate table.Select whether a logical unique declaration is represented as a constraint or an index.booleanWhether this delegate can rendernulls not distinctfor a requested unique constraint.
-
Constructor Details
-
DelegatingUniqueDelegate
Construct a decorator which forwards to the given strategy.
-
-
Method Details
-
delegate
-
representation
Description copied from interface:UniqueDelegateSelect whether a logical unique declaration is represented as a constraint or an index.- Specified by:
representationin interfaceUniqueDelegate
-
supportsNullsNotDistinct
public boolean supportsNullsNotDistinct()Description copied from interface:UniqueDelegateWhether this delegate can rendernulls not distinctfor a requested unique constraint.- Specified by:
supportsNullsNotDistinctin interfaceUniqueDelegate
-
getColumnDefinitionUniquenessFragment
public String getColumnDefinitionUniquenessFragment(Column column, SqlStringGenerationContext context) Description copied from interface:UniqueDelegateRender the column-definition uniqueness fragment for a column explicitly marked [Column#isUnique() unique]. Return an empty string when uniqueness belongs at another emission point.- Specified by:
getColumnDefinitionUniquenessFragmentin interfaceUniqueDelegate
-
getTableCreationUniqueConstraintsFragment
public String getTableCreationUniqueConstraintsFragment(Table table, SqlStringGenerationContext context) Description copied from interface:UniqueDelegateRender all unique declarations embedded increate table. Include the required leading comma, or return an empty string when no declaration is emitted at this point.- Specified by:
getTableCreationUniqueConstraintsFragmentin interfaceUniqueDelegate
-
getAlterTableToAddUniqueKeyCommand
public String getAlterTableToAddUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Description copied from interface:UniqueDelegateRender the complete command which adds the unique key. Return an empty string when it was already emitted during table creation or is unsupported.- Specified by:
getAlterTableToAddUniqueKeyCommandin interfaceUniqueDelegate
-
getAlterTableToDropUniqueKeyCommand
public String getAlterTableToDropUniqueKeyCommand(UniqueKey uniqueKey, Metadata metadata, SqlStringGenerationContext context) Description copied from interface:UniqueDelegateRender the complete command which drops the unique key previously emitted byUniqueDelegate.getAlterTableToAddUniqueKeyCommand(UniqueKey, Metadata, SqlStringGenerationContext). Return an empty string when no corresponding database object was created.- Specified by:
getAlterTableToDropUniqueKeyCommandin interfaceUniqueDelegate
-