<?xml version="1.0" encoding="UTF-8"?>
<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-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<!-- DataSource ;SelectMethod=cursor-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=jb_crm_team0"/>
<property name="username" value="sa"></property>
<property name="password" value="x32180966"></property>
</bean>
<!-- SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingResources">
<list>
<value>org/demo/entity/SysRight.hbm.xml </value>
<value>org/demo/entity/CstService.hbm.xml </value>
<value>org/demo/entity/SysRole.hbm.xml </value>
<value>org/demo/entity/SalPlan.hbm.xml </value>
<value>org/demo/entity/SysRoleRight.hbm.xml </value>
<value>org/demo/entity/CstLost.hbm.xml </value>
<value>org/demo/entity/CstActivity.hbm.xml </value>
<value>org/demo/entity/CstLinkman.hbm.xml </value>
<value>org/demo/entity/Dtproperties.hbm.xml </value>
<value>org/demo/entity/CstCustomer.hbm.xml </value>
<value>org/demo/entity/SalChance.hbm.xml </value>
<value>org/demo/entity/SysUser.hbm.xml </value>
<value>org/demo/entity/BasDict.hbm.xml </value>
<value>org/demo/entity/Sysdiagrams.hbm.xml </value>
<value>org/demo/entity/OrdersLine.hbm.xml </value>
<value>org/demo/entity/Product.hbm.xml </value>
<value>org/demo/entity/Storage.hbm.xml </value>
<value>org/demo/entity/Orders.hbm.xml </value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.query.substitutions">true 1,false 0</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="myeclipse.connection.profile">crm_team_db</prop>
</props>
</property>
</bean>
<!-- biz,dao,action -->
<bean id="sysUserBiz" class="org.demo.biz.impl.SysUserBizImpl">
<property name="sysUserDao" ref="sysUserDao"></property>
</bean>
<bean id="reporterBiz" class="org.demo.biz.impl.ReporterBizImpl">
<property name="orderDao" ref="orderDao"></property>
<property name="cstCustomerDao" ref="cstCustomerDao"></property>
<property name="serviceDAO" ref="serviceDAO"></property>
<property name="productDAO" ref="productDAO"></property>
</bean>
<bean id="salChanceBiz" class="org.demo.biz.impl.SalChanceBizImpl">
<property name="salChanceDao" ref="salChanceDao"></property>
<property name="sysUserDao" ref="sysUserDao"></property>
<property name="salPlanDao" ref="salPlanDao"></property>
</bean>
<bean id="cstCustomerBiz" class="org.demo.biz.impl.CstCustomerBizImpl">
<property name="cstCustomerDao" ref="cstCustomerDao"></property>
</bean>
<bean id="serviceBiz" class="org.demo.biz.impl.CstServiceBizImpl">
<property name="serviceDAO" ref="serviceDAO"></property>
</bean>
<!-- dao -->
<bean id="orderDao" class="org.demo.dao.impl.OrderDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="cstCustomerDao" class="org.demo.dao.impl.CstCustomerDAOImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="salPlanDao" class="org.demo.dao.impl.SalPlanDAOImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="salChanceDao" class="org.demo.dao.impl.SalChanceDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="sysUserDao" class="org.demo.dao.impl.SysUserDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="productDAO" class="org.demo.dao.impl.ProductDAOImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="serviceDAO" class="org.demo.dao.impl.CstServiceDAOImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- action -->
<!-- 客户信息管理 action -->
<bean name="/cstCustomer" class="org.demo.struts.action.CstCustomerAction" >
<property name="cstCustomerBiz" ref="cstCustomerBiz"></property>
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<!-- 报表 -->
<bean name="/report" class="org.demo.struts.action.ReportAction">
<property name="reporterBiz" ref="reporterBiz"></property>
<property name="cstCustomerBiz" ref="cstCustomerBiz"></property>
</bean>
<!-- 服务管理 action -->
<bean name="/cstLost" class="org.demo.struts.action.CstCustomerAction">
<property name="cstCustomerBiz" ref="cstCustomerBiz"></property>
</bean>
<bean name="/cstService" class="org.demo.struts.action.CstCustomerAction">
<property name="serviceBiz" ref="serviceBiz"></property>
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<!-- -->
<bean name="/user" class="org.demo.struts.action.TeamAction">
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<bean name="/team" class="org.demo.struts.action.TeamAction">
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<bean name="/salChance" class="org.demo.struts.action.TeamAction">
<property name="chanceBiz" ref="salChanceBiz"></property>
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<bean name="/addChance" class="org.demo.struts.action.TeamAction">
<property name="chanceBiz" ref="salChanceBiz"></property>
<property name="sysUserBiz" ref="sysUserBiz"></property>
</bean>
<!-- 事务控制 -->
<bean id="hibTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 定义事物通知 -->
<tx:advice id="txAdvice" transaction-manager="hibTransactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="do*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 事务控制器 -->
<aop:config>
<aop:pointcut id="bizMethods" expression="execution(* org.demo.biz.impl.*.*(..))" />
</aop:config>
</beans>