报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample

报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample
报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample

我的项目是用idea写的。错误提示没有扫到resources下的mapper.xml文件。

项目代码没问题,后来发现问题出在“包名”上。报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample
在创建resources下包的时候,由于idea是创建Directory,
报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample
以我为例:

这样创包则会创一个名为“com.mapper.service”的包,而不是com包下还有一个“mapper”的包。

对比如下:

报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample

报错:Invalid bound statement (not found): com.pinyougou.mapper.TbBrandMapper.selectByExample

应在resources下先创“com”包,再创“mapper”包,接着是“mapper”包以及包下的各种“XXMapper.xml”。

这样就完美解决了!!!

上一篇:12.从Thread引入Task


下一篇:解决 Invalid bound statement: com.luwebsite.online.modules.business.service.ArtcleCousemer.getById问题