1 分页内容存储
2 mybatis Interceptor
在使用PageHelper的时候我很想知道它的分页信息存储位置,似乎是存在当前请求线程中。
分页信息存储 作者的例子
https://github.com/abel533/MyBatis-Spring-Boot
分页内容,
PageHelper.startPage这个方法,这个方法把分页信息存储在了当前线程中,就是把数据存储在了线程中,
PageHelper.beforeCount 调用了com.github.pagehelper.dialect.AbstractHelperDialect.AbstractHelperDialect.getLocalPage
这个方法是在PageInterceptor也就是一个mybatis Interceptor,
具体的可以看下这篇文章
https://blog.youkuaiyun.com/cuihaiyang/article/details/75452539
或者官方的简单文章
http://www.mybatis.org/mybatis-3/configuration.html#plugins