Spring初始化阶段使用分页插件失效

  1. @PostConstruct
  2. public PageInfo<HostVersionFun> queryHostVersionFunOfPage(int currentPage, int pageNum) {
  3. log.info("分页查询查询开始,当前页:{},每页记录数:{}",currentPage,pageNum);
  4. PageHelper.startPage(currentPage, pageNum);
  5. HostversionfunExample example = new HostversionfunExample();
  6. List<HostVersionFun> list = hostVersionFunMapper.selectByExample(example);
  7. return new PageInfo<>(list);
  8. }

一、框架中接口与xml文件中sql关联

关联方式?
怎么具体执行的?

二、框架中拦截器数量以及调用顺序

mybatis四个执行器

1.Excutor

1.SimpleExecutor【默认执行器】
2.ReuseExecutor
3.BatchExecutor
SqlSessionFactory在生产Session时,根据executorType,生产对应的执行器。
2.ParameterHandler
3.SetmentHandler
4.ResultHandler

拦截器实现方式

1.实现Interceptor接口

在配置文件中使用标签配置。


2.使用Interceptor注解

mybatis在解析全局配置文件时,会将所有拦截器,利用反射方式(通过构造函数)进行实例化,并保存在Configuration#interceptorChain中,

三、框架缓存机制以及缓存的是什么

周稳:
mybatis和mybatis plus有什么区别,能不能一块用