<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:cassandra="http://www.springframework.org/schema/data/cassandra"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
	   	http://www.springframework.org/schema/data/cassandra https://www.springframework.org/schema/data/cassandra/spring-cassandra.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
">

	<context:property-placeholder
			location="classpath:/config/cassandra-connection.properties,classpath:/org/springframework/data/cassandra/config/cassandra.properties"/>

	<cassandra:session contact-points="${build.cassandra.host}"
					   port="${build.cassandra.native_transport_port}"
					   keyspace-name="${cassandra.keyspace}">
		<cassandra:keyspace name="${cassandra.keyspace}" action="CREATE_DROP"
							durable-writes="true"/>
	</cassandra:session>

	<cassandra:session-factory>
		<cassandra:script
				location="classpath:/org/springframework/data/cassandra/config/schema.cql"/>
	</cassandra:session-factory>

	<cassandra:mapping>
		<cassandra:user-type-resolver session-ref="cassandraSession"/>
	</cassandra:mapping>

	<cassandra:converter/>

	<cassandra:cql-template id="foo-template"
							session-factory-ref="cassandraSessionFactory"/>
	<cassandra:template cql-template-ref="foo-template"/>

</beans>
