Unfortunately spring-data-cassandra ver. <= 1.2.x can only be used with beans, which can be directly mapped to data types from this list: http://www.datastax.com/documentation/developer/java-driver/1.0/java-driver/reference/javaClass2Cql3Datatypes_r .html
I met the same problem because I wanted to map my classes to TEXT fields in Cassandra, but could not do it. After several days of trying, I came to the conclusion that using non-standard type converters in spring-Data for Cassandra (tested with version 1.2.0.M1) is impossible.
The CassandraTemplate uses the MappingCassandraConverter, which has the default DefaultConversionService built in, but this DefaultConversionService is not used anywhere in the spring-data-cassandra module. It was introduced only for integration with the SpringData API.
You can find in the library code that conversionService uses only in
BeanWrapper<S> wrapper = BeanWrapper.create(instance, conversionService);
which just skips conversionService:
@Deprecated public static <T> BeanWrapper<T> create(T bean, ConversionService conversionService) { return new BeanWrapper<T>(bean); }
You can see in MappingCassandraConverter.readPropertyFromRow (...), which uses ColumnReader.get (int i), where only Cassandra MAP, LIST, SET and primary data types (Text, Numbers, UUID, java.util.Date, Boolean are supported , ByteBuffer).
In addition, BasicCassandraMappingContext.verifier (BasicCassandraPersistentEntityMetadataVerifier) ββthrows an exception when trying to write any field that cannot be matched with supported Cassandra types or is not @Table.
That's why you had an exception
// it was attempt to check conversion of an embedded field 'date' in LocalDateTime org.springframework.data.cassandra.mapping.VerifierMappingExceptions: java.time.LocalDate
Thus, the only way to solve this problem is to use ConversionService on top of spring-data-cassandra for your needs.
Sample code for the conversion service part:
import org.springframework.data.convert.Jsr310Converters; ... @Bean public ConversionService getConversionService() { // creates DefaultConversionService ConversionServiceFactoryBean bean = new ConversionServiceFactoryBean(); bean.setConverters(new HashSet<>(getConverters())); bean.afterPropertiesSet(); ConversionService service = bean.getObject(); return service; } private Set<Converter<?, ?>> getConverters() { Set<Converter<?,?>> converters = new HashSet<Converter<?,?>>(); converters.addAll(Jsr310Converters.getConvertersToRegister()); converters.add(new TimeWriteConverter()); converters.add(new TimeReadConverter()); return converters; } public static class TimeWriteConverter implements Converter<LocalDateTime, Long> { @Override public Long convert(LocalDateTime source) { return source.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); } } public static class TimeReadConverter implements Converter<Long, LocalDateTime> { @Override public LocalDateTime convert(Long source) { return LocalDateTime.ofInstant(Instant.ofEpochMilli(source), ZoneId.systemDefault()); } }