Solve the exception of Invalid bound statement (not found)

When building the framework today, an exception of Invalid bound statement (not found) was reported

After analysis, the reasons were found:

My dao and mapper.xml related to mybatis are generated by reverse engineering, and the generated names are all ending in Mapper, such as UserMapper.java, UserMapper.xml

It is customary to change UserMapper.java to UserDao.java

However, the corresponding namespace of UserMapper.xml has not been changed, which is equivalent to that UserDao.java and UserMapper.xml are not associated, so mybatis will report the error of no binding;



After the names correspond, there will be no more errors. If this problem occurs, either the path is wrong, or the name is wrong. Just check it carefully.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325444673&siteId=291194637