generator.server.springboot.database.cassandra.CassandraDatabaseConfiguration.mustache Maven / Gradle / Ivy
package {{ packageName }}.wire.cassandra.infrastructure.secondary;
import {{ packageName }}.wire.cassandra.infrastructure.secondary.CassandraJSR310DateConverters.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.cassandra.core.convert.CassandraCustomConversions;
import java.util.ArrayList;
import java.util.List;
@Configuration
class CassandraDatabaseConfiguration {
@Bean
CassandraCustomConversions cassandraCustomConversions() {
List> converters = new ArrayList<>();
converters.add(TupleToZonedDateTimeConverter.INSTANCE);
converters.add(ZonedDateTimeToTupleConverter.INSTANCE);
return new CassandraCustomConversions(converters);
}
}