Interface CassandraAdminOperations
- All Superinterfaces:
CassandraOperations
,ExecutableDeleteOperation
,ExecutableInsertOperation
,ExecutableSelectOperation
,ExecutableUpdateOperation
,FluentCassandraOperations
- All Known Implementing Classes:
CassandraAdminTemplate
Operations for managing a Cassandra keyspace.
- Author:
- David Webb, Matthew T. Adams, Mark Paluch, Fabio J. Mendes, Mikhail Polivakha
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableDeleteOperation
ExecutableDeleteOperation.DeleteWithQuery, ExecutableDeleteOperation.DeleteWithTable, ExecutableDeleteOperation.ExecutableDelete, ExecutableDeleteOperation.TerminatingDelete
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableInsertOperation
ExecutableInsertOperation.ExecutableInsert<T>, ExecutableInsertOperation.InsertWithOptions<T>, ExecutableInsertOperation.InsertWithTable<T>, ExecutableInsertOperation.TerminatingInsert<T>
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableSelectOperation
ExecutableSelectOperation.ExecutableSelect<T>, ExecutableSelectOperation.SelectWithProjection<T>, ExecutableSelectOperation.SelectWithQuery<T>, ExecutableSelectOperation.SelectWithTable<T>, ExecutableSelectOperation.TerminatingSelect<T>
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableUpdateOperation
ExecutableUpdateOperation.ExecutableUpdate, ExecutableUpdateOperation.TerminatingUpdate, ExecutableUpdateOperation.UpdateWithQuery, ExecutableUpdateOperation.UpdateWithTable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.default void
createTable
(boolean ifNotExists, Class<?> entityClass) Create a table with the name, that is derived from the givenentityClass
and also fields corresponding to the same class.default void
createTable
(boolean ifNotExists, Class<?> entityClass, Map<String, Object> optionsByName) Create a table with the name, that is derived from the givenentityClass
and also fields corresponding to the same class.void
dropTable
(boolean ifExists, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Drops thenamed
table.void
dropTable
(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Drops thenamed
table.void
Drops a table based on the givenentity type
.void
dropUserType
(com.datastax.oss.driver.api.core.CqlIdentifier typeName) Drops a user type.com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata
ReturnsKeyspaceMetadata
for the current keyspace.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) LookupTableMetadata
.default Optional<com.datastax.oss.driver.api.core.metadata.schema.TableMetadata>
getTableMetadata
(String keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) LookupTableMetadata
.Methods inherited from interface org.springframework.data.cassandra.core.CassandraOperations
batchOps, batchOps, count, count, delete, delete, delete, delete, deleteById, execute, exists, exists, getConverter, getCqlOperations, getTableName, insert, insert, select, select, select, selectOne, selectOne, selectOne, selectOneById, slice, slice, stream, stream, stream, truncate, update, update, update
Methods inherited from interface org.springframework.data.cassandra.core.ExecutableDeleteOperation
delete
Methods inherited from interface org.springframework.data.cassandra.core.ExecutableInsertOperation
insert
Methods inherited from interface org.springframework.data.cassandra.core.ExecutableSelectOperation
query
Methods inherited from interface org.springframework.data.cassandra.core.ExecutableUpdateOperation
update
-
Method Details
-
getSchemaFactory
SchemaFactory getSchemaFactory()- Returns:
- the
SchemaFactory
. - Since:
- 3.0
-
createTable
Create a table with the name, that is derived from the givenentityClass
and also fields corresponding to the same class. If the table already exists and parameterifNotExists
is true, this is a no-op and false is returned. If the table doesn't exist, parameterifNotExists
is ignored, the table is created and true is returned.- Parameters:
ifNotExists
- iftrue
, create the table only if it doesn't exist.entityClass
- the class whose fields determine the columns created.- Since:
- 4.2
-
createTable
default void createTable(boolean ifNotExists, Class<?> entityClass, Map<String, Object> optionsByName) Create a table with the name, that is derived from the givenentityClass
and also fields corresponding to the same class. If the table already exists and parameterifNotExists
is true, this is a no-op and false is returned. If the table doesn't exist, parameterifNotExists
is ignored, the table is created and true is returned.- Parameters:
ifNotExists
- iftrue
, create the table only if it doesn't exist.entityClass
- the class whose fields determine the columns created.optionsByName
- table options, given by the string option name and the appropriate option value.- Since:
- 4.2
-
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 parameterifNotExists
is true, this is a no-op and false is returned. If the table doesn't exist, parameterifNotExists
is ignored, the table is created and true is returned.- Parameters:
ifNotExists
- iftrue
, create the table only if it doesn't exist.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
Drops a table based on the givenentity type
. The name of the table is derived from either the simple name of theentity class
or name of the table specified with theTable
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 thenamed
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 thenamed
table.- Parameters:
ifExists
- iftrue
, drop the table only if it exists.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()ReturnsKeyspaceMetadata
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) LookupTableMetadata
.- 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) LookupTableMetadata
.- Parameters:
keyspace
- must not be null.tableName
- must not be null.- Returns:
- the
TableMetadata
or null. - Since:
- 3.0
-