Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.47 KB

README.md

File metadata and controls

42 lines (33 loc) · 1.47 KB

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\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.