zoukankan      html  css  js  c++  java
  • 使用mybatis出现异常

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xiaohe.mapper.EduCourseMapper.getPublishCourseInfo
    == 分析:maven项目在编译过程中,java目录下面的.java文件才会编译运行,详细看target目录,当xml写在mapper则不能实现sql功能==
    目录格式:

    解决方案

    1、在pom中添加

       <build>
            <resources>
                <resource>
                    <directory>src/main/java</directory>
                    <includes>
                        <include>**/*.xml</include>
                    </includes>
                    <filtering>false</filtering>
                </resource>
            </resources>
        </build>
    

    2、在application.yml中添加

    mybatis-plus:
      mapper-locations: classpath:com/xiaohe/mapper/xml/*.xml
    

    解决

  • 相关阅读:
    [HDU6793] Tokitsukaze and Colorful Tree
    [NOI2020]命运
    [NOI2020]美食家
    模拟9
    晚测2
    模拟8
    联考4
    模拟7
    模拟6
    关于数论
  • 原文地址:https://www.cnblogs.com/HezhenbinGoGo/p/14313743.html
Copyright © 2011-2022 走看看