博客
关于我
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
查看>>
nginx + etcd 动态负载均衡实践(一)—— 组件介绍
查看>>
nginx + etcd 动态负载均衡实践(三)—— 基于nginx-upsync-module实现
查看>>
nginx + etcd 动态负载均衡实践(二)—— 组件安装
查看>>
nginx + etcd 动态负载均衡实践(四)—— 基于confd实现
查看>>
Nginx + Spring Boot 实现负载均衡
查看>>
Nginx + Tomcat + SpringBoot 部署项目
查看>>
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
nginx - thinkphp 如何实现url的rewrite
查看>>
Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)
查看>>
Nginx - 反向代理与负载均衡
查看>>
nginx 1.24.0 安装nginx最新稳定版
查看>>
nginx 301 永久重定向
查看>>
nginx 301跳转
查看>>
nginx 403 forbidden
查看>>
nginx connect 模块安装以及配置
查看>>
nginx css,js合并插件,淘宝nginx合并js,css插件
查看>>
Nginx gateway集群和动态网关
查看>>
nginx http配置说明,逐渐完善。
查看>>