1、出现如下问题:

 Invalid bound statement(not found):cn.e3mall.mapper.TbItemMapper.selectByExample.....

说明mapper接口和mapper.xml映射文件没有在一个文件夹下面

2、解决方法:

dao层的pom.xml中配置一下:

<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->

<project>
<build>

    <resources>

           <resource>

               <directory>src/main/java</directory>

               <includes>

                   <include>**/*.properties</include>

                   <include>**/*.xml</include>

               </includes>

               <filtering>false</filtering>

           </resource>

       </resources>

</build>
</project>

 

相关文章:

  • 2022-01-19
  • 2021-05-14
  • 2021-12-30
猜你喜欢
  • 2021-10-20
  • 2021-07-31
  • 2022-01-02
  • 2021-05-26
  • 2021-05-02
相关资源
相似解决方案