Interface UniqueDelegate

    • Method Detail

      • getColumnDefinitionUniquenessFragment

        String getColumnDefinitionUniquenessFragment​(Column column)
        Get 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

        Parameters:
        column - The column to which to apply the unique
        Returns:
        The fragment (usually "unique"), empty string indicates the uniqueness will be indicated using a different approach
      • getTableCreationUniqueConstraintsFragment

        String getTableCreationUniqueConstraintsFragment​(Table table)
        Get the fragment that can be used to apply unique constraints as part of table creation. The implementation should iterate over the UniqueKey instances for the given table (see Table.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.

        Parameters:
        table - The table for which to generate the unique constraints fragment
        Returns:
        The fragment, typically in the form ", unique(col1, col2), unique( col20)". NOTE: The leading comma is important!
      • getAlterTableToAddUniqueKeyCommand

        String getAlterTableToAddUniqueKeyCommand​(UniqueKey uniqueKey,
                                                  Metadata metadata)
        Get the SQL ALTER TABLE command to be used to create the given UniqueKey.
        Parameters:
        uniqueKey - The UniqueKey instance. Contains all information about the columns
        metadata - Access to the bootstrap mapping information
        Returns:
        The ALTER TABLE command
      • getAlterTableToDropUniqueKeyCommand

        String getAlterTableToDropUniqueKeyCommand​(UniqueKey uniqueKey,
                                                   Metadata metadata)
        Get the SQL ALTER TABLE command to be used to drop the given UniqueKey.
        Parameters:
        uniqueKey - The UniqueKey instance. Contains all information about the columns
        metadata - Access to the bootstrap mapping information
        Returns:
        The ALTER TABLE command