GithubHelp home page GithubHelp logo

c4sparks / mybatis-pagehelper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pagehelper/mybatis-pagehelper

0.0 0.0 0.0 5 MB

Mybatis通用分页插件

Home Page: https://mybatis.io

License: MIT License

Java 100.00%

mybatis-pagehelper's Introduction

MyBatis Pagination - PageHelper

MyBatis 分页插件 - PageHelper

Build Status Maven central

English

如果你也在用 MyBatis,建议尝试该分页插件,这一定是最方便使用的分页插件。

分页插件支持任何复杂的单表、多表分页,部分特殊情况请看重要提示

想要使用分页插件?请看如何使用分页插件

新增 JavaDoc 文档

文档地址:https://apidoc.gitee.com/free/Mybatis_PageHelper

Method API: https://apidoc.gitee.com/free/Mybatis_PageHelper/com/github/pagehelper/page/PageMethod.html

《MyBatis 从入门到精通》

MyBatis 从入门到精通

京东当当亚马逊

CSDN博客:http://blog.csdn.net/isea533/article/details/73555400

GitHub项目:https://github.com/mybatis-book/book

物理分页

该插件目前支持以下数据库的物理分页 PageAutoDialect:

static {
        //注册别名
        registerDialectAlias("hsqldb",HsqldbDialect.class);
        registerDialectAlias("h2",HsqldbDialect.class);
        registerDialectAlias("phoenix",HsqldbDialect.class);
        registerDialectAlias("postgresql",PostgreSqlDialect.class);
        registerDialectAlias("mysql",MySqlDialect.class);
        registerDialectAlias("mariadb",MySqlDialect.class);
        registerDialectAlias("sqlite",MySqlDialect.class);
        registerDialectAlias("herddb",HerdDBDialect.class);
        registerDialectAlias("oracle",OracleDialect.class);
        registerDialectAlias("oracle9i",Oracle9iDialect.class);
        registerDialectAlias("db2",Db2Dialect.class);
        registerDialectAlias("informix",InformixDialect.class);
        //解决 informix-sqli #129,仍然保留上面的
        registerDialectAlias("informix-sqli",InformixDialect.class);
        registerDialectAlias("sqlserver",SqlServerDialect.class);
        registerDialectAlias("sqlserver2012",SqlServer2012Dialect.class);
        registerDialectAlias("derby",SqlServer2012Dialect.class);
        //达梦数据库,https://github.com/mybatis-book/book/issues/43
        registerDialectAlias("dm",OracleDialect.class);
        //阿里云PPAS数据库,https://github.com/pagehelper/Mybatis-PageHelper/issues/281
        registerDialectAlias("edb",OracleDialect.class);
        //神通数据库
        registerDialectAlias("oscar",OscarDialect.class);
        registerDialectAlias("clickhouse",MySqlDialect.class);
        //瀚高数据库
        registerDialectAlias("highgo",HsqldbDialect.class);
        //虚谷数据库
        registerDialectAlias("xugu",HsqldbDialect.class);
        //人大金仓数据库
        registerDialectAlias("kingbase",PostgreSqlDialect.class);
        }

如果你使用的数据库不在这个列表时,你可以配置 dialectAlias 参数。

这个参数允许配置自定义实现的别名,可以用于根据 JDBCURL 自动获取对应实现,允许通过此种方式覆盖已有的实现,配置示例如(多个配置时使用分号隔开):

<property name="dialectAlias" value="oracle=com.github.pagehelper.dialect.helper.OracleDialect"/>

Executor 拦截器高级教程 - QueryInterceptor 规范

分页插件 5.0

由于分页插件 5.0 版本和 4.2.x 实现完全不同,所以 master 分支为 5.x 版本,4.2 作为一个分支存在,如果有针对 4.2 的 PR,请注意提交到分支版本。

集成

使用 PageHelper 你只需要在 classpath 中包含 pagehelper-x.y.z.jarjsqlparser-x.y.z.jar

pagehelper 和 jsqlparser 对应关系参考 pom.xml 中的依赖版本。

如果你使用 Maven,你只需要在 pom.xml 中添加下面的依赖:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>最新版本</version>
</dependency>

如果你使用 Spring Boot 可以参考: pagehelper-spring-boot-starter

继续查看配置和用法

文档:

Spring 集成示例

提交 BUG

感谢 JetBrains 免费的开源授权

项目的发展离不开你的支持

请作者喝杯咖啡吧!

作者信息

网站:https://mybatis.io

作者博客:http://blog.csdn.net/isea533

作者邮箱: [email protected]

如需加群,请通过 http://mybatis.io 首页按钮加群。

本项目在 github 的项目地址:https://github.com/pagehelper/Mybatis-PageHelper

本项目在 gitosc 的项目地址:http://git.oschina.net/free/Mybatis_PageHelper

MyBatis-3

MyBatis 专栏:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.