mybatis-plus-join
MyBatis-Plus-Join is a Java ORM extension that adds multi-table join support (LEFT JOIN, RIGHT JOIN, etc.) to MyBatis-Plus with a fluent, lambda-style API. It simplifies complex SQL queries while maintaining MyBatis-Plus conventions and is published to Maven Central.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | yulichang/mybatis-plus-join |
| Owner | yulichang |
| Primary language | Java |
| License | Apache-2.0 — OSI-approved |
| Stars | 1.5k |
| Forks | 154 |
| Open issues | 54 |
| Latest release | v1.5.7 (2026-04-16) |
| Last updated | 2026-07-02 |
| Source | https://github.com/yulichang/mybatis-plus-join |
What mybatis-plus-join is
A MyBatis-Plus interceptor/wrapper library that extends MPJBaseMapper with MPJLambdaWrapper for type-safe, chainable join operations. It generates SQL at runtime, supports pagination via MyBatis-Plus plugins, and requires MyBatis-Plus 3.1.2+. Works with MySQL, PostgreSQL, and other SQL dialects.
Get the mybatis-plus-join source
Clone the repository and explore it locally.
git clone https://github.com/yulichang/mybatis-plus-join.gitcd mybatis-plus-join# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Ensure MyBatis-Plus 3.1.2+ and pagination plugin (if pagination is needed) are configured before enabling mybatis-plus-join. Verify database dialect support (MySQL and PostgreSQL confirmed in docs).
- DTOs for result mapping must match selected columns; mismatch will cause runtime failures. Use @TableField annotations or alias naming carefully to avoid column name conflicts in joins.
- Test lambda expressions with actual queries; syntax errors or incorrect field references may only surface during query execution, not compile time.
- Monitor performance of generated SQL; complex joins with many WHERE clauses can produce verbose queries. Consider database indexes on join keys and filter columns.
- Familiarize team with MPJLambdaWrapper API and join method signatures (leftJoin, rightJoin, etc.) to avoid common mistakes like incorrect join condition ordering.
When to avoid it — and what to weigh
- Non-relational or document-based databases — This library targets SQL databases only (MySQL, PostgreSQL). Not suitable for MongoDB, DynamoDB, or other NoSQL stores.
- Graph-heavy or recursive queries — If you need deep hierarchical traversal (e.g., org trees, graph walks), raw SQL or a graph database is clearer. JOINs alone become unwieldy.
- Team unfamiliar with MyBatis-Plus — Adds an additional abstraction layer on top of MyBatis-Plus. Teams new to MyBatis-Plus will face a steeper learning curve; consider simpler ORM alternatives if onboarding speed is critical.
- Extremely high-scale or complex schema evolution — While functional, dynamically generated SQL at runtime may not optimize as well as hand-tuned queries for large-scale systems. Schema refactoring can become fragile if many lambda chains depend on column structure.
License & commercial use
Licensed under Apache License 2.0 (Apache-2.0), an OSI-approved permissive license permitting commercial use, modification, and distribution with attribution and liability/warranty disclaimers.
Apache 2.0 is a permissive open-source license that explicitly allows commercial use without royalty or proprietary restrictions. Typical obligations: include a copy of the license and notice any modifications. Consult legal counsel if bundling proprietary software; no guarantee is provided by the licensor.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Standard SQL injection risks apply if user input is passed unsanitized into lambda expressions. Use parameterized conditions (e.g., eq, like with placeholder values) consistently. No explicit security audit data provided. Verify that MyBatis-Plus 3.1.2+ version does not have known CVEs. Single-author maintenance model may delay security patches.
Alternatives to consider
MyBatis-Plus native BaseMapper with XML
Use raw XML mappers for complex multi-table queries if you prefer explicit SQL control and do not want additional abstraction. Less convenient but more predictable for intricate joins.
Hibernate/JPA with @OneToMany/@ManyToOne
Heavier ORM with built-in entity relationships and lazy loading. Handles complex object graphs automatically but trades performance predictability for ease of use.
QueryDSL or jOOQ
Type-safe, code-generation-based query builders for Java. More mature ecosystem, better IDE support, and broader database support, but heavier dependency and learning curve.
Build on mybatis-plus-join with DEV.co software developers
Evaluate MyBatis-Plus-Join against your ORM requirements. Check the wiki documentation, review the demo project, and assess join complexity in your codebase. For custom integration or migration planning, consult a specialist.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
mybatis-plus-join FAQ
Does MyBatis-Plus-Join support INNER JOIN, FULL OUTER JOIN, etc.?
Can I use MyBatis-Plus-Join with Spring Boot and existing MyBatis-Plus code?
What happens if my DTO field names don't match joined table columns?
Is there a limit on the number of tables I can JOIN?
Custom software development services
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If mybatis-plus-join is part of your open-source databases roadmap, our team can implement, customize, migrate, and maintain it.
Ready to streamline multi-table queries in your MyBatis-Plus project?
Evaluate MyBatis-Plus-Join against your ORM requirements. Check the wiki documentation, review the demo project, and assess join complexity in your codebase. For custom integration or migration planning, consult a specialist.