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

	<bean id="auditLogSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="hdrDataSource"/>
		<property name="mappingResources">
			<list>
				<value>gov/va/med/cds/audit/persistence/hibernate/CdsAuditClobStore.hbm.xml</value>
                <value>gov/va/med/cds/audit/persistence/hibernate/ClientMapping.hbm.xml</value>
                <value>gov/va/med/cds/audit/persistence/hibernate/FilterId.hbm.xml</value>
                <value>gov/va/med/cds/audit/persistence/hibernate/LegacyReadAuditLog.hbm.xml</value>
                <value>gov/va/med/cds/audit/persistence/hibernate/VhimReadAuditLog.hbm.xml</value>
				<value>gov/va/med/cds/audit/persistence/hibernate/TemplateId.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
				<prop key="hibernate.show_sql">false</prop>
			</props>
		</property>
	</bean>

	<bean id="auditLogHibernateTemplate" class="org.springframework.orm.hibernate4.HibernateTemplate">
		<property name="sessionFactory" ref="auditLogSessionFactory"/>
	</bean>

	<bean id="vaHibernateHl7AuditDao" class="gov.va.med.cds.mediator.persistence.HibernateHl7AuditDao">
		<property name="hl7AuditHibernateTemplate">
			<bean class="org.springframework.orm.hibernate4.HibernateTemplate">
				<property name="sessionFactory">
					<bean parent="baseHl7AuditSessionFactory">
						<property name="dataSource" ref="hdrDataSource"/>
					</bean>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="dodHibernateHl7AuditDao" class="gov.va.med.cds.mediator.persistence.HibernateHl7AuditDao">
		<property name="hl7AuditHibernateTemplate">
			<bean class="org.springframework.orm.hibernate4.HibernateTemplate">
				<property name="sessionFactory">
					<bean parent="baseHl7AuditSessionFactory">
						<property name="dataSource" ref="hdrDataSource"/>
					</bean>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="baseHl7AuditSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" abstract="true">
		<property name="mappingResources">
			<list>
				<value> gov/va/med/cds/mediator/persistence/hibernate/Hl7MessageLog.hbm.xml</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
				<prop key="hibernate.show_sql">false</prop>
			</props>
		</property>
	</bean>

	<bean id="jdbcTemplateForMessageControlId" class="org.springframework.jdbc.core.JdbcTemplate">
		<property name="dataSource" ref="hdrDataSource"/>
	</bean>
</beans>