MyBatis-Plus extends MyBatis with code generation, conditional query builders, and pagination helpers. It stays compatible with MyBatis while adding convenience APIs for common CRUD work.
Overview
MyBatis-Plus is an enhancement layer on top of MyBatis for Java applications. The project positions itself as additive only: it does not replace MyBatis semantics, but supplies extra utilities aimed at reducing repetitive database code.
Typical capabilities include automatic configuration on startup, generic mapper interfaces extended from BaseMapper, flexible WHERE condition wrappers, lambda-style query APIs, automatic paging, SQL injection defenses, active record patterns, and pluggable custom interfaces. A code generator can scaffold entities and mappers from database metadata.
Integration centers on Spring Boot through published Maven and Gradle starters, with optional test starters for @MybatisPlusTest and optional JSqlParser modules when SQL-parsing plugins such as pagination are required. Teams already using MyBatis can adopt the toolkit incrementally without restructuring existing mappers.
The ecosystem around the project includes related IDE plugins and companion modules for advanced enterprise features such as multi-datasource routing and distributed locking, though those ship as separate products from the same vendor family.
Key features
- MyBatis-compatible auto configuration
- BaseMapper CRUD interfaces
- Conditional WHERE wrappers
- Lambda query API
- Automatic pagination plugin
- SQL injection defense
- Code generator
- Active record support
Use cases
- Spring Boot services needing fast CRUD
- Teams standardizing MyBatis data access
- Projects wanting generated entity mappers
- Applications requiring flexible dynamic queries
- Java backends targeting MySQL or PostgreSQL