PageHelper分页插件的用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/reed1991/article/details/79053963

1.在maven中引入相应的jar包

<dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
            <version>4.1.6</version>
        </dependency>

2.在sqlMapConfig.xml中引入相应的plugin

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
    <plugins>
        <!-- com.github.pagehelper为PageHelper类所在包名 -->
        <plugin interceptor="com.github.pagehelper.PageHelper">
            <!-- 设置数据库类型 Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreSQL六种数据库-->
            <property name="dialect" value="mysql"/>
        </plugin>

    </plugins>

</configuration>

3.


猜你喜欢

转载自blog.csdn.net/reed1991/article/details/79053963
今日推荐