使用mybatis时选择分页插件PageHelper 5.0.0
来源:互联网 发布:美图还原软件 编辑:程序博客网 时间:2024/06/06 02:12
Mybatis分页插件 - PageHelper PageHelper 5.0.0 发布了。如果你也在用Mybatis,建议尝试该分页插件,这一定是最方便使用的分页插件。分页插件支持任何复杂的单表、多表分页,部分特殊情况请看重要提示。想要使用分页插件?请看如何使用分页插件。
该插件目前支持以下数据库的物理分页:
Oracle
Mysql
MariaDB
SQLite
Hsqldb
PostgreSQL
DB2
SqlServer(2005,2008)
Informix
H2
SqlServer2012
Derby
使用 PageHelper 你只需要在 classpath 中包含 pagehelper-x.x.x.jar 和 jsqlparser-0.9.5.jar。
如果你使用 Maven,你只需要在 pom.xml 中添加下面的依赖:
<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.0.0</version></dependency>
与分页插件 PageHelper 5.0.0 同时发布的还有 pagehelper-spring-boot-starter。
如果你使用 Spring Boot,你只需要在 pom.xml 中添加下面的依赖:
<dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.0.0</version></dependency>
有关 pagehelper-spring-boot-starter 的用法可以参考集成示例 https://github.com/abel533/MyBatis-Spring-Boot
新版分页插件 使用 [QueryInterceptor 规范](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/src/main/java/com/github/pagehelper/QueryInterceptor.java) 处理分页逻辑,与 4.x 版本相比有很大不同,新版逻辑更简单,更方便实现自己的分页逻辑。
5.0.0 更新日志:
使用 [QueryInterceptor 规范](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/src/main/java/com/github/pagehelper/QueryInterceptor.java) 处理分页逻辑
新的分页插件拦截器为 `com.github.pagehelper.PageInterceptor`
新的 `PageHelper` 是一个特殊的 `Dialect` 实现类,以更友好的方式实现了以前的功能
新的分页插件仅有 `dialect` 一个参数,默认的 `dialect` 实现类为 `PageHelper`
PageHelper` 仍然支持以前提供的参数,在最新的使用文档中已经全部更新
`PageHelper` 的 `helperDialect` 参数和以前的 `dialect` 功能一样,具体可以看文档的参数说明
增加了基于纯 `RowBounds` 和 `PageRowBounds` 的分页实现,在 `com.github.pagehelper.dialect.rowbounds` 包中,这是用于作为 `dialect` 参数示例的实现,后面会补充更详细的文档
去掉了不适合出现在分页插件中的 orderby 功能,以后会提供单独的排序插件
去掉了 `PageHelper` 中不常用的方法
新的文档,更新历来更新日志中提到的重要内容,提供英文版本文档
解决 bug [#149](http://git.oschina.net/free/Mybatis_PageHelper/issues/149)
所有分页插件抛出的异常改为 PageException
文章转自:http://www.oschina.net/news/80614/pagehelper-5-0-0
- 使用mybatis时选择分页插件PageHelper 5.0.0
- Mybatis分页插件-PageHelper(5.0)的使用
- Mybatis分页插件-PageHelper(5.0)的使用
- Mybatis 使用 PageHelper 插件分页
- mybatis pagehelper分页插件使用
- Mybatis 使用 PageHelper 插件分页
- Mybatis pagehelper分页插件使用
- 【MyBatis】MyBatis分页插件PageHelper的使用
- 【MyBatis】MyBatis分页插件PageHelper的使用
- 【MyBatis】MyBatis分页插件PageHelper的使用
- MyBatis分页插件PageHelper
- mybatis分页插件pagehelper
- Mybatis分页插件-pagehelper
- Mybatis分页插件 - PageHelper
- Mybatis分页插件PageHelper
- Mybatis分页插件PageHelper
- MyBatis分页插件PageHelper
- mybatis插件分页PageHelper
- C# private ,protected ,public ,protected internal区别
- 矩阵微分(matrix derivatives)
- SQLServer2008中查询语句的疑问,求网友大神解答
- 用bochs调试自己写的系统引导代码
- Hibernate 初始之Java建立工程
- 使用mybatis时选择分页插件PageHelper 5.0.0
- 几种常用的数学算法
- C++网络编程基础代码(客户端)--基于TCP协议
- Java字符串(二)--格式化字符串
- nodejs Java SSH Git ADB 全局配置
- Spring的AOP配置
- 设计模式--适配器模式
- HDU1257 最长递增公共子序列问题
- 动态规划算法常见题型