红联Linux门户
Linux帮助

Mybatis分页插件PageHelper 5.1.0发布

发布时间:2017-08-29 09:16:03来源:红联作者:baihuo
Mybatis分页插件 - PageHelper 5.1.0 发布了。如果你也在用Mybatis,建议尝试该分页插件,这一定是最方便使用的分页插件。

该插件目前支持以下数据库的物理分页

Oracle

Mysql

MariaDB

SQLite

Hsqldb

PostgreSQL

DB2

SqlServer(2005+)

Informix

H2

SqlServer2012

Derby

Phoenix

如果你使用 Maven 可以在pom.xml 中添加下面的依赖:[code]
com.github.pagehelper
pagehelper
5.1.0
[/code]如果使用Spring Boot,可以直接添加下面的依赖:[code]
com.github.pagehelper
pagehelper-spring-boot-starter
1.2.0
[/code]5.1.0

增加 4.x 以前版本包含的排序功能,用法一致(PageHelper增加了几个排序相关的方法)。

分页 SQL 转换为预编译 SQL。

增加 ReplaceSql 接口用于处理 sqlServer 的 with(nolock) 问题,增加了针对性的 replaceSql 参数,可选值为 simple和 regex,或者是实现了ReplaceSql接口的全限定类名。默认值为 simple,仍然使用原来的方式处理,新的 regex 会将如 table with(nolock) 处理为 table_PAGEWITHNOLOCK。

PageRowBounds 增加 count 属性,可以控制是否进行 count 查询。

软件详情:http://git.oschina.net/free/Mybatis_PageHelper

来自:开源中国社区
文章评论

共有 0 条评论