Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.lyx.mybatis.dao.UserDao.queryUserByIdInStudentArray
1. 第一种情况:IDEA maven项目默认不会把src下除java文件外的文件打包到classes文件夹下,需要在pom.xml中增加配置如下:
<build>
<resources>
<resource>
<directory>src/main/java/</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
2. 第二种情况使用package标签映射mapper文件 , resources目录和java目录中的 xml文件名要与 接口名一一对应,完全一致。
mapper标签使用class映射
3. 运行成功