Spring Boot官方文档笔记

  • @Component VS  @Configuration
  • Spring bean初始化顺序如何保证
  • @Controller @Service @Repository 区别,本质
  • Bean初始化机制

 

  • ApplicationContext的层次结构,继承关系
 

  • @PostConstruct

 

  • <aop:advisor>及<aop:aspect>

 

  • Spring事务不支持远程调用的场景,如有此需求,应当使用EJB。
  • Spring事务默认只回滚未检查异常及错误,默认不会滚检查异常。
  • @Transactional只能作用于public方法,而private、protected方法不产生作用。
  • @Transactional可以放在接口定义、接口方法、类定义或者类的public方法之上;
  • @Transactional如果放在接口之上,然而代理中却配置了proxy-target-class=“true”或者mode=“aspectj",那么该配置将无法产生作用。
  • @Transactional 中的mode可选proxy、aspectj,前者是只通过方法调用的代理,后者是通过修改字节码
  • Spring事务与自我调用:
  • Spring事务中需要区分:物理事务及逻辑事务
  • PROPAGATION_REQUIRED
  • PROPAGATION_REQUIRED_NEW
  • PROPAGATION_NESTED   匹配JDBC保存点,参考Spring的DataSourceTransactionManager
  • 编程式事务:TransactionTemplate 及 PlatformTransactionManager
  • 事务绑定事件:@TransactionEventListener

 

  • SpringBoot对Spring MVC的封装 WebMvcConfigurerAdapter   
    • 环境及配置文件的加载:@Profile, 多profile的激活 spring.profiles.active spring.profiles.include
    • @Value @ConfigurationProperty @ImportSource
    • @Validate以及Java提供的@Valid等注解
posted @ 2018-10-31 14:24  清水捞蟹  阅读(184)  评论(0编辑  收藏  举报