How pagehelper/mybatis-pagehelper works
Project type and purpose
• This is a Java library—specifically a MyBatis plugin (“PageHelper”)—that transparently adds pagination capabilities to MyBatis‐powered data access. It hooks into MyBatis’s Executor via interceptors, parses and rewrites SQL, and supports a wide range of database dialects.
File structure
• Top level:
• pom.xml, .github/, LICENSE, README.md (project meta, CI, release)
• wikis/ (usage guides, changelog)
• src/main/java/com/github/pagehelper:
• PageHelper API entry (PageHelper, PageInterceptor, QueryInterceptor)
• Dialect packages (auto, helper, replace, rowbounds, AbstractDialect classes)
• parser (CountSqlParser, OrderBySqlParser, SqlParserUtil, etc.)
• cache (CacheFactory, GuavaCache, SimpleCache)
• util (ClassUtil, SqlSafeUtil, MetaObjectUtil, etc.)
• src/test : exhaustive test suites against multiple databases and configurations.
README for additional insights
• Targets MyBatis 3.1.0+ and JDK 8+
• Depends on pagehelper-x.y.z.jar and jsqlparser-x.y.z.jar
• Registers “alias→Dialect” mappings for many DBs, plus auto‐dialect resolution
• Illustrates interceptor usage, configuration properties, and extension points