added convenient ctors for MappingCassandraConverter & CassandraTemplate
This commit is contained in:
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.data.cassandra.mapping.BasicCassandraMappingContext;
|
||||
import org.springframework.data.cassandra.mapping.CassandraMappingContext;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentEntity;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentProperty;
|
||||
@@ -69,6 +70,13 @@ public class MappingCassandraConverter extends AbstractCassandraConverter implem
|
||||
|
||||
protected ClassLoader beanClassLoader;
|
||||
|
||||
/**
|
||||
* Creates a new {@link MappingCassandraConverter} with a {@link BasicCassandraMappingContext}.
|
||||
*/
|
||||
public MappingCassandraConverter() {
|
||||
this(new BasicCassandraMappingContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link MappingCassandraConverter} with the given {@link CassandraMappingContext}.
|
||||
*
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.cassandra.core.util.CollectionUtils;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.data.cassandra.convert.CassandraConverter;
|
||||
import org.springframework.data.cassandra.convert.MappingCassandraConverter;
|
||||
import org.springframework.data.cassandra.mapping.CassandraMappingContext;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentEntity;
|
||||
import org.springframework.data.cassandra.mapping.CassandraPersistentProperty;
|
||||
@@ -70,6 +71,10 @@ public class CassandraTemplate extends CqlTemplate implements CassandraOperation
|
||||
public CassandraTemplate() {
|
||||
}
|
||||
|
||||
public CassandraTemplate(Session session) {
|
||||
this(session, new MappingCassandraConverter());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor if only session and converter are known at time of Template Creation
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user