<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
	=========================================
	Copyright © 2004 VHA. All rights reserved
	=========================================

	@description: Configuration file containing bean configuration definitions of data access
	objects (DAOs) that encapsulate how the ESR application interface with the data base.

	@project: Common
	@author: DNS   LEV
	@version: 1.3

-->
<beans default-lazy-init="true">
	<!--
		@type: org.springframework.aop.framework.ProxyFactoryBean
		@description: This bean proxies HibernateTemplate calls to perform logging for parameters
	-->
	<bean
		id="hibernateTemplate"
		class="org.springframework.orm.hibernate3.HibernateTemplate">

		<property name="sessionFactory" ref="sessionFactory"/>
	</bean>

	<bean
		id="reportsHibernateTemplate"
		class="org.springframework.orm.hibernate3.HibernateTemplate">

		<property name="sessionFactory" ref="reportsSessionFactory"/>
	</bean>


	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: This bean provides a base definition for all DAOs that require
		transactional support.  See common.abstractTransactionalBean for transaction
		attribute definitions.
	-->
    <bean
        id="common.abstractDAO"
        parent="common.abstractTransactionalBean"
        abstract="true">
	</bean>

	<!--
		@type: gov.va.med.fw.persistent.hibernate.AbstractDAOImpl
		@description: An abstract DAO class that provides a methods to query, insert, to remove,
		and to save an entity.  This implementation implements a generic DAO interface and it uses
		Hibernate framework to perform the actual persistence of the entity to the database. In the
		ESR project, all DAOs are encouraged to derive from this abstract DAO class.
	-->
    <bean
        id="common.target.abstractDAO"
        abstract="true"
		class="gov.va.med.fw.persistent.hibernate.AbstractDAOImpl">

		<property name="hibernateTemplate" ref="hibernateTemplate"/>
    </bean>

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.genericDAO bean to provide transactional
		supports and AOP features to a genericDAO.
	-->
    <bean
        id="genericDAO"
        parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
        <property name="target">
			<!--
				@type: gov.va.med.fw.persistent.hibernate.GenericDAOImpl
				@description: Extends from an abstract dao class to provide additional
				convenient methods to execute hql statements.   This generic DAO provides
				generic usages for persisting any entity. Even though this implementation
				uses Hibernate technology, specific Hibernate classes are encapsulated from
				a caller to promote loose coupling. hence, to improve flexibility.
			-->
            <bean
				id="target.genericDAO"
				parent="common.target.abstractDAO"
                class="gov.va.med.fw.persistent.hibernate.GenericDAOImpl" />

        </property>
    </bean>

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.personDAO bean to provide transactional
		supports and AOP features to a personDAO.
	-->
    <bean
        id="personDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.person.hibernate.PersonDAOImpl">

		<property name="isDataClean" value="${isDataClean}"/>
    </bean>

	<bean
        id="addressDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.demographic.hibernate.AddressDAOImpl"/>

    <bean
        id="confidentialAddressCategoryDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.demographic.hibernate.ConfidentialAddressCategoryDAOImpl"/>
    <bean
        id="confidentialAddressCategoryTypeDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.demographic.hibernate.ConfidentialAddressCategoryTypeDAOImpl"/>
	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.messageLogEntryDAO bean to provide transactional
		supports and AOP features to a messageLogEntryDAO
	-->
	 <bean
    	id="emailDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.demographic.hibernate.EmailDAOImpl" />

		<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.systemParameterDAO bean to provide transactional
		supports and AOP features to a SystemParameterDAO
	-->
    <bean
        id="messageLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.MessageLogEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.genericDAO bean to provide transactional
		supports and AOP features to a genericDAO.
	-->
    <bean
        id="securityDAO"
        parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
        <property name="target">
			<!--
				@type: gov.va.med.fw.persistent.hibernate.GenericDAOImpl
				@description: Extends from an abstract dao class to provide additional
				convenient methods to execute hql statements.   This generic DAO provides
				generic usages for persisting any entity. Even though this implementation
				uses Hibernate technology, specific Hibernate classes are encapsulated from
				a caller to promote loose coupling. hence, to improve flexibility.
			-->
            <bean
				parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.security.hibernate.SecurityDAOImpl" />

        </property>
    </bean>

     <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.ssnVerificationDetailDAO bean to provide transactional
		supports and AOP features to a ssnVerificationDetailDAO
    -->
    <bean
    	id="ssnVerificationDetailDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.person.hibernate.SSNVerificationDetailDAOImpl" />

		<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.systemParameterDAO bean to provide transactional
		supports and AOP features to a SystemParameterDAO
	-->
    <bean
        id="systemParameterDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.system.hibernate.SystemParameterDAOImpl"/>

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.securityDAO bean to provide transactional
		supports and AOP features to a securityDAO
	-->
    <bean
        id="egtDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.ee.hibernate.EGTSettingDAOImpl"/>
	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.securityDAO bean to provide transactional
		supports and AOP features to a securityDAO
	-->

    <bean
        id="enrollmentApplicationDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.person.hibernate.EnrollmentApplicationDAOImpl"/>

   <bean
        id="applicationInProcessDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.person.hibernate.ApplicationInProcessDAOImpl"/>

	<bean
        id="voaApplicationDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.person.hibernate.VOAApplicationDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="update*">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>

    <bean
    	id="mecPeriodDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.person.hibernate.MECPeriodDAOImpl" />

    <bean
        id="voaFileAttachmentDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.ee.hibernate.VoaFileAttachmentDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="update*">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>


    <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.registryDAO bean to provide transactional
		supports and AOP features to a registryDAO
    -->
    <bean
    	id="registryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.registry.hibernate.RegistryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.personTraitsDAO bean to provide transactional
		supports and AOP features to a personTraitsDAO
    -->
    <bean
    	id="personTraitsDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.person.hibernate.PersonTraitsDAOImpl" />

    <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.reportDAO bean to provide transactional
		supports and AOP features to a ReportDAO
    -->
    <bean
    	id="reportDAO"
    	parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
    	<property name="target">
		<!--
			@type: gov.va.med.esr.common.persistent.report.hibernate.ReportDAOImpl
			@description: Provides methods to persist and to query report data
		-->
		<bean
		    id="target.reportDAO"
		    parent="common.target.abstractDAO"
		    class="gov.va.med.esr.common.persistent.report.hibernate.ReportDAOImpl" />

    	</property>
    </bean>

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.relaxationPercentageDAO bean to provide transactional
		supports and AOP features to a RelaxationPercentageDAO
    -->
    <bean
    	id="relaxationPercentageDAO"
    	parent="common.abstractDAO">
    	<property name="target">
		<!--
			@type: gov.va.med.esr.common.persistent.financials.hibernate.RelaxationPercentageDAOImpl
			@description: Provides methods to persist and to query report data
		-->
		<bean
		    id="target.relaxationPercentageDAO"
		    parent="common.target.abstractDAO"
		    class="gov.va.med.esr.common.persistent.financials.hibernate.RelaxationPercentageDAOImpl" />
    	</property>
    </bean>

    <bean
        id="aacLetterRequestDAO"
        parent="common.abstractDAO">



        <property name="target" ref="aacLetterRequestDAOTarget">
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="findAacLetterRequestById">PROPAGATION_SUPPORTS</prop>
                <prop key="findAacLetterRequestByPartyId">PROPAGATION_SUPPORTS</prop>
                <prop key="findAacLetterRequestBetweenRequestIds">PROPAGATION_SUPPORTS</prop>
                <prop key="insert">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>


    <bean
        id="aacLetterRequestDAOTarget"
        parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.AacLetterRequestDAOImpl">
        <property name="dao" ref="genericDAO"></property>
     </bean>
    <bean
        id="commsEmailBulletinDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.CommsEmailBulletinDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="findEmailBulletinById">PROPAGATION_SUPPORTS</prop>
                <prop key="findEmailBulletinByName">PROPAGATION_SUPPORTS</prop>
                <prop key="insert">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>

    <bean
        id="commsLogEntryDAO"
		parent="common.abstractDAO">
        <property name="target">
            <bean	parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.CommsLogEntryDAOImpl">
              <property name="generator">
                <bean class="gov.va.med.esr.common.persistent.hibernate.OracleSequenceGenerator">
                  <constructor-arg index="0">
                    <ref bean="dataSource" />
                  </constructor-arg>
                  <constructor-arg index="1">
                    <value>com_mailing_barcode_s</value>
                  </constructor-arg>
                </bean>
              </property>

			  <property name="lookupService" ref="lookupService"/>
            </bean>
        </property>
    </bean>

    <bean
        id="commsTemplateDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.CommsTemplateDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="find*">PROPAGATION_SUPPORTS</prop>
            </props>
        </property>
    </bean>
    <bean
        id="handBookMailQueueDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.HandbookMailQueueDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="find*">PROPAGATION_SUPPORTS</prop>
            </props>
        </property>
    </bean>
    <bean
        id="handbookBatchRequestDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.HandbookBatchRequestDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="find*">PROPAGATION_SUPPORTS</prop>
            </props>
        </property>
    </bean>

    <bean
        id="handbookBatchStatisticsDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.HandbookBatchStatisticsDAOImpl" />
        </property>
    </bean>

    <bean
        id="handbookBatchFileProcessStatisticsDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.HandbookBatchFileProcessStatisticsDAOImpl" />
         </property>
    </bean>

    <bean
        id="commsTransLogDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.CommsTransLogDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="save">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>

    <bean
    	id="documentReceiptDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.comms.hibernate.DocumentReceiptDAOImpl" />

	<bean
    	id="fileInfoDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.comms.hibernate.FileInfoDAOImpl" />

    <bean
        id="exportSnapshotDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.ExportSnapshotDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="get*">PROPAGATION_SUPPORTS</prop>
                <prop key="insert">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>

    <bean
        id="personMergeDAO"
        parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
        <property name="target">
			<!--
				@type: gov.va.med.esr.common.persistent.person.hibernate.PersonMergeDAOImpl
				@description: Provides methods to manage PersonMerge
			-->
            <bean
				id="target.personMergeDAO"
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.person.hibernate.PersonMergeDAOImpl">
			</bean>

        </property>
    </bean>

    <bean
        id="personUnmergeDAO"
        parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
        <property name="target">
			<!--
				@type: gov.va.med.esr.common.persistent.person.hibernate.PersonUnmergeDAOImpl
				@description: Provides methods to manage PersonUnmerge
			-->
            <bean
				id="target.personUnmergeDAO"
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.person.hibernate.PersonUnmergeDAOImpl">
			</bean>

        </property>
    </bean>

	<!-- common DAO for all work flow operations -->
	<bean
        id="workflowDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.workflow.hibernate.WorkflowDAOImpl">
			</bean>
        </property>
    </bean>

    <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.msdsMessageLogEntryDAO bean to provide transactional
		supports and AOP features to a msdsMessageLogEntryDAO
	-->
    <bean
        id="msdsMessageLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.MsdsMessageLogEntryDAOImpl" />
 <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.msdsMessageLogEntryDAO bean to provide transactional
		supports and AOP features to a msdsMessagePayloadEntryDAO
	-->
    <bean
        id="msdsMessagePayloadEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.MsdsMessagePayloadEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.msdsMessageLogEntryDAO bean to provide transactional
		supports and AOP features to a msdsMessageLogEntryDAO
	-->
    <bean
        id="msdsErrorLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.MsdsErrorLogEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.irsTransmissionLogEntryDAO bean to provide transactional
		supports and AOP features to a irsTransmissionLogEntryDAO
	-->
    <bean
        id="irsTransmissionLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.IrsTransmissionLogEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.correspondenceDAO bean to provide transactional
		supports and AOP features to a correspondenceDAO
	-->
    <bean
        id="correspondenceDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.comms.hibernate.CorrespondenceDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.irsTransmissionLogDetailEntryDAO bean to provide transactional
		supports and AOP features to a irsTransmissionLogDetailEntryDAO
	-->
    <bean
        id="irsTransmissionLogDetailEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.IrsTransmissionLogDetailEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.messageLogEntryDAO bean to provide transactional
		supports and AOP features to a messageLogEntryDAO
	-->
    <bean
        id="seedingLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.SeedingLogEntryDAOImpl" />

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.preferredFacilityDAO bean to provide transactional
		supports and AOP features to a preferredFacilityDAO
	-->
	<bean
        id="preferredFacilityDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.person.hibernate.PreferredFacilityDAOImpl"/>

	<!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.healtheCareProviderDAO bean to provide transactional
		supports and AOP features to a healtheCareProviderDAO
	-->
	<bean
        id="healthCareProviderDAO"
		parent="common.target.abstractDAO"
        class="gov.va.med.esr.common.persistent.person.hibernate.HealthCareProviderDAOImpl"/>

       <bean
        id="deliveryPreferenceDAO"
        parent="common.abstractDAO">

        <property name="target">
            <bean
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.comms.hibernate.DeliveryPreferenceDAOImpl" />
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="find*">PROPAGATION_SUPPORTS</prop>
            </props>
        </property>
    </bean>

    <!--
		@type: org.springframework.transaction.interceptor.TransactionProxyFactoryBean
		@description: A proxy of a target.archivedMessageLogEntryDAO bean to provide transactional
		supports and AOP features to a messageLogEntryDAO
	-->
    <bean
        id="archivedMessageLogEntryDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.messaging.hibernate.ArchivedMessageLogEntryDAOImpl" />


    <bean
        id="hbpDefinitionDAO"
        parent="common.abstractDAO">

		<!-- Target is the actual implementation class, which is wrapped by a proxy -->
        <property name="target">
			<!--
				@type: gov.va.med.esr.common.persistent.person.hibernate.PersonMergeDAOImpl
				@description: Provides methods to manage PersonMerge
			-->
            <bean
				id="target.hbpDefinitionDAO"
                parent="common.target.abstractDAO"
                class="gov.va.med.esr.common.persistent.hbp.hibernate.HBPDefinitionDAOImpl">
			</bean>

        </property>
    </bean>

    <bean
        id="geocodeTransmitDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.comms.hibernate.GeocodeTransmitDAOImpl" />

    <bean
        id="waittimeDAO"
		parent="common.target.abstractDAO"
		class="gov.va.med.esr.common.persistent.comms.hibernate.WaittimeDAOImpl" />

</beans>