mybatis-paging
Based on the database dialect Mybatis3 paging plug-in.
The current support for Oracle、 MySQL .
Basic Usage
include the following in mybatis-config.xml.
<plugins>
<plugin interceptor="com.github.loafer.mybatis.pagination.PaginationInterceptor">
<property name="dialect" value="oracle"/>
<property name="stmtIdRegex" value="*.selectPaging"/>
</plugin>
</plugins>
or
<plugins>
<plugin interceptor="com.github.loafer.mybatis.pagination.PaginationInterceptor">
<property name="dialectClass" value="com.github.loafer.mybatis.pagination.dialect.OracleDialect"/>
<property name="stmtIdRegex" value="*.selectPaging"/>
</plugin>
</plugins>
dialect
, database type. oracle\mysqldialectClass
, a subclass ofcom.github.loafer.mybatis.pagination.dialect.Dialect
.stmtIdRegex
, statement id regex string. example:*.selectPaging
or*.selectPaging*
.
SQL Mapper config
<select id="selectPaging" resultType="hashmap">
select * from ent_user
</select>
@See config and Basic Usage
Others
In addition, sogyf/mybatis-pagination maybe help you.