Module spring.data.cassandra
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
ConstructorsConstructorDescriptionCassandraPersistentEntitySchemaCreator(CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreatorfor the givenCassandraMappingContextandCassandraAdminOperations.CassandraPersistentEntitySchemaCreator(CassandraMappingContext mappingContext, CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreatorfor the givenCassandraMappingContextandCassandraAdminOperations. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateIndexes(boolean ifNotExists) Create indexes from types known toCassandraMappingContext.protected List<CreateIndexSpecification>createIndexSpecifications(boolean ifNotExists) CreateListofCreateIndexSpecification.voidcreateTables(boolean ifNotExists) Create tables from types known toCassandraMappingContext.protected List<CreateTableSpecification>createTableSpecifications(boolean ifNotExists) CreateListofCreateTableSpecification.voidcreateUserTypes(boolean ifNotExists) Create user types from types known toCassandraMappingContext.protected List<CreateUserTypeSpecification>createUserTypeSpecifications(boolean ifNotExists) CreateListofCreateUserTypeSpecification.
-
Constructor Details
-
CassandraPersistentEntitySchemaCreator
Create a newCassandraPersistentEntitySchemaCreatorfor the givenCassandraMappingContextandCassandraAdminOperations.- Parameters:
cassandraAdminOperations- must not be null.- Since:
- 3.0
-
CassandraPersistentEntitySchemaCreator
public CassandraPersistentEntitySchemaCreator(CassandraMappingContext mappingContext, CassandraAdminOperations cassandraAdminOperations) Create a newCassandraPersistentEntitySchemaCreatorfor the givenCassandraMappingContextandCassandraAdminOperations.- 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
CreateListofCreateTableSpecification.- Parameters:
ifNotExists- true to create tables usingIF NOT EXISTS.- Returns:
ListofCreateTableSpecification.
-
createIndexes
public void createIndexes(boolean ifNotExists) Create indexes from types known toCassandraMappingContext.- Parameters:
ifNotExists- true to create tables usingIF NOT EXISTS.
-
createIndexSpecifications
CreateListofCreateIndexSpecification.- Parameters:
ifNotExists- true to create indexes usingIF NOT EXISTS.- Returns:
ListofCreateIndexSpecification.
-
createUserTypes
public void createUserTypes(boolean ifNotExists) Create user types from types known toCassandraMappingContext.- Parameters:
ifNotExists- true to create types usingIF NOT EXISTS.
-
createUserTypeSpecifications
CreateListofCreateUserTypeSpecification.- Parameters:
ifNotExists- true to create types usingIF NOT EXISTS.- Returns:
ListofCreateUserTypeSpecification.
-