DATACASS-74 - Renamed Core Template Classes
This commit is contained in:
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
import org.springframework.cassandra.core.cql.generator.CreateKeyspaceCqlGenerator;
|
||||
import org.springframework.cassandra.core.cql.generator.DropKeyspaceCqlGenerator;
|
||||
import org.springframework.cassandra.core.keyspace.CreateKeyspaceSpecification;
|
||||
@@ -220,12 +220,12 @@ public class CassandraClusterFactoryBean implements FactoryBean<Cluster>, Initia
|
||||
protected void executeSpecsAndScripts(@SuppressWarnings("rawtypes") List specs, List<String> scripts) {
|
||||
|
||||
Session system = null;
|
||||
CassandraTemplate template = null;
|
||||
CqlTemplate template = null;
|
||||
|
||||
try {
|
||||
if (specs != null) {
|
||||
system = specs.size() == 0 ? null : cluster.connect();
|
||||
template = system == null ? null : new CassandraTemplate(system);
|
||||
template = system == null ? null : new CqlTemplate(system);
|
||||
|
||||
Iterator<?> i = specs.iterator();
|
||||
while (i.hasNext()) {
|
||||
@@ -249,7 +249,7 @@ public class CassandraClusterFactoryBean implements FactoryBean<Cluster>, Initia
|
||||
}
|
||||
|
||||
if (template == null) {
|
||||
template = system == null ? null : new CassandraTemplate(system);
|
||||
template = system == null ? null : new CqlTemplate(system);
|
||||
}
|
||||
|
||||
for (String script : scripts) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
import org.springframework.cassandra.support.CassandraExceptionTranslator;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.dao.support.PersistenceExceptionTranslator;
|
||||
@@ -93,7 +93,7 @@ public class CassandraSessionFactoryBean implements FactoryBean<Session>, Initia
|
||||
return;
|
||||
}
|
||||
|
||||
CassandraTemplate template = new CassandraTemplate(session);
|
||||
CqlTemplate template = new CqlTemplate(session);
|
||||
|
||||
for (String script : scripts) {
|
||||
|
||||
|
||||
@@ -17,29 +17,29 @@ package org.springframework.cassandra.config;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
|
||||
import com.datastax.driver.core.Session;
|
||||
|
||||
/**
|
||||
* Factory for configuring a {@link CassandraTemplate}.
|
||||
* Factory for configuring a {@link CqlTemplate}.
|
||||
*
|
||||
* @author Matthew T. Adams
|
||||
*/
|
||||
public class CassandraTemplateFactoryBean implements FactoryBean<CassandraOperations>, InitializingBean {
|
||||
public class CassandraTemplateFactoryBean implements FactoryBean<CqlOperations>, InitializingBean {
|
||||
|
||||
private CassandraTemplate template;
|
||||
private CqlTemplate template;
|
||||
private Session session;
|
||||
|
||||
@Override
|
||||
public CassandraOperations getObject() {
|
||||
public CqlOperations getObject() {
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends CassandraOperations> getObjectType() {
|
||||
return CassandraOperations.class;
|
||||
public Class<? extends CqlOperations> getObjectType() {
|
||||
return CqlOperations.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +54,7 @@ public class CassandraTemplateFactoryBean implements FactoryBean<CassandraOperat
|
||||
throw new IllegalStateException("session is required");
|
||||
}
|
||||
|
||||
this.template = new CassandraTemplate(session);
|
||||
this.template = new CqlTemplate(session);
|
||||
}
|
||||
|
||||
public void setSession(Session session) {
|
||||
|
||||
@@ -33,7 +33,7 @@ import com.datastax.driver.core.Session;
|
||||
* @author David Webb
|
||||
* @author Matthew Adams
|
||||
*/
|
||||
public interface CassandraOperations {
|
||||
public interface CqlOperations {
|
||||
|
||||
/**
|
||||
* Executes the supplied {@link SessionCallback} in the current Template Session. The implementation of
|
||||
@@ -63,13 +63,13 @@ import com.datastax.driver.core.querybuilder.Truncate;
|
||||
* @author David Webb
|
||||
* @author Matthew Adams
|
||||
*/
|
||||
public class CassandraTemplate extends CassandraAccessor implements CassandraOperations {
|
||||
public class CqlTemplate extends CassandraAccessor implements CqlOperations {
|
||||
|
||||
/**
|
||||
* Blank constructor. You must wire in the Session before use.
|
||||
*
|
||||
*/
|
||||
public CassandraTemplate() {
|
||||
public CqlTemplate() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ public class CassandraTemplate extends CassandraAccessor implements CassandraOpe
|
||||
*
|
||||
* @param session must not be {@literal null}.
|
||||
*/
|
||||
public CassandraTemplate(Session session) {
|
||||
public CqlTemplate(Session session) {
|
||||
setSession(session);
|
||||
afterPropertiesSet();
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import javax.inject.Inject;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
|
||||
import org.springframework.cassandra.test.integration.config.IntegrationTestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -28,7 +28,7 @@ public class MinimalXmlConfigTest extends AbstractKeyspaceCreatingIntegrationTes
|
||||
Session s;
|
||||
|
||||
@Inject
|
||||
CassandraOperations ops;
|
||||
CqlOperations ops;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import javax.inject.Inject;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
|
||||
import org.springframework.cassandra.test.integration.config.IntegrationTestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -22,7 +22,7 @@ public class PropertyPlaceholderNamespaceCreatingXmlConfigTest extends AbstractK
|
||||
Session s;
|
||||
|
||||
@Inject
|
||||
CassandraOperations ops;
|
||||
CqlOperations ops;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
@@ -35,8 +35,8 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
import org.springframework.cassandra.core.ConsistencyLevel;
|
||||
import org.springframework.cassandra.core.HostMapper;
|
||||
import org.springframework.cassandra.core.PreparedStatementBinder;
|
||||
@@ -64,14 +64,14 @@ import com.datastax.driver.core.Session;
|
||||
import com.datastax.driver.core.exceptions.DriverException;
|
||||
|
||||
/**
|
||||
* Unit Tests for CassandraTemplate
|
||||
* Unit Tests for CqlTemplate
|
||||
*
|
||||
* @author David Webb
|
||||
*
|
||||
*/
|
||||
public class CassandraOperationsTest extends AbstractKeyspaceCreatingIntegrationTest {
|
||||
|
||||
private static CassandraOperations cassandraTemplate;
|
||||
private static CqlOperations cassandraTemplate;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(CassandraOperationsTest.class);
|
||||
|
||||
@@ -110,7 +110,7 @@ public class CassandraOperationsTest extends AbstractKeyspaceCreatingIntegration
|
||||
// "cassandraOperationsTest-cql-dataload.cql", keyspace), CASSANDRA_CONFIG, CASSANDRA_HOST,
|
||||
// CASSANDRA_NATIVE_PORT);
|
||||
|
||||
cassandraTemplate = new CassandraTemplate(SESSION);
|
||||
cassandraTemplate = new CqlTemplate(SESSION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ public class CassandraOperationsTest extends AbstractKeyspaceCreatingIntegration
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an implementation of RowIterator for the purposes of testing passing your own Impl to CassandraTemplate
|
||||
* This is an implementation of RowIterator for the purposes of testing passing your own Impl to CqlTemplate
|
||||
*
|
||||
* @author David Webb
|
||||
*/
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
keyspace-name="system">
|
||||
</cassandra:session>
|
||||
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CassandraTemplate">
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CqlTemplate">
|
||||
<constructor-arg ref="cassandra-session" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<cassandra:session id="cassandra-session"
|
||||
keyspace-name="xmlconfigtest" />
|
||||
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CassandraTemplate">
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CqlTemplate">
|
||||
<constructor-arg ref="cassandra-session" />
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.datastax.driver.core.querybuilder.Select;
|
||||
* @author Matthew Adams
|
||||
*
|
||||
*/
|
||||
public interface CassandraDataOperations {
|
||||
public interface CassandraOperations {
|
||||
|
||||
/**
|
||||
* The table name used for the specified class by this template.
|
||||
@@ -23,7 +23,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
import org.springframework.cassandra.core.QueryOptions;
|
||||
import org.springframework.cassandra.core.SessionCallback;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -47,12 +47,12 @@ import com.datastax.driver.core.querybuilder.Select;
|
||||
|
||||
/**
|
||||
* The Cassandra Data Template is a convenience API for all Cassandra Operations using POJOs. This is the "Spring Data"
|
||||
* flavor of the template. For low level Cassandra Operations use the {@link CassandraTemplate}
|
||||
* flavor of the template. For low level Cassandra Operations use the {@link CqlTemplate}
|
||||
*
|
||||
* @author Alex Shvid
|
||||
* @author David Webb
|
||||
*/
|
||||
public class CassandraDataTemplate extends CassandraTemplate implements CassandraDataOperations {
|
||||
public class CassandraTemplate extends CqlTemplate implements CassandraOperations {
|
||||
|
||||
/*
|
||||
* List of iterable classes when testing POJOs for specific operations.
|
||||
@@ -80,7 +80,7 @@ public class CassandraDataTemplate extends CassandraTemplate implements Cassandr
|
||||
/**
|
||||
* Default Constructor for wiring in the required components later
|
||||
*/
|
||||
public CassandraDataTemplate() {
|
||||
public CassandraTemplate() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ public class CassandraDataTemplate extends CassandraTemplate implements Cassandr
|
||||
*
|
||||
* @param session must not be {@literal null}
|
||||
*/
|
||||
public CassandraDataTemplate(Session session) {
|
||||
public CassandraTemplate(Session session) {
|
||||
this(session, null, null);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class CassandraDataTemplate extends CassandraTemplate implements Cassandr
|
||||
* @param session must not be {@literal null}
|
||||
* @param converter must not be {@literal null}.
|
||||
*/
|
||||
public CassandraDataTemplate(Session session, CassandraConverter converter) {
|
||||
public CassandraTemplate(Session session, CassandraConverter converter) {
|
||||
this(session, converter, null);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class CassandraDataTemplate extends CassandraTemplate implements Cassandr
|
||||
* @param session must not be {@literal null}.
|
||||
* @param converter must not be {@literal null}.
|
||||
*/
|
||||
public CassandraDataTemplate(Session session, CassandraConverter converter, String keyspace) {
|
||||
public CassandraTemplate(Session session, CassandraConverter converter, String keyspace) {
|
||||
setSession(session);
|
||||
this.keyspace = keyspace;
|
||||
this.cassandraConverter = converter;
|
||||
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.data.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.data.cassandra.repository.support.CassandraRepositoryFactoryBean;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
|
||||
@@ -109,7 +109,7 @@ public @interface EnableCassandraRepositories {
|
||||
Class<?> repositoryFactoryBeanClass() default CassandraRepositoryFactoryBean.class;
|
||||
|
||||
/**
|
||||
* Configures the name of the {@link CassandraDataTemplate} bean to be used with the repositories detected.
|
||||
* Configures the name of the {@link CassandraTemplate} bean to be used with the repositories detected.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.cassandra.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.data.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentEntity;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentProperty;
|
||||
import org.springframework.data.cassandra.repository.CassandraRepository;
|
||||
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
public class CassandraRepositoryFactory extends RepositoryFactorySupport {
|
||||
|
||||
private final CassandraDataTemplate cassandraDataTemplate;
|
||||
private final CassandraTemplate cassandraDataTemplate;
|
||||
private final MappingContext<? extends CassandraPersistentEntity<?>, CassandraPersistentProperty> mappingContext;
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public class CassandraRepositoryFactory extends RepositoryFactorySupport {
|
||||
*
|
||||
* @param mongoOperations must not be {@literal null}
|
||||
*/
|
||||
public CassandraRepositoryFactory(CassandraDataTemplate cassandraDataTemplate) {
|
||||
public CassandraRepositoryFactory(CassandraTemplate cassandraDataTemplate) {
|
||||
|
||||
Assert.notNull(cassandraDataTemplate);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.cassandra.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.data.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.data.cassandra.repository.CassandraRepository;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
public class CassandraRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends
|
||||
RepositoryFactoryBeanSupport<T, S, ID> {
|
||||
|
||||
private CassandraDataTemplate cassandraDataTemplate;
|
||||
private CassandraTemplate cassandraDataTemplate;
|
||||
|
||||
@Override
|
||||
protected RepositoryFactorySupport createRepositoryFactory() {
|
||||
@@ -41,11 +41,11 @@ public class CassandraRepositoryFactoryBean<T extends Repository<S, ID>, S, ID e
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the {@link CassandraDataTemplate} to be used.
|
||||
* Configures the {@link CassandraTemplate} to be used.
|
||||
*
|
||||
* @param operations the operations to set
|
||||
*/
|
||||
public void setCassandraDataTemplate(CassandraDataTemplate cassandraDataTemplate) {
|
||||
public void setCassandraDataTemplate(CassandraTemplate cassandraDataTemplate) {
|
||||
this.cassandraDataTemplate = cassandraDataTemplate;
|
||||
setMappingContext(cassandraDataTemplate.getConverter().getMappingContext());
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.data.cassandra.repository.CassandraRepository;
|
||||
import org.springframework.data.cassandra.repository.query.CassandraEntityInformation;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -41,18 +41,18 @@ import com.datastax.driver.core.querybuilder.Select;
|
||||
|
||||
public class SimpleCassandraRepository<T, ID extends Serializable> implements CassandraRepository<T, ID> {
|
||||
|
||||
private final CassandraDataTemplate cassandraDataTemplate;
|
||||
private final CassandraTemplate cassandraDataTemplate;
|
||||
private final CassandraEntityInformation<T, ID> entityInformation;
|
||||
|
||||
/**
|
||||
* Creates a new {@link SimpleCassandraRepository} for the given {@link CassandraEntityInformation} and
|
||||
* {@link CassandraDataTemplate}.
|
||||
* {@link CassandraTemplate}.
|
||||
*
|
||||
* @param metadata must not be {@literal null}.
|
||||
* @param template must not be {@literal null}.
|
||||
*/
|
||||
public SimpleCassandraRepository(CassandraEntityInformation<T, ID> metadata,
|
||||
CassandraDataTemplate cassandraDataTemplate) {
|
||||
CassandraTemplate cassandraDataTemplate) {
|
||||
|
||||
Assert.notNull(cassandraDataTemplate);
|
||||
Assert.notNull(metadata);
|
||||
@@ -224,20 +224,20 @@ public class SimpleCassandraRepository<T, ID extends Serializable> implements Ca
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the underlying {@link CassandraOperations} instance.
|
||||
* Returns the underlying {@link CqlOperations} instance.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected CassandraOperations getCassandraOperations() {
|
||||
protected CqlOperations getCassandraOperations() {
|
||||
return this.cassandraDataTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the underlying {@link CassandraDataOperations} instance.
|
||||
* Returns the underlying {@link CassandraOperations} instance.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected CassandraDataOperations getCassandraDataOperations() {
|
||||
protected CassandraOperations getCassandraDataOperations() {
|
||||
return this.cassandraDataTemplate;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.springframework.data.cassandra.util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.cassandra.core.CqlTemplate;
|
||||
import org.springframework.cassandra.core.QueryOptions;
|
||||
import org.springframework.data.cassandra.exception.EntityWriterException;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentEntity;
|
||||
@@ -140,7 +140,7 @@ public abstract class CqlUtils {
|
||||
/*
|
||||
* Add Query Options
|
||||
*/
|
||||
CassandraTemplate.addQueryOptions(q, options);
|
||||
CqlTemplate.addQueryOptions(q, options);
|
||||
|
||||
/*
|
||||
* Add TTL to Insert object
|
||||
@@ -178,7 +178,7 @@ public abstract class CqlUtils {
|
||||
/*
|
||||
* Add Query Options
|
||||
*/
|
||||
CassandraTemplate.addQueryOptions(q, options);
|
||||
CqlTemplate.addQueryOptions(q, options);
|
||||
|
||||
/*
|
||||
* Add TTL to Insert object
|
||||
@@ -221,7 +221,7 @@ public abstract class CqlUtils {
|
||||
/*
|
||||
* Add Query Options
|
||||
*/
|
||||
CassandraTemplate.addQueryOptions(b, options);
|
||||
CqlTemplate.addQueryOptions(b, options);
|
||||
|
||||
return b;
|
||||
|
||||
@@ -257,7 +257,7 @@ public abstract class CqlUtils {
|
||||
/*
|
||||
* Add Query Options
|
||||
*/
|
||||
CassandraTemplate.addQueryOptions(b, options);
|
||||
CqlTemplate.addQueryOptions(b, options);
|
||||
|
||||
return b;
|
||||
|
||||
@@ -286,7 +286,7 @@ public abstract class CqlUtils {
|
||||
*/
|
||||
entityWriter.write(objectToRemove, w);
|
||||
|
||||
CassandraTemplate.addQueryOptions(q, options);
|
||||
CqlTemplate.addQueryOptions(q, options);
|
||||
|
||||
return q;
|
||||
|
||||
@@ -355,7 +355,7 @@ public abstract class CqlUtils {
|
||||
|
||||
}
|
||||
|
||||
CassandraTemplate.addQueryOptions(b, options);
|
||||
CqlTemplate.addQueryOptions(b, options);
|
||||
|
||||
return b;
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.cassandra.config.java.AbstractSpringDataCassandraConfiguration;
|
||||
import org.springframework.data.cassandra.convert.CassandraConverter;
|
||||
import org.springframework.data.cassandra.convert.MappingCassandraConverter;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraDataTemplate;
|
||||
import org.springframework.data.cassandra.core.CassandraOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraTemplate;
|
||||
import org.springframework.data.cassandra.mapping.DefaultCassandraMappingContext;
|
||||
import org.springframework.data.cassandra.test.integration.support.SpringDataBuildProperties;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TestConfig extends AbstractSpringDataCassandraConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CassandraDataOperations cassandraDataTemplate() throws Exception {
|
||||
return new CassandraDataTemplate(session().getObject(), converter(), KEYSPACE_NAME);
|
||||
public CassandraOperations cassandraDataTemplate() throws Exception {
|
||||
return new CassandraTemplate(session().getObject(), converter(), KEYSPACE_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraOperations;
|
||||
import org.springframework.data.cassandra.test.integration.table.User;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -52,7 +52,7 @@ public class UserRepositoryIntegrationTests {
|
||||
protected UserRepository repository;
|
||||
|
||||
@Autowired
|
||||
protected CassandraDataOperations dataOperations;
|
||||
protected CassandraOperations dataOperations;
|
||||
|
||||
User tom, bob, alice, scott;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cassandra.core.CassandraOperations;
|
||||
import org.springframework.cassandra.core.CqlOperations;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.cassandra.test.integration.config.TestConfig;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -46,7 +46,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||
public class CassandraAdminTest {
|
||||
|
||||
@Autowired
|
||||
private CassandraOperations cassandraTemplate;
|
||||
private CqlOperations cassandraTemplate;
|
||||
|
||||
@Mock
|
||||
ApplicationContext context;
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cassandra.core.ConsistencyLevel;
|
||||
import org.springframework.cassandra.core.QueryOptions;
|
||||
import org.springframework.cassandra.core.RetryPolicy;
|
||||
import org.springframework.data.cassandra.core.CassandraDataOperations;
|
||||
import org.springframework.data.cassandra.core.CassandraOperations;
|
||||
import org.springframework.data.cassandra.test.integration.config.TestConfig;
|
||||
import org.springframework.data.cassandra.test.integration.support.SpringDataBuildProperties;
|
||||
import org.springframework.data.cassandra.test.integration.table.Book;
|
||||
@@ -51,7 +51,7 @@ import com.datastax.driver.core.querybuilder.QueryBuilder;
|
||||
import com.datastax.driver.core.querybuilder.Select;
|
||||
|
||||
/**
|
||||
* Unit Tests for CassandraTemplate
|
||||
* Unit Tests for CqlTemplate
|
||||
*
|
||||
* @author David Webb
|
||||
*
|
||||
@@ -61,7 +61,7 @@ import com.datastax.driver.core.querybuilder.Select;
|
||||
public class CassandraDataOperationsTest {
|
||||
|
||||
@Autowired
|
||||
private CassandraDataOperations cassandraDataTemplate;
|
||||
private CassandraOperations cassandraDataTemplate;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(CassandraDataOperationsTest.class);
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
|
||||
<cassandra:session id="cassandra-session" keyspace-name="cassandra-keyspace"/>
|
||||
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CassandraTemplate">
|
||||
<bean id="cassandraTemplate" class="org.springframework.cassandra.core.CqlTemplate">
|
||||
<constructor-arg ref="cassandra-session" />
|
||||
</bean>
|
||||
|
||||
<bean id="cassandraDataTemplate" class="org.springframework.data.cassandra.core.CassandraDataTemplate">
|
||||
<bean id="cassandraDataTemplate" class="org.springframework.data.cassandra.core.CassandraTemplate">
|
||||
<constructor-arg ref="cassandra-session" />
|
||||
<constructor-arg ref="cassandra-converter" />
|
||||
<constructor-arg value="${cassandra.keyspace}" />
|
||||
|
||||
Reference in New Issue
Block a user