public class CassandraAdminTemplate extends CassandraTemplate implements CassandraAdminOperations
CassandraAdminOperations
.Constructor and Description |
---|
CassandraAdminTemplate(com.datastax.driver.core.Session 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,
CqlIdentifier tableName,
Class<?> entityClass,
Map<String,Object> optionsByName)
Create a table with the name given and fields corresponding to the given class.
|
void |
dropTable(Class<?> entityClass) |
void |
dropTable(CqlIdentifier tableName)
Drops the named table.
|
void |
dropUserType(CqlIdentifier typeName)
Drops a user type.
|
com.datastax.driver.core.KeyspaceMetadata |
getKeyspaceMetadata()
Returns
KeyspaceMetadata for the current keyspace. |
Optional<com.datastax.driver.core.TableMetadata> |
getTableMetadata(String keyspace,
CqlIdentifier tableName)
Lookup
TableMetadata . |
batchOps, count, delete, delete, delete, deleteById, exists, getConverter, getCqlOperations, getMappingContext, getStatementFactory, getTableName, insert, insert, select, select, select, selectOne, selectOne, selectOne, selectOneById, slice, slice, stream, stream, stream, truncate, update, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
batchOps, count, delete, delete, delete, deleteById, exists, getConverter, getCqlOperations, getTableName, insert, insert, select, select, select, selectOne, selectOne, selectOne, selectOneById, slice, slice, stream, stream, stream, truncate, update, update, update
public CassandraAdminTemplate(com.datastax.driver.core.Session 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 void createTable(boolean ifNotExists, CqlIdentifier tableName, Class<?> entityClass, Map<String,Object> optionsByName)
CassandraAdminOperations
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.createTable
in interface CassandraAdminOperations
ifNotExists
- If true, will only create the table if it doesn't exist, else the create operation will be
ignored and the method will return false.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)
public void dropTable(CqlIdentifier tableName)
CassandraAdminOperations
dropTable
in interface CassandraAdminOperations
tableName
- The name of the table.public void dropUserType(CqlIdentifier typeName)
CassandraAdminOperations
dropUserType
in interface CassandraAdminOperations
typeName
- must not be null.public Optional<com.datastax.driver.core.TableMetadata> getTableMetadata(String keyspace, CqlIdentifier tableName)
CassandraAdminOperations
TableMetadata
.getTableMetadata
in interface CassandraAdminOperations
keyspace
- must not be empty or null.tableName
- must not be null.TableMetadata
or null.public com.datastax.driver.core.KeyspaceMetadata getKeyspaceMetadata()
CassandraAdminOperations
KeyspaceMetadata
for the current keyspace.getKeyspaceMetadata
in interface CassandraAdminOperations
KeyspaceMetadata
for the current keyspace.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.