抛开mybatis bing 问题不谈,很有可能是IDEA mapper 报错:Invalid bound statement (not found)

target 路径下mapper.xml未编译。解决:在pom.xml添加

<resources>
            <!-- maven项目中src源代码下的xml等资源文件编译进classes文件夹,
              注意:如果没有这个,它会自动搜索resources下是否有mapper.xml文件,
              如果没有就会报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.pet.mapper.PetMapper.selectByPrimaryKey-->
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>

            <!--将resources目录下的配置文件编译进classes文件  -->
            <resource>
                <directory>src/main/resources</directory>
            </resource>

        </resources>

然后IDEA mapper 报错:Invalid bound statement (not found)搞定!

相关文章:

  • 2021-07-22
  • 2021-06-26
  • 2021-07-08
  • 2021-11-17
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-25
  • 2021-09-08
  • 2022-01-21
  • 2021-12-26
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案