mybatis-plus is a free, open source databases project written in Java and released under Apache-2.0. It has 17,474 GitHub stars, 4,448 forks and 34 open issues, and was last pushed 2 months ago. On this registry it ranks #39 of 143 tracked projects in Databases, with 5 head-to-head comparisons available.

What is mybatis-plus?

MyBatis-Plus is an Apache-2.0 enhanced toolkit layered on top of MyBatis that gives Java and Spring Boot developers out-of-the-box CRUD interfaces, a condition-query builder, pagination and code generation, so teams already using MyBatis write less persistence boilerplate without switching ORM.

What it is

MyBatis-Plus lives in the Java ORM and MyBatis ecosystem, registered under Infrastructure & Operations / Databases. It is not a rival to MyBatis but an enhancement of it: the README states it is fully compatible with MyBatis, adds auto configuration on startup, and supplies out-of-the-box interfaces for operating on a database. The project is written in Java, licensed under Apache-2.0, and carries roughly 17,474 stars, 4,448 forks and 34 open issues, with documentation hosted at baomidou.com. Its topics place it alongside mybatis, mybatis-spring, mysql and postgresql, so it is intended for conventional relational persistence in Spring applications.

The concrete problem it solves is boilerplate. In plain MyBatis, routine work such as single-table CRUD, paging, dynamic conditions and primary key handling has to be written and maintained by hand, typically in mapper files and SQL fragments. MyBatis-Plus replaces that work with a small set of interfaces and builders. A mapper that extends BaseMapper gains the standard operations immediately, and a query such as userMapper.selectList(new QueryWrapper().lambda().ge(User::getAge, 18)) produces SELECT * FROM user WHERE age >= 18 without a hand-written statement. The conditional wrapper, the lambda-style API and the paging plugin are what remove that repeated effort.

Key capabilities

  • Full compatibility with MyBatis, so existing mappers and SQL continue to work alongside the toolkit.
  • Auto configuration on startup, removing manual wiring of the framework into the application context.
  • Out-of-the-box database interfaces exposed through BaseMapper, as shown by selectList in the README example.
  • A powerful and flexible where-condition wrapper, with a lambda-style API such as .lambda().ge(User::getAge, 18).
  • Automatic paging operations rather than hand-written page queries.
  • Multiple strategies for primary key generation.
  • An almighty and highly customizable code generator, plus supporting features including SQL injection defense, active record support and pluggable custom interfaces.

Who uses it and how

  • Spring Boot 2 applications adopt it through the mybatis-plus-boot-starter artifact, which is the default starter in the README.
  • Spring Boot 3 and Spring Boot 4 projects use the separate mybatis-plus-spring-boot3-starter and mybatis-plus-spring-boot4-starter artifacts instead, since versions are split per Boot generation.
  • Teams on JDK 11 or later add mybatis-plus-jsqlparser, while JDK 8 projects use mybatis-plus-jsqlparser-4.9, so the parser dependency tracks the runtime rather than the framework.
  • Projects on MySQL and PostgreSQL are the documented database targets, and adopters commonly also consume the separate generator, samples and showcase repositories linked from the README.
  • Organisations needing advanced capabilities look at the Mybatis-Mate enterprise examples, which are published in a separate Gitee repository rather than in this project.

Getting started

Add the MyBatis-Plus dependency from Maven Central under group com.baomidoumybatis-plus-boot-starter for Spring Boot 2, mybatis-plus-spring-boot3-starter for Spring Boot 3, or mybatis-plus-spring-boot4-starter for Spring Boot 4 — using Maven or Gradle, then have the mapper interface extend BaseMapper. No server, image or compose file is involved, because this is a library rather than a service.

How it compares

The tools named in the facts are MyBatis itself and mybatis-spring, and MyBatis-Plus sits above both rather than beside them: it stays compatible with MyBatis and provides its own Spring Boot starters for Boot 2, 3 and 4. Where mybatis-spring covers Spring integration, MyBatis-Plus adds the CRUD interfaces, condition wrapper, pagination, primary key strategies and code generator on top. No list of paid products is given, so no cost or hosting comparison can honestly be drawn here.

When to use it — and when not to

The toolkit is a dependency, not a service, so a self-hoster operates no database, storage or SMTP component on its behalf; the runtime already needed by the application is the only requirement. The main friction is version matching, since the starter varies by Spring Boot generation and the jsqlparser artifact varies by JDK, which is easy to get wrong. Advanced Mybatis-Mate features live in a separate Gitee examples repository, the README mixes Chinese and English and carries a usage notice restricting unauthorized projects, and teams not already on MyBatis gain little from it.

project readme (upstream, from github) — read inline

Mybatis-Plus-Logo

Born To Simplify Development

code style code style code style maven

企业版 Mybatis-Mate 高级特性

添加 微信 wx153666 备注进 mp 群

不允许非法项目使用,后果自负

Special user

aizuda-Logo mall4j-Logo

What is MyBatis-Plus?

MyBatis-Plus is a powerful and enhanced toolkit of MyBatis for simplifying development. It provides efficient, and out-of-the-box features (such as code generation, conditional query builders, pagination plugins...), effectively saving development time

Links

Features

  • Fully compatible with MyBatis
  • Auto configuration on startup
  • Out-of-the-box interfaces for operate database
  • Powerful and flexible where condition wrapper
  • Multiple strategy to generate primary key
  • Lambda-style API
  • Almighty and highly customizable code generator
  • Automatic paging operation
  • SQL Inject defense
  • Support active record
  • Support pluggable custom interface
  • Build-in many useful extensions

Getting started

  • Add MyBatis-Plus dependency

    • Latest Version: Maven Central

    • Maven:

    • SpringBoot2

      
          com.baomidou
          mybatis-plus-boot-starter
          Latest Version
      
    • SpringBoot3

      
        com.baomidou
        mybatis-plus-spring-boot3-starter
        Latest Version
      
    • SpringBoot4 ^3.5.13

      
      com.baomidou
      mybatis-plus-spring-boot4-starter
      Latest Version
      
    • ^3.5.9 may need additional citations

      • jdk11+
      
        com.baomidou
        mybatis-plus-jsqlparser
        Latest Version
      
      • jdk8
      
        com.baomidou
        mybatis-plus-jsqlparser-4.9
        Latest Version
      
    • Gradle

    • SpringBoot2

      implementation group: 'com.baomidou', name: 'mybatis-plus-boot-starter', version: 'Latest Version'
      
    • SpringBoot3

      implementation group: 'com.baomidou', name: 'mybatis-plus-spring-boot3-starter', version: 'Latest Version'
      
    • SpringBoot4

      implementation group: 'com.baomidou', name: 'mybatis-plus-spring-boot4-starter', version: 'Latest Version'
      
  • Modify mapper file extends BaseMapper interface

    public interface UserMapper extends BaseMapper {
    
    }
    
  • Use it

    List userList = userMapper.selectList(
            new QueryWrapper()
                    .lambda()
                    .ge(User::getAge, 18)
    );
    

    MyBatis-Plus will execute the following SQL

    SELECT * FROM user WHERE age >= 18
    

This showcase is just a small part of MyBatis-Plus features. If you want to learn more, please refer to the documentation.

License

MyBatis-Plus is under the Apache 2.0 license. See the Apache License 2.0 file for details.

Frequently asked questions

Is mybatis-plus free to use?

mybatis-plus is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does mybatis-plus do?

An powerful enhanced toolkit of MyBatis for simplify development

What is mybatis-plus written in?

mybatis-plus is primarily written in Java. Its source is publicly available at https://github.com/baomidou/mybatis-plus, and it has 17,474 GitHub stars.