Class AlterTableDropColumns

java.lang.Object
com.datastax.astra.client.tables.commands.AlterTableDropColumns
All Implemented Interfaces:
AlterTableOperation

public final class AlterTableDropColumns extends Object implements AlterTableOperation
Represents an operation to drop columns from a table in a database schema alteration. Implements the AlterTableOperation interface to specify the "drop" operation.

This class supports adding columns to be dropped, with an optional "if exists" clause.

Example usage:

 
 AlterTableDropColumns dropColumns = new AlterTableDropColumns()
      .ifExists()
      .columns("column3");
 
 
  • Constructor Details

    • AlterTableDropColumns

      public AlterTableDropColumns(String... name)
      Constructs a new AlterTableDropColumns instance with the specified column names.
      Parameters:
      name - the names of the columns to drop
    • AlterTableDropColumns

      public AlterTableDropColumns(Set<String> columns)
      Constructs a new AlterTableDropColumns instance with the specified set of column names.
      Parameters:
      columns - the set of column names to drop
  • Method Details

    • columns

      public AlterTableDropColumns columns(String... columns)
      Adds additional column names to the list of columns to drop.
      Parameters:
      columns - the names of the columns to add
      Returns:
      this AlterTableDropColumns instance
    • getOperationName

      public String getOperationName()
      Returns the name of this operation, which is "drop".
      Specified by:
      getOperationName in interface AlterTableOperation
      Returns:
      the operation name