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

	<import resource="classpath:/data-source-context.xml"/>

	<!--  Initialise the database before every test case: -->
	<bean id="dataSourceInitializer" class="test.jdbc.datasource.DataSourceInitializer">
		<property name="dataSource" ref="dataSource"/>
		<property name="initialize" value="${batch.data.source.init}"/>
		<property name="initScripts">
			<list>
				<value>${batch.schema.script}</value>
			</list>
		</property>
	</bean>

	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="persistenceUnitName" value="bar"/>
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="showSql" value="false"/>
			</bean>
		</property>
	</bean>

</beans>