博客
关于我
Mybatis源码学习第七天(PageHelper分析)
阅读量:424 次
发布时间:2019-03-06

本文共 790 字,大约阅读时间需要 2 分钟。

其实我本来是不打算写这个PageHelper的,但是后来想了想,还是写了吧!现在市场用Mybatis的产品分页应该差不多都是用PageHelper来实现的,毕竟Mybatis的分页rowbound...不说了之前说了,反正是没人用;

分页插件的使用:

中文文档:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/README_zh.md

使用手册:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md

注意事项:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Important.md

使用步骤:

添加Maven依赖:

com.github.pagehelper
pagehelper
5.1.11

在mybatis-config.xml的plugins中配置就可以了

具体还可以配置什么属性,大家可以去看API,我在这里就不搬砖了;

使用的话就是在查询前添加这么一行代码就可以个,两个参数,页码,页容量:PageHelper.startPage

使用之前一定要看注意事项,否则出了问题,你就嘿嘿嘿了;

至于源码我就不分析了;因为PageHelper本身就是国人写的,代码中都是中文注释,大家有兴趣自己去下载看看吧;

作者:彼岸舞

时间:2020\03\24

内容关于:Mybatis

本文部分来源于网络,只做技术分享,一概不负任何责任

转载地址:http://xpnuz.baihongyu.com/

你可能感兴趣的文章
Nginx/Apache反向代理
查看>>
Nginx: 413 – Request Entity Too Large Error and Solution
查看>>
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
nginxWebUI runCmd RCE漏洞复现
查看>>
nginx_rtmp
查看>>
Nginx、HAProxy、LVS
查看>>
nginx一些重要配置说明
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx与Tengine安装和使用以及配置健康节点检测
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>
Nginx中使用keepalive实现保持上游长连接实现提高吞吐量示例与测试
查看>>
Nginx中实现流量控制(限制给定时间内HTTP请求的数量)示例
查看>>
nginx中配置root和alias的区别
查看>>
nginx主要流程(未完成)
查看>>
Nginx之二:nginx.conf简单配置(参数详解)
查看>>
Nginx从入门到精通
查看>>
Nginx代理websocket配置(解决websocket异常断开连接tcp连接不断问题)
查看>>