Maj informations
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd">
|
||||
|
||||
<!-- 自动扫描所有注解(除Controller) 注册为bean (启动注解) -->
|
||||
<!-- -->
|
||||
<context:component-scan base-package="com.eshop">
|
||||
<context:exclude-filter type="annotation"
|
||||
expression="org.springframework.stereotype.Controller" />
|
||||
</context:component-scan>
|
||||
|
||||
<!--配置数据源 -->
|
||||
<!-- -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
|
||||
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
|
||||
<property name="url"
|
||||
@@ -27,7 +27,7 @@
|
||||
<property name="maxWait" value="10000" />
|
||||
</bean>
|
||||
|
||||
<!--配置session工厂 -->
|
||||
<!-- -->
|
||||
<bean id="sessionFactory"
|
||||
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
@@ -41,13 +41,13 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 事务管理器配置 -->
|
||||
<!-- -->
|
||||
<bean id="transactionManager"
|
||||
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="sessionFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- 启动事务注解 -->
|
||||
<!-- -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager"
|
||||
proxy-target-class="true" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user