When you print this page, select the landscape layout option.
Listing 2. Wiring together the application DAO and TransactionManager
<!-- Pass the session factory to our CustomerDAO -->
<bean id="customerDAOTarget"
class="springexample.hibernate.CustomerDAOImpl">
<property name="sessionFactory"><ref local="exampleSessionFactory"/>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="exampleSessionFactory"/>
</property>
</bean>
<bean id="userDAO"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManager"/>
</property>
<property name="target"><ref local="customerDAOTarget"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="addCustomer">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
|
