Package org.springframework.data.cassandra.core

Examples of org.springframework.data.cassandra.core.CassandraAdminTemplate


   *
   * @throws Exception
   */
  @Bean
  public CassandraAdminOperations cassandraTemplate() throws Exception {
    return new CassandraAdminTemplate(session().getObject(), cassandraConverter());
  }
View Full Code Here


    super.afterPropertiesSet();

    Assert.notNull(converter);

    admin = new CassandraAdminTemplate(session, converter);

    performSchemaAction();
  }
View Full Code Here

  @Produces
  public CassandraOperations createCassandraOperations() throws Exception {
    String keySpace = AbstractEmbeddedCassandraIntegrationTest.randomKeyspaceName();

    MappingCassandraConverter cassandraConverter = new MappingCassandraConverter();
    CassandraAdminTemplate cassandraTemplate = new CassandraAdminTemplate(AbstractEmbeddedCassandraIntegrationTest
        .cluster().connect(), cassandraConverter);

    CreateKeyspaceSpecification createKeyspaceSpecification = new CreateKeyspaceSpecification(keySpace).ifNotExists();
    cassandraTemplate.execute(createKeyspaceSpecification);
    cassandraTemplate.execute("USE " + keySpace);

    cassandraTemplate.createTable(true, CqlIdentifier.cqlId("users"), User.class, new HashMap<String, Object>());

    for (CassandraPersistentEntity<?> entity : cassandraTemplate.getConverter().getMappingContext()
        .getPersistentEntities()) {
      cassandraTemplate.truncate(entity.getTableName());
    }

    return cassandraTemplate;
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.cassandra.core.CassandraAdminTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.