#MyBatis Pagination - PageHelper
If you are using MyBatis, it is recommended to try this pagination plugin. This must be the Most Convenient pagination plugin.
PageHelper support any complex single-table, multi-table queries. Some special cases please see the Important note.
Want to use PageHelper? Please see How to use PageHelper.
##Physical Paging
PageHelper supports the following databases:
Oracle
Mysql
MariaDB
SQLite
Hsqldb
PostgreSQL
DB2
SqlServer(2005,2008)
Informix
H2
SqlServer2012
Derby
PageHelper will detect the current database url by default, automatically select the corresponding database dialect.
You can configure helperDialect
Property to specify the dialect.
You can use the following abbreviations :
oracle
, mysql
, mariadb
, sqlite
, hsqldb
, postgresql
,
db2
, sqlserver
, informix
, h2
, sqlserver2012
, derby
Or You can use the dialect full name, such as com.github.pagehelper.dialect.helper.MySqlDialect
.
Special note : When using the SqlServer2012 database,
you need to manually specify for sqlserver2012
, otherwise it will use the SqlServer2005 for paging.
##MyBatis Tools:http://mybatis.tk ##mybatis-3 https://github.com/mybatis/mybatis-3 ##Support MyBatis 3.1.0+
##PageHelper 5.0 Due to pagination plugin version 5.0 and 4.2. X completely different, so the master branch is 5.X version. version 4.2 exists as a branch, if you have PR for 4.2, please submitted to the branch.
##Latest Release 5.0.0-beta
To use PageHelper you just need to include the pagehelper-x.x.x.jar and jsqlparser-0.9.5.jar file in the classpath.
If you are using Maven just add the following dependency to your pom.xml:
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.0.0-beta</version>
</dependency>
##Latest Changelog
###5.0.0-beta
- Use a better way to handle paging logic
- New pagination plugin interceptor
com.github.pagehelper.PageInterceptor
- New
Dialect
PageHelper
is a special implementation class, the previous function is implemented in more user-friendly ways - New pagination plugin only a
dialect
parameter, the defaultdialect
isPageHelper
PageHelper
continue to support previously provided parameters, Among the latest to use the document has been fully updatedPageHelper
has ahelperDialect
parameter which is the same functional as the previousdialect
- Added paging implementation based on pure
RowBounds
andPageRowBounds
, incom.github. pagehelper. dialect. rowbounds
package, it is used asdialect
Parameter sample implementation, more detailed documentation will be added later - Removed inappropriate orderby functions that appear in pagination plugin. It will provide a separate sort plug-ins in the future
- Remove
PageHelper
are less commonly used methods - A new document, an important part of the update has been mentioned in the changelog, provides the English version of this document
##Documentation
If you are unfamiliar with Spring integration, you can refer to the following two MyBatis and Spring Integration Framework:
The two Integrated Framework integrates PageHelper and Common Mapper。
###How to use in simple RowBounds style
###Implement your own pagination plugin
- helperDialect style
- dialect style
##Submit BUG
##Author Info
Blog:http://blog.csdn.net/isea533
Email: abel533@gmail.com
PageHelper on github:https://github.com/pagehelper/Mybatis-PageHelper
PageHelper on gitosc:http://git.oschina.net/free/Mybatis_PageHelper