Class AlterTableSpecification

All Implemented Interfaces:
CqlSpecification

public class AlterTableSpecification extends TableOptionsSpecification<AlterTableSpecification> implements CqlSpecification
Object to configure a ALTER TABLE specification.
Author:
Matthew T. Adams, Mark Paluch
See Also:
  • Method Details

    • alterTable

      public static AlterTableSpecification alterTable(String tableName)
      Entry point into the AlterTableSpecification's fluent API given tableName to alter a table. Convenient if imported statically.
      Parameters:
      tableName - must not be null or empty.
      Returns:
      a new AlterTableSpecification.
    • alterTable

      public static AlterTableSpecification alterTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Entry point into the AlterTableSpecification's fluent API given tableName to alter a table. Convenient if imported statically.
      Parameters:
      tableName - must not be null.
      Returns:
      a new AlterTableSpecification.
    • alterTable

      public static AlterTableSpecification alterTable(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Entry point into the AlterTableSpecification's fluent API given tableName to alter a table. Convenient if imported statically. Uses the default keyspace if keyspace is null; otherwise, of the keyspace is not {@link null}, then the table name is prefixed with keyspace.
      Parameters:
      keyspace - can be null.
      tableName - must not be null.
      Returns:
      a new AlterTableSpecification.
      Since:
      4.4
    • add

      public AlterTableSpecification add(String column, com.datastax.oss.driver.api.core.type.DataType type)
      Adds an ADD to the list of column changes.
      Parameters:
      column - must not be null or empty.
      type - must not be null.
      Returns:
      this AlterTableSpecification.
    • add

      public AlterTableSpecification add(com.datastax.oss.driver.api.core.CqlIdentifier column, com.datastax.oss.driver.api.core.type.DataType type)
      Adds an ADD to the list of column changes.
      Parameters:
      column - must not be null.
      type - must not be null.
      Returns:
      this AlterTableSpecification.
      Since:
      2.0
    • drop

      public AlterTableSpecification drop(String column)
    • drop

      public AlterTableSpecification drop(com.datastax.oss.driver.api.core.CqlIdentifier column)
    • rename

      public AlterTableSpecification rename(String from, String to)
      Adds a RENAME to the list of column changes.
      Parameters:
      from - must not be null or empty.
      to - must not be null or empty.
      Returns:
      this AlterTableSpecification.
    • rename

      public AlterTableSpecification rename(com.datastax.oss.driver.api.core.CqlIdentifier from, com.datastax.oss.driver.api.core.CqlIdentifier to)
      Adds a RENAME to the list of column changes.
      Parameters:
      from - must not be null.
      to - must not be null.
      Returns:
      this AlterTableSpecification.
      Since:
      2.0
    • alter

      public AlterTableSpecification alter(String column, com.datastax.oss.driver.api.core.type.DataType type)
      Adds an ALTER to the list of column changes.
      Parameters:
      column - must not be null or empty
      type - must not be null
      Returns:
      this AlterTableSpecification.
    • alter

      public AlterTableSpecification alter(com.datastax.oss.driver.api.core.CqlIdentifier column, com.datastax.oss.driver.api.core.type.DataType type)
      Adds an ALTER to the list of column changes.
      Parameters:
      column - must not be null.
      type - must not be null.
      Returns:
      this AlterTableSpecification.
      Since:
      2.0
    • getChanges

      public List<ColumnChangeSpecification> getChanges()
      Returns an unmodifiable list of column changes.