I. Description
There are many kinds of errors caused by MyBatis invalid bound statement (not found), the main reason is that Xxxmapper.java and xxxmapper.xml are not properly bound. There are many reasons for not properly binding, so some people in the online Baidu query to other people's blog after the solution is not able to solve their own problems, here to make a summary of some methods. second, the cause of the error and solutions 2.1 Map Xxxmapper.xml File not scanned
If you are using a MAVEN-built project, the configuration file under Src/main/java is not actively loaded because MAVEN defaults to loading only the configuration files under the Src/main/resources directory. If your mybatis mapping XML file is placed in the same directory as the interface file, you must configure the following in the Pom.xml file:
<!--If you do not add this node, the MyBatis mapper.xml file will be omitted. -
<build>
<resources>
<resource>
<directory>src/main/java</ directory>
<includes>
<include>**/*.properties</include>
<include>**/*. xml</include>
</includes>
<filtering>false</filtering>
</resource >
</resources>
</build>
2.2 Interface name is inconsistent with XML mapping file name
Please check that your Xxxmapper.java file and the Xxxmapper.xml file name are the same;
namespace configuration error in 2.3xml mapping file
namespace must be equal to the full class name of the interface
2.4 The ID value of a label such as Select/delete/update/insert in an XML map file is inconsistent with the method name in the interface
The parametertype value of a label such as Select/delete/update/insert in a 2.5xml mapping file is inconsistent with the type of the parameter of the method in the interface
The type or resulttype of the resultmap of a label such as Select/delete/update/insert in an 2.6 XML map file is inconsistent with the types of the return parameters of the method in the interface
The value of DatabaseID in a label such as Select/delete/update/insert in a 2.7xml mapping file was not found in the spring configuration file
The reasons for the above collation errors are not complete, and this problem occurs later if not the above collected points I will add.