mybatis 拦截器Interceptor 笔记

来源:互联网 发布:安卓玩pc java游戏 编辑:程序博客网 时间:2024/06/05 10:22
笔记:
假设拦截器配置拦截Executor.update方法。初始化的时候通过Plugin中动态代理重新封装了新的Executor 类,调用的Executor.update 就会就会调用
拦截器的方法。

参考:

http://www.voidcn.com/blog/yhjyumi/article/p-4419488.html 给出了mybatis的拦截器的原理图
http://www.cnblogs.com/fangjian0423/p/mybatis-interceptor.html 通过源码解析拦截器实现原理
http://elim.iteye.com/blog/1851081 解析拦截器的原理并给出分页实现方案。

若运行mybatis报错:on interface org.apache.ibatis.executor.statement.StatementHandler named prepare
参考:https://my.oschina.net/slfujie/blog/741311