博客
关于我
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/

你可能感兴趣的文章
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named 'pandads'
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>