Springboot mybatis error: invalid bound statement (not found)

Time:2021-1-26

1. Problem description

Create a new springboot project to integrate mybatis, mapper.xml The file is placed under resource mybatis.mapper Under the table of contents:
Springboot mybatis error: invalid bound statement (not found)
Start the item item, execute the query in XML, SQL report error:
Springboot mybatis error: invalid bound statement (not found)
SQL is not bound.

2. Debugging tracking

Debug discovery when you can start a project mapper.xml Unable to load.
A variety of comparison and tracking source code found when
Mapper locations is set to classpath:mybatis.mapper/ * Mapper.xml
The program is normal.

3. Results

The result shows that there is a problem in creating the directory file under resource.
Springboot mybatis error: invalid bound statement (not found)
Instead of creating a secondary directory folder, a folder named“ mybatis.mapper “At the first level. By rebuilding a mybatis folder and a mapper subfolder, the problem is solved.
Springboot mybatis error: invalid bound statement (not found)

Recommended Today

Practice of query operation of database table (Experiment 3)

Following the previous two experiments, this experiment is to master the use of select statements for various query operations: single table query, multi table connection and query, nested query, set query, to consolidate the database query operation.Now follow Xiaobian to practice together!Based on the data table (student, course, SC, teacher, TC) created and inserted in […]