What’s New in MyBatis-Plus 4.0? Key Features and Update Log Explained

MyBatis-Plus, a MyBatis enhancement toolkit, streamlines CRUD development, celebrates its fifth consecutive OSC popularity award, and introduces version 4.0 with a comprehensive update log that includes MyBatis 3.5.9 upgrade, dynamic mapper injection, new hooks, and numerous performance and compatibility improvements.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
What’s New in MyBatis-Plus 4.0? Key Features and Update Log Explained

MyBatis-Plus is an enhancement toolkit for MyBatis that simplifies CRUD operations by injecting single‑table SQL during XML configuration loading, aiming to improve development productivity.

In 2022 the project set a goal to refactor to version 4.0, and it has been listed among the OSC most popular software for five consecutive years, thanking supporters and wishing a happy New Year.

Demo samples are available at https://gitee.com/baomidou/mybatis-plus-samples and documentation at https://baomidou.com/.

Update Log

Upgrade MyBatis to 3.5.9

Upgrade jsqlparser to 4.3

Add removal of Mapper‑related cache, support dynamic injection of Mapper via GroovyClassLoader

Add hook function for dynamic table names, https://github.com/baomidou/mybatis-plus/pull/3965

Optimize DefaultSqlInjector adjustments

Refactor ReflectionKit: change field‑>field to Function.identity()

BaseMapper adds new method exist Fix issue where lowercase “from” in sysbase prevented correct index retrieval

Add ability to obtain Mapper via entity class:

BaseMapper<Entity> mapper = SqlHelper.getMapper(Entity.class);

Optimize injection method byId

Fix multi‑tenant right join bug, https://gitee.com/baomidou/mybatis-plus/issues/I4FP6E, https://github.com/baomidou/mybatis-plus/pull/4035

Optimize custom injection method names, https://github.com/baomidou/mybatis-plus/pull/4159

Add support for SAP HANA in‑memory database

Add SimpleQuery toolbar query

Modify SQL injection validation utility code

Organize usage of string constants

Upgrade license‑gradle‑plugin version

Custom injection method name optimization (incompatible)

Overload columnsToString method to allow subclass adjustments

Fix et judgment logic, https://gitee.com/baomidou/mybatis-plus/issues/I4L4XV

Logical delete byId now supports conversion to entity delete fill

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendjavaORMmybatis-plusCRUDOpenSource
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.