applicationContext_centre.xml
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8"?>
<!--
spring数据库、整合其它框架配置文件
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- 配置数据源 -->
<bean id="centreDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/centredb?useUnicode=true&characterEncoding=utf8</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>sz1234567890</value>
</property>
<property name="maxActive">
<value>100</value>
</property>
<property name="maxIdle">
<value>50</value>
</property>
<property name="initialSize">
<value>30</value>
</property>
<property name="maxWait">
<value>10000</value>
</property>
<property name="defaultAutoCommit">
<value>true</value>
</property>
<property name="removeAbandoned">
<value>true</value>
</property>
<property name="removeAbandonedTimeout">
<value>300</value>
</property>
<property name="logAbandoned">
<value>false</value>
</property>
<property name="validationQuery">
<value>select 1</value>
</property>
<property name="testOnBorrow">
<value>true</value>
</property>
</bean>
<!-- 配置注解sessionFactory -->
<bean id="centreSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="centreDataSource" />
<property name="packagesToScan">
<list>
<value>com.espeed.centre.pojo</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connetion.release_mode">auto</prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
</props>
</property>
</bean>
<!--配置公共的hibernate方法注解 -->
<bean id="centreAnnHibernateBaseDAO" class="com.espeed.yxy.dao.impl.CentreHibernateBaseDAOImpl" abstract="true" scope="prototype">
<property name="sessionFactory" ref="centreSessionFactory"/>
</bean>
<!-- 用户dao -->
<bean id="centreuserdao" class="com.espeed.yxy.dao.impl.CentreUserDaoImpl" parent="centreAnnHibernateBaseDAO"></bean>
<!-- 跟踪配置dao -->
<bean id="centretracksetdao" class="com.espeed.yxy.dao.impl.CentreTrackSetDaoImpl" parent="centreAnnHibernateBaseDAO"></bean>
<!-- 营销开发客户配置dao -->
<bean id="centreyxyedmnewcustomerdao" class="com.espeed.yxy.dao.impl.CentreYxyedmNewcustomerDaoImpl" parent="centreAnnHibernateBaseDAO"></bean>
<!-- 营销盘活客户配置dao -->
<bean id="centreyxyedmoldcustomerdao" class="com.espeed.yxy.dao.impl.CentreYxyedmOldcustomerDaoImpl" parent="centreAnnHibernateBaseDAO"></bean>
</beans>