第85天学习打卡(Spring 使用Spring实现AOP 整合mybatis 声明式事务)
2021-06-06 09:02
标签:nes Requires after Delve log 代码 mes property 存储器 方式三:使用注解实现!11.3 使用Spring实现AOP
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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
https://www.springframework.org/schema/aop/spring-aop.xsd">
bean id="userService" class="com.kuang.service.UserServiceImpl"/>
bean id="log" class="com.kuang.log.Log"/>
bean id="afterLog" class="com.kuang.log.AfterLog"/>
?
bean id="annotationPointcut" class="com.kuang.diy.AnnotationPointCut"/>
aop:aspectj-autoproxy proxy-target-class="false"/>
?
?
?
beans>
12.整合Mybatis
步骤:
1.导入相关jar包
-
-
junit
-
mybatis
-
mysql数据库
-
aop织入
-
mybatis-spring【new】
-
2.编写配置文件
version="1.0" encoding="UTF-8"?>
project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
parent>
artifactId>spring-studyartifactId>
groupId>com.kuanggroupId>
version>1.0-SNAPSHOTversion>
parent>
modelVersion>4.0.0modelVersion>
?
artifactId>spring-11-mybatisartifactId>
?
dependencies>
dependency>
groupId>junitgroupId>
artifactId>junitartifactId>
version>4.11version>
?
dependency>
dependency>
groupId>mysqlgroupId>
artifactId>mysql-connector-javaartifactId>
version>8.0.23version>
dependency>
?
dependency>
groupId>org.springframeworkgroupId>
artifactId>spring-webmvcartifactId>
version>5.3.5version>
dependency>
?
dependency>
groupId>org.springframeworkgroupId>
artifactId>spring-jdbcartifactId>
version>5.3.5version>
dependency>
dependency>
groupId>org.aspectjgroupId>
artifactId>aspectjweaverartifactId>
version>1.9.6version>
dependency>
?
dependency>
groupId>org.mybatisgroupId>
artifactId>mybatis-springartifactId>
version>2.0.6version>
dependency
下一篇:Java基础--循环结构
文章标题:第85天学习打卡(Spring 使用Spring实现AOP 整合mybatis 声明式事务)
文章链接:http://soscw.com/index.php/essay/91201.html