Class AlterTableBuilder

All Implemented Interfaces:
ISqlBuilder, ISqlKeywords

public class AlterTableBuilder extends AbstractTableBuilder<AlterTableBuilder>
The Create Table Builder.
  • Constructor Details

    • AlterTableBuilder

      public AlterTableBuilder(ISqlDialect dialect, String table)
      Instantiates a new creates the table builder.
      Parameters:
      dialect - the dialect
      table - the table
  • Method Details

    • add

      public AlterTableBuilder add()
      Adds the.
      Returns:
      the alter table builder
    • alter

      public AlterTableBuilder alter()
      Alter.
      Returns:
      the alter table builder
    • drop

      public AlterTableBuilder drop()
      Drop.
      Returns:
      the alter table builder
    • getAction

      protected String getAction()
      Gets the action.
      Returns:
      the action
    • getForeignKeys

      public List<CreateTableForeignKeyBuilder> getForeignKeys()
      Gets the foreignKeys list.
      Returns:
      the foreignKeys
    • getUniqueIndices

      public List<CreateTableUniqueIndexBuilder> getUniqueIndices()
      Gets the unique indices.
      Returns:
      the unique indices
    • foreignKey

      public AlterTableBuilder foreignKey(String name, String[] columns, String referencedTable, String[] referencedColumns)
      Foreign Key.
      Parameters:
      name - the name of the foreign key
      columns - the local columns
      referencedTable - the reference table
      referencedColumns - the referenced columns
      Returns:
      the AlterTableBuilder object
    • unique

      public AlterTableBuilder unique(String name, String[] columns)
      Unique.
      Overrides:
      unique in class AbstractTableBuilder<AlterTableBuilder>
      Parameters:
      name - the name
      columns - the columns
      Returns:
      the alter table builder
    • unique

      public AlterTableBuilder unique(String name, String[] columns, String type, String order)
      Unique.
      Overrides:
      unique in class AbstractTableBuilder<AlterTableBuilder>
      Parameters:
      name - the name
      columns - the columns
      type - the type
      order - the order
      Returns:
      the alter table builder
    • generate

      public String generate()
      Generate.
      Returns:
      the string
    • generateForeignKeyNames

      protected void generateForeignKeyNames(StringBuilder sql)
      Generate foreign key names.
      Parameters:
      sql - the sql
    • generateUniqueIndices

      protected void generateUniqueIndices(StringBuilder sql)
      Generate unique indices.
      Parameters:
      sql - the sql
    • generateUniqueIndex

      protected void generateUniqueIndex(StringBuilder sql, CreateTableUniqueIndexBuilder uniqueIndex)
      Generate unique index.
      Parameters:
      sql - the sql
      uniqueIndex - the unique index