Assembla home | Assembla project page
 

root/notify/trunk/src/test/spring/context/applicationContext-hibernate.xml

Revision 249, 2.2 kB (checked in by restamon, 3 months ago)

DAO refactoring

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3        xmlns:context="http://www.springframework.org/schema/context"
4        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
5                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
6
7     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
8         <property name="driverClassName" value="${jdbc.driverClassName}"/>
9         <property name="url" value="${jdbc.url}"/>
10         <property name="username" value="${jdbc.username}"/>
11         <property name="password" value="${jdbc.password}"/>
12         <property name="maxActive" value="30"/>
13         <property name="maxIdle" value="10"/>
14         <property name="maxWait" value="1000"/>
15         <property name="defaultAutoCommit" value="true"/>
16     </bean>
17
18     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
19         <property name="dataSource" ref="dataSource"/>
20         <property name="mappingResources">
21             <list>
22                 <value>org/restafarian/approval/beans/RequestForApproval.hbm.xml</value>
23                 <value>org/restafarian/approval/beans/RequestForApprovalAction.hbm.xml</value>
24                 <value>org/restafarian/approval/beans/RequestForApprovalApprover.hbm.xml</value>
25             </list>
26         </property>
27         <property name="hibernateProperties">
28             <props>
29                 <prop key="hibernate.dialect">${hibernate.dialect}</prop>
30                 <prop key="hibernate.hbm2ddl.auto">update</prop>
31             </props>
32         </property>
33     </bean>
34
35     <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
36         <property name="sessionFactory" ref="sessionFactory"/>
37     </bean>
38
39     <bean id="requestForApprovalDao" class="org.restafarian.approval.dao.hibernate.RequestForApprovalDaoHibernate">
40         <constructor-arg><ref bean="sessionFactory"/></constructor-arg>
41     </bean>
42
43 </beans>
Note: See TracBrowser for help on using the browser.