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.baomidou — mybatis-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.