Resolving MyBatis-Plus XML Mapper Scanning Issues in Spring Boot with Gradle
Project Setup with MyBatis-Plus and Gradle
Start with a standard Spring Boot 2.3.x project using Gradle. Below is a minimal build.gradle configuration:
plugins {
id 'org.springframework.boot' version '2.3.12.RELEASE'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNA ...
Posted on Wed, 29 Jul 2026 16:25:04 +0000 by suge
Troubleshooting MyBatis and MyBatis-Plus Mapper Binding Failures
When working with MyBatis or MyBatis-Plus in Spring Boot applications, encountering "Invalid bound statement (not found)" exceptions typically indicates that mapper interfaces cannot locate their corresponding XML mapping files. This guide outlines common misconfigurations and their solutions.
Mapper Location Configuration
The primary ...
Posted on Fri, 03 Jul 2026 16:18:29 +0000 by ident
Advanced MyBatis XML Mapping: Parameter Handling and Dynamic SQL
Parameter Passing Mechanisms
When invoking mapper methods, parameters can be transferred to the XML mapping file using several distinct strategies:
JavaBean Properties: MyBatis utilizes the getter and setter methods of a Java object to bind parameters. The OGNL expression used in the XML should match the property name.
Map Keys: When passing a ...
Posted on Wed, 01 Jul 2026 16:01:16 +0000 by jpt62089