1.用文件路径引入映射器
<mappers>
<mapper resource="xxxMapper.xml"/>
</mappers>
2.用包名引入映射器
<mappers>
<package name="com.x.x.xx"/>
</mappers>
3.用类注册引入映射器
<mappers>
<mapper class="com.x.x.xx.类名"/>
</mappers>
4.用userMapper.xml引入映射器
<mappers>
<mapper url="路径/xxxMapper.xml"/>
</mappers>
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
一般是由于mapper.xml和mapper.java的文件不匹配造成的。
在使用“包名引入映射器”时一定要注意xxxMapper.java和xxxMapper.xml命名完全相同,且均在所引入包下。若问题依旧存在,查看target文件夹中是否存在xxxMapper.xml,若不存在则复制进去即可。