use of org.springframework.data.cassandra.core.convert.MappingCassandraConverter in project spring-data-cassandra by spring-projects.
the class CassandraTemplate method newConverter.
private static MappingCassandraConverter newConverter(CqlSession session) {
MappingCassandraConverter converter = new MappingCassandraConverter();
converter.setUserTypeResolver(new SimpleUserTypeResolver(session));
converter.setCodecRegistry(session.getContext().getCodecRegistry());
converter.afterPropertiesSet();
return converter;
}
use of org.springframework.data.cassandra.core.convert.MappingCassandraConverter in project spring-data-cassandra by spring-projects.
the class ReactiveCassandraTemplateIntegrationTests method setUp.
@BeforeEach
void setUp() {
MappingCassandraConverter converter = new MappingCassandraConverter();
CassandraTemplate cassandraTemplate = new CassandraTemplate(this.session, converter);
DefaultBridgedReactiveSession session = new DefaultBridgedReactiveSession(this.session);
template = new ReactiveCassandraTemplate(new ReactiveCqlTemplate(session), converter);
prepareTemplate(template);
SchemaTestUtils.potentiallyCreateTableFor(User.class, cassandraTemplate);
SchemaTestUtils.potentiallyCreateTableFor(UserToken.class, cassandraTemplate);
SchemaTestUtils.truncate(User.class, cassandraTemplate);
SchemaTestUtils.truncate(UserToken.class, cassandraTemplate);
}
use of org.springframework.data.cassandra.core.convert.MappingCassandraConverter in project spring-data-cassandra by spring-projects.
the class OptimisticLockingIntegrationTests method setUp.
@BeforeEach
void setUp() {
MappingCassandraConverter converter = new MappingCassandraConverter();
converter.afterPropertiesSet();
template = new CassandraTemplate(session, converter);
SchemaTestUtils.potentiallyCreateTableFor(VersionedEntity.class, template);
SchemaTestUtils.truncate(VersionedEntity.class, template);
}
use of org.springframework.data.cassandra.core.convert.MappingCassandraConverter in project spring-data-cassandra by spring-projects.
the class CassandraQueryCreatorUnitTests method setUp.
@BeforeEach
void setUp() {
context = new CassandraMappingContext();
context.setUserTypeResolver(mock(UserTypeResolver.class));
converter = new MappingCassandraConverter(context);
}
use of org.springframework.data.cassandra.core.convert.MappingCassandraConverter in project spring-data-cassandra by spring-projects.
the class StringBasedCassandraQueryUnitTests method setUp.
@BeforeEach
void setUp() {
CassandraMappingContext mappingContext = new CassandraMappingContext();
mappingContext.setUserTypeResolver(userTypeResolver);
this.metadata = AbstractRepositoryMetadata.getMetadata(SampleRepository.class);
this.converter = new MappingCassandraConverter(mappingContext);
this.factory = new SpelAwareProxyProjectionFactory();
this.converter.afterPropertiesSet();
when(operations.getConverter()).thenReturn(converter);
}
Aggregations