spring-service.xml

<?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"
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">


<!--扫描包-->
<context:component-scan base-package="com.xie.service"/>
<!--注入spring-->
<bean id="BookServiceImpl" class="com.xie.service.impl.BookServiceImpl">
<property name="bookMapper" ref="bookMapper"/>
</bean>
<!--声明事务-->
<bean id="TransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!--注入数据源-->
<property name="dataSource" ref="dataSource"/>
</bean>
<!--aop事务支持-->
</beans>
posted @ 2021-04-12 15:17  加钱居士-  阅读(84)  评论(0编辑  收藏  举报