explaingit

pagehelper-org/mybatis-pagehelper

12,360JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

A Java plugin that automatically adds pagination to MyBatis database queries, supporting 20+ databases including MySQL, PostgreSQL, and Oracle without changing your SQL code.

Mindmap

mindmap
  root((PageHelper))
    What it does
      Auto pagination
      Multi-database SQL
    Tech stack
      Java
      MyBatis
      Spring Boot
      Maven
    Use cases
      Paginate results
      Switch databases
    Audience
      Java developers
      Backend engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add pagination to a Spring Boot app that queries a MySQL database using MyBatis without rewriting any SQL.

USE CASE 2

Build a web app that displays a paginated list of results and switch between database vendors without changing pagination code.

USE CASE 3

Support domestic Chinese databases or cloud databases alongside standard MySQL and PostgreSQL in a Java application.

Tech stack

JavaMyBatisMavenSpringSpring Boot

Getting it running

Difficulty · easy Time to first run · 30min

Add the Maven dependency and configure the plugin interceptor once, no SQL changes needed after that.

In plain English

Mybatis-PageHelper is a Java plugin that adds pagination to applications built with MyBatis, a popular tool for connecting Java apps to databases. Pagination means splitting a large set of database results into numbered pages: instead of loading all 50,000 records at once, the app loads the first 20, then the next 20, and so on. This is standard behavior for any app that displays lists of data. MyBatis itself does not include built-in pagination that works across different database systems, because each database (MySQL, PostgreSQL, Oracle, SQL Server, and others) handles pagination using different SQL syntax. This plugin detects which database your app is connected to and automatically writes the correct SQL for that database. The README lists more than 20 supported databases, including major cloud and domestic Chinese databases. Java developers add the plugin to their project by including a Maven dependency and configuring it once. After that, wrapping any database query with a simple call triggers automatic pagination without changing the query itself. The plugin works with Spring, Spring Boot, and standard MyBatis setups. The README is written in Chinese and points to external wiki pages for full setup and usage instructions. An English README is also available in the repository. The project is maintained by its original author and has a companion book on MyBatis available for purchase in Chinese bookstores.

Copy-paste prompts

Prompt 1
I have a Spring Boot app using MyBatis that queries all users from a table. Show me how to add MyBatis-PageHelper so results are returned 20 per page.
Prompt 2
How do I configure MyBatis-PageHelper in a Spring Boot project using a Maven pom.xml dependency?
Prompt 3
My Java app using MyBatis-PageHelper needs to work with both MySQL and Oracle. Do I need different settings for each database, and how does the plugin detect which one to use?
Open on GitHub → Explain another repo

← pagehelper-org on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.