Invalid bound statement (not found)出现原因和解决方法(invalid bound starement not found)

  本篇文章为你整理了Invalid bound statement (not found)出现原因和解决方法(invalid bound starement not found)的详细内容,包含有invalid boundary invalid bound starement not found invalidate bound statement invalid boundary什么意思 Invalid bound statement (not found)出现原因和解决方法,希望能帮助你了解 Invalid bound statement (not found)出现原因和解决方法。

  想必各位小伙伴在码路上经常会碰到奇奇怪怪的事情,比如出现Invalid bound statement (not found),那今天我就来分析以下出现此问题的原因。

  其实出现这个问题实质就是mapper接口和mapper.xml文件没有映射起来。

  常见的错误如下:

  1.mapper.xml中的namespace和实际的mapper文件不一致

  这个问题其实很好解决,瞪大眼睛,仔仔细细看看,到底对不对应不就好了嘛

  2.mapper接口中的方法名和mapper.xml中的id标签不一致

  这个问题和上个问题解决方法一样,仔细对对嘛,这个再对不出来,面壁思过吧。

  3.上两步的问题都没有,但是还是不行,可能原因就是,没有构建进去,打开target看看对应的mapper.xml文件在不在

  4.pom.xml文件中配置resource,不然mapper.xml文件就会被漏掉!pom.xml的中配置了resource,bug消失了~

  

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

 

   resources

   resource

   directory src/main/java /directory

   includes

   include **/*.properties /include

   include **/*.xml /include

   /includes

   filtering false /filtering

   /resource

   resource

   directory src/main/resources /directory

   includes

   include **/*.properties /include

   include **/*.xml /include

   /includes

   filtering false /filtering

   /resource

   /resources

  

 

  以上就是Invalid bound statement (not found)出现原因和解决方法(invalid bound starement not found)的详细内容,想要了解更多 Invalid bound statement (not found)出现原因和解决方法的内容,请持续关注盛行IT软件开发工作室。

郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。

留言与评论(共有 条评论)
   
验证码: