zoukankan      html  css  js  c++  java
  • org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题

    即在mybatis中dao接口与mapper配置文件在做映射绑定的时候出现问题。

    原因:接口与xml找不到,或者是找到了却匹配不到。有以下原因,需要逐条核查:

    1、接口名与Mybatis的映射文件名一定要不一样;

    2、XXXMapper.xml 文件 mapper 节点中 namespace 是否和 mapper 接口的所在包名一致;

    3、XXXMapper.xml文件 mapper 节点下 id 是否在接口中有对应方法;

    4、XXXMapper.xml文件 mapper 节点下所有 id,是否已全部包含了对应接口中的所有方法;

    5、接口中返回值类型是List<XXX>,而select元素没有正确配置 ResultMap 或者 resultType ; 

    6、XXXmapper.XML配置路径:

      如果在Resource下,则application.yml :mapper-locations: classpath:文件夹名/*.xml

      

     如果在java下其他位置,则application.yml:

    mapper-locations: classpath*:com/lsk/xxxxx/mapperXml/*.xml 
    注意 classpath后有“*”,并且包地址是“/”分割
    另外,还需要在pom.xml增加build节点:
    <build>
         <resources>
             <resource>
                <filtering>true</filtering>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
             </resource>
             <resource>
                <directory>${basedir}/src/main/java</directory>
                <excludes>
                   <exclude>**/*.xml</exclude>
                </excludes>
              </resource>
         </resources>
    </build>
    

      

  • 相关阅读:
    位图 与矢量图对比
    用ocam工具录视频及转换视频 ffmpeg
    教学设计-饭后百步走
    教学设计例--跟小猴子一起玩
    教学设计-妈妈跳舞
    教学设计--Scratch2.0入门介绍
    Scratch2.0在线注册用户并使用帮助
    下载Scratch2.0离线版并安装教程
    把Sratch作品转为swf文件
    跟小猴子开心玩
  • 原文地址:https://www.cnblogs.com/ericli-ericli/p/12200095.html
Copyright © 2011-2022 走看看