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

<!--
  - Application context representing the application without any security services.
  -
  -->

<beans>

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

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
        <property name="url" value="jdbc:hsqldb:mem:insecuredms"/>
        <property name="username" value="sa"/>
        <property name="password" value=""/>
    </bean>

    <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <property name="transactionAttributeSource">
            <value>
                sample.dms.DocumentDao.*=PROPAGATION_REQUIRED
            </value>
        </property>
        <property name="transactionManager" ref="transactionManager" />
    </bean>

    <bean id="documentDao" class="sample.dms.DocumentDaoImpl">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <bean id="dataSourcePopulator" class="sample.dms.DataSourcePopulator">
        <constructor-arg ref="dataSource"/>
        <constructor-arg ref="documentDao"/>
        <constructor-arg ref="transactionManager"/>
    </bean>

</beans>
