ssh--applicationContext.xml

来源:互联网 发布:mac怎么截gif 编辑:程序博客网 时间:2024/06/06 08:44
<?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:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 配置c3p0 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql:///ssh"/> 
<property name="user" value="root"/>
<property name="password" value="root"/>
</bean>

<!-- 配置LocalSessionFactoryBean -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>cn/edu/hgu/bean/User.hbm.xml</value>
<value>cn/edu/hgu/bean/Customer.hbm.xml</value>
<value>cn/edu/hgu/bean/Dict.hbm.xml</value>
<value>cn/edu/hgu/bean/Linkman.hbm.xml</value>
<value>cn/edu/hgu/bean/SaleVisit.hbm.xml</value>
</list>
</property>
</bean>

<!-- 配置平台事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<!-- 开启事务注解 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="userAction" class="cn.edu.hgu.action.UserAction" scope="prototype">
<property name="userService" ref="userService"/>
</bean>
<bean id="userService" class="cn.edu.hgu.service.UserServiceImpl">
<property name="userDao" ref="userDao"/>
</bean>
<bean id="userDao" class="cn.edu.hgu.dao.UserDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean id="customerAction" class="cn.edu.hgu.action.CustomerAction" scope="prototype">
<property name="customerService" ref="customerService"/>
</bean>
<bean id="customerService" class="cn.edu.hgu.service.CustomerServiceImpl">
<property name="customerDao" ref="customerDao"/>
</bean>
<bean id="customerDao" class="cn.edu.hgu.dao.CustomerDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> 

<bean id="dictAction" class="cn.edu.hgu.action.DictAction" scope="prototype">
<property name="dictService" ref="dictService"/>
</bean>
<bean id="dictService" class="cn.edu.hgu.service.DictServiceImpl">
<property name="dictDao" ref="dictDao"/>
</bean>
<bean id="dictDao" class="cn.edu.hgu.dao.DictDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean id="linkmanAction" class="cn.edu.hgu.action.LinkmanAction" scope="prototype">
<property name="linkmanService" ref="linkmanService"/>
</bean>
<bean id="linkmanService" class="cn.edu.hgu.service.LinkmanServiceImpl">
<property name="linkmanDao" ref="linkmanDao"/>
</bean>
<bean id="linkmanDao" class="cn.edu.hgu.dao.LinkmanDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>


<bean id="visitAction" class="cn.edu.hgu.action.VisitAction" scope="prototype">
<property name="saleVisitService" ref="saleVisitService"/>
</bean>
<bean id="saleVisitService" class="cn.edu.hgu.service.SaleVisitServiceImpl">
<property name="saleVisitDao" ref="saleVisitDao"/>
</bean>
<bean id="saleVisitDao" class="cn.edu.hgu.dao.SaleVisitDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>


</beans>























原创粉丝点击