随笔分类 - springboot
springboot
摘要:一、准备 pom文件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> <!-- mybatis的启动器 -
阅读全文
摘要:测试代码 @Service public class TestServiceImpl implements ITestService { @Resource private IStudentMapper studentMapper; @Autowired private IAsyncService
阅读全文
摘要:spring aop默认使用JDK还是Cglib动态代理? 一般情况:实现接口类,接口类为JDK ,实现类为Cglib动态代理 springboot2.x默认使用的代理是cglib代理 实现原理: spring.aop.proxy-target-class属性值为true 调用cglib 自动配置,
阅读全文
摘要:1.aop全称Aspect Oriented Programming 面向切面编程 2.aop应用场景 场景一: 记录日志 场景二: 监控方法运行时间 (监控性能) 场景三: 权限控制 场景四: 缓存优化 (第一次调用查询数据库,将查询结果放入内存对象, 第二次调用, 直接从内存对象返回,不需要查询
阅读全文
摘要:执行流程图源文件:https://www.processon.com/view/link/5b825917e4b0d4d65be7066a springboot版本为2.0.7 @SpringBootApplication启动类 @SpringBootApplication public class
阅读全文
摘要:springboot版本为2.0.7 @SpringBootApplication引入@EnableAutoConfiguration @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inher
阅读全文
摘要:springboot版本为2.0.7 @SpringBootApplication是一个组合注解,用于快捷配置启动类 源码如下: @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherite
阅读全文

浙公网安备 33010602011771号