<?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:jdbc="http://www.springframework.org/schema/jdbc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:cloud="http://schema.cloudfoundry.org/spring"
	xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
		http://schema.cloudfoundry.org/spring http://schema.cloudfoundry.org/spring/cloudfoundry-spring.xsd">

	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<constructor-arg ref="localContainerEntityManagerFactory"/>
	</bean>

	<tx:annotation-driven transaction-manager="transactionManager" />

	<context:component-scan base-package="com.gopivotal.cf.workshop" />

	<jpa:repositories base-package="com.gopivotal.cf.workshop" />

	<!--  <bean id="dataSource" class="org.h2.jdbcx.JdbcDataSource">
		<property name="URL" value="jdbc:h2:~/test"/>
	</bean>
	-->

	<context:property-placeholder location="WEB-INF/dataSource.properties"/>

	<bean id="dataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
		<property name="url" value="${jdbc.url}"/>
		<property name="user" value="${jdbc.user}"/>
		<!-- <property name="password" value="${jdbc.password"/> -->
	</bean>

	<bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
		<property name="showSql" value="true"/>
		<property name="generateDdl" value="true"/>
	</bean>

	<bean id="localContainerEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
		<property name="jpaPropertyMap">
			<map>
				<entry key="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
			</map>
		</property>
	</bean>

	<beans profile="default">
		<jdbc:initialize-database data-source="dataSource">
			<jdbc:script location="classpath:data/sampledata.sql"/>
		</jdbc:initialize-database>
	</beans>

</beans>
update to use params
update to use datasource with params for app director migration
add appDir profile
build for app director