Mybatis source of learning on the seventh day (PageHelper analysis)

In fact, I did not intend to write this PageHelper, but then thought, or wrote it! Now the market with Mybatis product page should almost always use PageHelper to achieve, after all Mybatis paging rowbound ... do not say I said before, nobody uses anyway;

Pagination plug-in use:

Chinese document: https: //github.com/pagehelper/Mybatis-PageHelper/blob/master/README_zh.md

Manual: https: //github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md

Note: https: //github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Important.md

Steps for usage:

Add Maven dependence:

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

Configure the plugins mybatis-config.xml in on it

<plugin interceptor="com.github.pagehelper.PageInterceptor">
    <property name="pageSizeZero" value="true">
</plugin>

You can also configure what specific attributes, we can see API, I'm not here to move the bricks;

Use of such words is to add a line of code before the query can be one, two parameters, page numbers, capacity: PageHelper.startPage

Must see note before use items, otherwise a problem, you Hey Hey;

As I do not analyze the source code; PageHelper itself because people write code comments are Chinese, we are interested to see it yourself to download;

Author: Atlantic Dance

Time: 2020 \ 03 \ 24

Content About: Mybatis

This article from the network, only technology sharing, shall not accept any liability

Guess you like

Origin www.cnblogs.com/flower-dance/p/12561936.html
Recommended