Skip to content
loafer edited this page Feb 27, 2014 · 2 revisions

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\mysql
  • dialectClass, a subclass of com.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.

Clone this wiki locally