Interface CassandraAdminOperations

All Superinterfaces:
CassandraOperations, ExecutableDeleteOperation, ExecutableInsertOperation, ExecutableSelectOperation, ExecutableUpdateOperation, FluentCassandraOperations
All Known Implementing Classes:
CassandraAdminTemplate

public interface CassandraAdminOperations extends CassandraOperations
Operations for managing a Cassandra keyspace.
Author:
David Webb, Matthew T. Adams, Mark Paluch, Fabio J. Mendes
  • Method Details

    • getSchemaFactory

      SchemaFactory getSchemaFactory()
      Returns:
      the SchemaFactory.
      Since:
      3.0
    • createTable

      void createTable(boolean ifNotExists, com.datastax.oss.driver.api.core.CqlIdentifier tableName, Class<?> entityClass, Map<String,Object> optionsByName)
      Create a table with the name given and fields corresponding to the given class. If the table already exists and parameter ifNotExists is true, this is a no-op and false is returned. If the table doesn't exist, parameter ifNotExists is ignored, the table is created and true is returned.
      Parameters:
      ifNotExists - If true, will only create the table if it doesn't exist, else the create operation will be ignored.
      tableName - The name of the table.
      entityClass - The class whose fields determine the columns created.
      optionsByName - Table options, given by the string option name and the appropriate option value.
    • dropTable

      void dropTable(Class<?> entityType)
      Drops a table based on the given entity type. The name of the table is derived from either the simple name of the entity class or name of the table specified with the Table mapping annotation.
      Parameters:
      entityType - type of the entity for which the table will be dropped.
    • dropTable

      void dropTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Drops the named table.
      Parameters:
      tableName - Name of the table to drop.
      See Also:
    • dropTable

      void dropTable(boolean ifExists, com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Drops the named table.
      Parameters:
      ifExists - If true, will only drop the table if it exists, else the drop operation will be ignored.
      tableName - Name of the table to drop.
      Since:
      2.1
    • dropUserType

      void dropUserType(com.datastax.oss.driver.api.core.CqlIdentifier typeName)
      Drops a user type.
      Parameters:
      typeName - must not be null.
      Since:
      1.5
    • getKeyspaceMetadata

      com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata getKeyspaceMetadata()
      Returns KeyspaceMetadata for the current keyspace.
      Returns:
      KeyspaceMetadata for the current keyspace.
      Since:
      1.5
    • getTableMetadata

      default Optional<com.datastax.oss.driver.api.core.metadata.schema.TableMetadata> getTableMetadata(String keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Lookup TableMetadata.
      Parameters:
      keyspace - must not be empty or null.
      tableName - must not be null.
      Returns:
      the TableMetadata or null.
    • getTableMetadata

      Optional<com.datastax.oss.driver.api.core.metadata.schema.TableMetadata> getTableMetadata(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Lookup TableMetadata.
      Parameters:
      keyspace - must not be null.
      tableName - must not be null.
      Returns:
      the TableMetadata or null.
      Since:
      3.0