<?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:context="http://www.springframework.org/schema/context"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
	"
	default-autowire="no" default-lazy-init="false">

	<context:annotation-config />
	<context:mbean-server />

	<bean id="myPatientDao" class="ca.uhn.fhir.jpa.dao.FhirResourceDao">
		<property name="resourceType" value="ca.uhn.fhir.model.dstu.resource.Patient"/>
	</bean>
	<bean id="myObservationDao" class="ca.uhn.fhir.jpa.dao.FhirResourceDao">
		<property name="resourceType" value="ca.uhn.fhir.model.dstu.resource.Observation"/>
	</bean>
	<bean id="myOrganizationDao" class="ca.uhn.fhir.jpa.dao.FhirResourceDao">
		<property name="resourceType" value="ca.uhn.fhir.model.dstu.resource.Organization"/>
	</bean>
	<bean id="myLocationDao" class="ca.uhn.fhir.jpa.dao.FhirResourceDao">
		<property name="resourceType" value="ca.uhn.fhir.model.dstu.resource.Location"/>
	</bean>
	<bean id="myQuestionnaireDao" class="ca.uhn.fhir.jpa.dao.FhirResourceDao">
		<property name="resourceType" value="ca.uhn.fhir.model.dstu.resource.Questionnaire"/>
	</bean>

	<bean id="myPersistenceDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
		<property name="url" value="jdbc:derby:memory:myUnitTestDB;create=true" />
		<!-- <property name="url" value="jdbc:derby:directory:myUnitTestDB;create=true" />  -->
	</bean>

	<bean id="myEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="myPersistenceDataSource" />
		<property name="persistenceXmlLocation" value="classpath:fhir_jpatest_persistence.xml" />
		<property name="persistenceUnitName" value="FHIR_UT" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="showSql" value="false" />
				<property name="generateDdl" value="true" />
				<property name="databasePlatform" value="org.hibernate.dialect.DerbyTenSevenDialect" />
			</bean>
		</property>
	</bean>
	<bean id="myTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="myEntityManagerFactory" />
	</bean>
	<tx:annotation-driven transaction-manager="myTxManager" />

</beans>