This is the 22nd day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

Mysqldialect.getpagesql = mysqlDialect.getPagesQL = mysqlDialect.getPagesQL = mysqlDialect.getPagesQL

PageHelper is implemented by intercepting the Executor in Mybatis. PageHelper, PageHelper, PageHelper, PageHelper, PageHelper, PageHelper, PageHelper, PageHelper

The package path for the entire project is com.github. Pagehelper.

The interceptor

The package starts with two interceptor classes: PageInterceptor and QueryInterceptor. In the annotations of both classes

 @Signature(type = Executor.class, method = "query"....
Copy the code

That is, and both intercepts Mybatis executors with 4 and 6 arguments. This is also available in the PageHelper wiki.

interface

We also found several interfaces in the package:

Dialect: database Dialect, implemented for different databases.

AutoDialect

: Automatically obtains the dialect, where

is the cache key type.

BoundSqlInterceptor: BoundSql processor. There is also an internal interface:

Chain: indicates a Chain of processors that controls whether to continue execution.

Constant: indicates a Constant interface.

IPage: interface that defines three methods: getPageNum, getPageSize, and getOrderBy.

ISelect: A paging query interface that defines a method, doSelect().

Classes inherited from Mybatis

PageRowBounds: it inherits from org. Apache. Ibatis. Session. RowBounds, contains NO_ROW_OFFSET attribute values, NO_ROW_LIMIT, offset, such as limit, and expanded the field of total, the count.

Exception handling classes:

PageException: Inherits from RuntimeException.

Other categories:

ThreadLocal PageNum page number, pageSize pageSize, startRow start line, endRow end line, total number, pages total number of pages, Boolean type count indicates whether to include count query, Boolean type reasonable indicates whether paging is reasonable, Other parameters including pageSizeZero countColumn orderBy, orderByOnly, SQL interceptor BoundSqlInterceptor, BoundSqlInterceptor. Chain, Paging implementation class dialectClass.

Write in the dialectClass comment

Paging implementation class, you can use {@ link com. Making. Pagehelper. Page. PageAutoDialect} class registered nickname, the “mysql”, for example, “oracle”

We will explain this when we explain how to bind mysql.