use of org.springframework.data.cassandra.core.CassandraAdminOperations in project spring-data-cassandra by spring-projects.
the class SessionFactoryFactoryBean method performSchemaActions.
@SuppressWarnings("all")
private void performSchemaActions(boolean drop, boolean dropUnused, boolean ifNotExists) throws Exception {
CassandraAdminOperations adminOperations = new CassandraAdminTemplate(getObject(), this.converter);
CassandraPersistentEntitySchemaCreator schemaCreator = new CassandraPersistentEntitySchemaCreator(this.converter.getMappingContext(), adminOperations);
if (drop) {
CassandraPersistentEntitySchemaDropper schemaDropper = new CassandraPersistentEntitySchemaDropper(this.converter.getMappingContext(), adminOperations);
schemaDropper.dropTables(dropUnused);
schemaDropper.dropUserTypes(dropUnused);
}
schemaCreator.createUserTypes(ifNotExists);
schemaCreator.createTables(ifNotExists);
schemaCreator.createIndexes(ifNotExists);
}
Aggregations