You will encounter this problem when using MAVEN to do mybatis projects.
Invalid bound statement (not found)
Reason:
1. An implementation class that lacks an interface when it is developed in the original way.
2. Use an XML file that is less mapped when the agent is developed.
I'm using agent development when I'm having this problem, but I have a mapped XML file.
Here we follow a principle of agent development, the mapping class and the corresponding XML file should be in the same package, after compiling we look at the results
Without seeing the XML file, this is the reason for the report exception.
A configuration is also required to use MAVEN, because MAVEN will only process the configuration files in the resources, and the mapper XML file is in the Java folder, so it is ignored by Maven.
Solve the problem of not copying mapper mapping files
You need to modify the Pom file for DAO Engineering. Add the following content:
<!--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>
*.properties and *.xml configuration files under Src/main/java are placed in the resources.
Maven Project: Invalid bound statement