Class CassandraPersistentEntitySchemaCreator
java.lang.Object
org.springframework.data.cassandra.core.CassandraPersistentEntitySchemaCreator
Schema creation support for Cassandra based on
CassandraMappingContext
and CassandraPersistentEntity
.
This class generates CQL to create user types (UDT) and tables.- Since:
- 1.5
- Author:
- Mark Paluch, Jens Schauder
- See Also:
-
Constructor Summary
ConstructorDescriptionCassandraPersistentEntitySchemaCreator
(CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreator
for the givenCassandraMappingContext
andCassandraAdminOperations
.CassandraPersistentEntitySchemaCreator
(CassandraMappingContext mappingContext, CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreator
for the givenCassandraMappingContext
andCassandraAdminOperations
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createIndexes
(boolean ifNotExists) Create indexes from types known toCassandraMappingContext
.protected List<CreateIndexSpecification>
createIndexSpecifications
(boolean ifNotExists) CreateList
ofCreateIndexSpecification
.void
createTables
(boolean ifNotExists) Create tables from types known toCassandraMappingContext
.protected List<CreateTableSpecification>
createTableSpecifications
(boolean ifNotExists) CreateList
ofCreateTableSpecification
.void
createUserTypes
(boolean ifNotExists) Create user types from types known toCassandraMappingContext
.protected List<CreateUserTypeSpecification>
createUserTypeSpecifications
(boolean ifNotExists) CreateList
ofCreateUserTypeSpecification
.
-
Constructor Details
-
CassandraPersistentEntitySchemaCreator
Create a newCassandraPersistentEntitySchemaCreator
for the givenCassandraMappingContext
andCassandraAdminOperations
.- Parameters:
cassandraAdminOperations
- must not be null.- Since:
- 3.0
-
CassandraPersistentEntitySchemaCreator
public CassandraPersistentEntitySchemaCreator(CassandraMappingContext mappingContext, CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreator
for the givenCassandraMappingContext
andCassandraAdminOperations
.- Parameters:
mappingContext
- must not be null.cassandraAdminOperations
- must not be null.
-
-
Method Details
-
createTables
public void createTables(boolean ifNotExists) Create tables from types known toCassandraMappingContext
.- Parameters:
ifNotExists
- true to create tables usingIF NOT EXISTS
.
-
createTableSpecifications
CreateList
ofCreateTableSpecification
.- Parameters:
ifNotExists
- true to create tables usingIF NOT EXISTS
.- Returns:
List
ofCreateTableSpecification
.
-
createIndexes
public void createIndexes(boolean ifNotExists) Create indexes from types known toCassandraMappingContext
.- Parameters:
ifNotExists
- true to create tables usingIF NOT EXISTS
.
-
createIndexSpecifications
CreateList
ofCreateIndexSpecification
.- Parameters:
ifNotExists
- true to create indexes usingIF NOT EXISTS
.- Returns:
List
ofCreateIndexSpecification
.
-
createUserTypes
public void createUserTypes(boolean ifNotExists) Create user types from types known toCassandraMappingContext
.- Parameters:
ifNotExists
- true to create types usingIF NOT EXISTS
.
-
createUserTypeSpecifications
CreateList
ofCreateUserTypeSpecification
.- Parameters:
ifNotExists
- true to create types usingIF NOT EXISTS
.- Returns:
List
ofCreateUserTypeSpecification
.
-