Spring初始化阶段使用分页插件失效
@PostConstruct
public PageInfo<HostVersionFun> queryHostVersionFunOfPage(int currentPage, int pageNum) {
log.info("分页查询查询开始,当前页:{},每页记录数:{}",currentPage,pageNum);
PageHelper.startPage(currentPage, pageNum);
HostversionfunExample example = new HostversionfunExample();
List<HostVersionFun> list = hostVersionFunMapper.selectByExample(example);
return new PageInfo<>(list);
}
一、框架中接口与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有什么区别,能不能一块用