public class CassandraAdminTemplate extends CassandraTemplate implements CassandraAdminOperations
CassandraAdminOperations.CassandraTemplate.PreparedStatementHandlerExecutableSelectOperation.ExecutableSelect<T>, ExecutableSelectOperation.SelectWithProjection<T>, ExecutableSelectOperation.SelectWithQuery<T>, ExecutableSelectOperation.SelectWithTable<T>, ExecutableSelectOperation.TerminatingSelect<T>ExecutableInsertOperation.ExecutableInsert<T>, ExecutableInsertOperation.InsertWithOptions<T>, ExecutableInsertOperation.InsertWithTable<T>, ExecutableInsertOperation.TerminatingInsert<T>ExecutableUpdateOperation.ExecutableUpdate, ExecutableUpdateOperation.TerminatingUpdate, ExecutableUpdateOperation.UpdateWithQuery, ExecutableUpdateOperation.UpdateWithTableExecutableDeleteOperation.DeleteWithQuery, ExecutableDeleteOperation.DeleteWithTable, ExecutableDeleteOperation.ExecutableDelete, ExecutableDeleteOperation.TerminatingDelete| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DEFAULT_DROP_TABLE_IF_EXISTS |
| Constructor and Description |
|---|
CassandraAdminTemplate(CqlOperations cqlOperations,
CassandraConverter converter)
Constructor used for a basic template configuration.
|
CassandraAdminTemplate(com.datastax.oss.driver.api.core.CqlSession session)
Constructor used for a basic template configuration.
|
CassandraAdminTemplate(com.datastax.oss.driver.api.core.CqlSession session,
CassandraConverter converter)
Constructor used for a basic template configuration.
|
CassandraAdminTemplate(SessionFactory sessionFactory,
CassandraConverter converter)
Constructor used for a basic template configuration.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
dropTable(boolean ifExists,
com.datastax.oss.driver.api.core.CqlIdentifier tableName)
Drops the
named table. |
void |
dropTable(Class<?> entityClass)
Drops a table based on the given
entity type. |
void |
dropTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
Drops the
named table. |
void |
dropUserType(com.datastax.oss.driver.api.core.CqlIdentifier typeName)
Drops a user type.
|
com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata |
getKeyspaceMetadata()
Returns
KeyspaceMetadata for the current keyspace. |
SchemaFactory |
getSchemaFactory() |
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. |
batchOps, count, count, delete, delete, delete, delete, deleteById, execute, exists, exists, getConverter, getCqlOperations, getEntityOperations, getProjectionFactory, getStatementFactory, getTableName, insert, insert, insert, isUsePreparedStatements, maybeCallBeforeConvert, maybeCallBeforeSave, maybeEmitEvent, query, select, select, select, selectOne, selectOne, selectOne, selectOneById, setApplicationContext, setApplicationEventPublisher, setEntityCallbacks, setUsePreparedStatements, slice, slice, stream, stream, stream, truncate, update, update, update, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTableMetadatabatchOps, 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, updatequeryinsertupdatedeleteprotected static final boolean DEFAULT_DROP_TABLE_IF_EXISTS
public CassandraAdminTemplate(com.datastax.oss.driver.api.core.CqlSession session)
session - must not be null.public CassandraAdminTemplate(com.datastax.oss.driver.api.core.CqlSession session,
CassandraConverter converter)
session - must not be null.converter - must not be null.public CassandraAdminTemplate(SessionFactory sessionFactory, CassandraConverter converter)
sessionFactory - must not be null.converter - must not be null.public CassandraAdminTemplate(CqlOperations cqlOperations, CassandraConverter converter)
cqlOperations - must not be null.converter - must not be null.public SchemaFactory getSchemaFactory()
getSchemaFactory in interface CassandraAdminOperationsSchemaFactory.public void createTable(boolean ifNotExists,
com.datastax.oss.driver.api.core.CqlIdentifier tableName,
Class<?> entityClass,
Map<String,Object> optionsByName)
CassandraAdminOperationsifNotExists 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.createTable in interface CassandraAdminOperationsifNotExists - 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.public void dropTable(Class<?> entityClass)
CassandraAdminOperationsentity 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.dropTable in interface CassandraAdminOperationsentityClass - type of the entity for which the table will be dropped.public void dropTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
CassandraAdminOperationsnamed table.dropTable in interface CassandraAdminOperationstableName - Name of the table to drop.CassandraAdminOperations.dropTable(boolean, CqlIdentifier)public void dropTable(boolean ifExists,
com.datastax.oss.driver.api.core.CqlIdentifier tableName)
CassandraAdminOperationsnamed table.dropTable in interface CassandraAdminOperationsifExists - If true, will only drop the table if it exists, else the drop operation will be ignored.tableName - Name of the table to drop.public void dropUserType(com.datastax.oss.driver.api.core.CqlIdentifier typeName)
CassandraAdminOperationsdropUserType in interface CassandraAdminOperationstypeName - must not be null.public 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)
CassandraAdminOperationsTableMetadata.getTableMetadata in interface CassandraAdminOperationskeyspace - must not be null.tableName - must not be null.TableMetadata or null.public com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata getKeyspaceMetadata()
CassandraAdminOperationsKeyspaceMetadata for the current keyspace.getKeyspaceMetadata in interface CassandraAdminOperationsKeyspaceMetadata for the current keyspace.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.