事实起因

最近在ORM上使用了ibatis,感觉挺繁琐的,没有jpa来的直接,但项目非要用也没有办法,最近在进行开发过程中出现了一个问题Invalid bound statement (not found)意思是说,你的xml映射和你的mapper方法不一致,这种不一致大叔总结几点,如果你出现了这种问题可以按着下面几后进行排查。

可能出现的原因

  1. xml输入参数类型不匹配,你可以改成parameterType="map"试试
  2. xml返回参数类型问题,resultType="你的类型",不要写成resultMap="你的类型"
  3. 返回的DTO与返回结果集名称不匹配,这时你要对照类型的属性,去为sql设置别名
  4. yml文件里对ibatis配置有问题

    如下面代码:
@Getter
@Setter
public class BusinessCustomerDTO {
private Long id;
private String customerName;
private String contactPerson;
private Integer freeDays;
private String city;
private String province;
private String source;
private LocalDateTime enterDays;
private String leadingPerson;
}

对应的mapper代码:

  <select id="getBusinessCustomers" parameterType="java.util.Map" resultType="cn.pilipa.customer.management.dto.BusinessCustomerDTO">
select a.id,
a.customer_name as customerName,
a.city_code as city,
a.province_code as province,
a.customer_source as source,
b.enter_storage_time as enterDays,
b.current_salesperson as leadingPerson,
c.contact_person as contactPerson from customer_base_info a
inner join customer_business_info b on a.id=b.customer_id
left join customer_contact_person c on c.customer_id=a.id
where c.is_main_contact=1
</select>

java~springboot~ibatis Invalid bound statement (not found)原因的更多相关文章

  1. springboot项目Invalid bound statement (not found): com.xxxx.dao.xxxDAO.xxx解决方法

    1.首先判断自己的Dao和mapper的对应关系,注意要一一对应的. 2.配置信息出现问题,注意配置信息填写: 3.记住要细心细心,细心,重要的事情说三遍.

  2. 访问mapper方法提示invalid bound statement (not found)原因总结

    1.访问所有的mapper都报此错误,检查 mapper.xml 中的 namespace 2.访问mapper中的部分方法时报此错误,检查xml文件中的id是否和接口中的方法名一致 3.mapper ...

  3. 完美解决: org.apache.ibatis.binding.BindingException Invalid bound statement (not found)

    异常描述: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 原因: springboot ...

  4. Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  5. maven项目:Invalid bound statement

    在使用maven做mybatis项目时会遇到这个问题, org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  6. Java报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sirifeng.babytun.dao.GoodsDAO.findById

    前言 最近学vue学得差不多了,想来搭个项目实战一下,结果刚开始搭建SSM框架的时候就来到了我们最喜欢的debug环节 org.apache.ibatis.binding.BindingExcepti ...

  7. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.bw.mapper.BillMapper.getBillList at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:225

    这个错误是没有找到映射文件 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.b ...

  8. java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.demoDao.getXXX;

    java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  9. 【mybatis】mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 或者 feign被调用方使用的mybatis总报空指针异常java.lang.NullPointerException,而变量都没有问题的情况

    mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 需要检查的步骤: ...

随机推荐

  1. segment.go

    package sego // 文本中的一个分词 type Segment struct {     // 分词在文本中的起始字节位置     start int     // 分词在文本中的结束字节 ...

  2. indexer_worker.go

    package) ) ) ) {             request.rankerReturnChannel <- rankerReturnRequest{}             con ...

  3. search_request.go

    package types type SearchRequest struct {     // 搜索的短语(必须是UTF-8格式),会被分词     // 当值为空字符串时关键词会从下面的Token ...

  4. OpenGL渲染管线(rendering pipeline)

    OpenGL中的渲染管线包括:顶点着色器(vertex shader).细分着色器(里面包含两种:细分控制着色器和细分控制着色器)(tessellation shader).几何着色器.光栅化及片元着 ...

  5. 【爆料】-《亚伯大学毕业证书》Aber一模一样原件

    ☞亚伯大学毕业证书[微/Q:865121257◆WeChat:CC6669834]UC毕业证书/联系人Alice[查看点击百度快照查看][留信网学历认证&博士&硕士&海归&am ...

  6. MySql-两阶段加锁协议

    此篇博客主要是讲述MySql(仅限innodb)的两阶段加锁(2PL)协议,而非两阶段提交(2PC)协议,区别如下: 2PL,两阶段加锁协议:主要用于单机事务中的一致性与隔离性. 2PC,两阶段提交协 ...

  7. windows 7安装Fiddler抓HTTPS请求的解决办法

    一.下载安装Fiddler,网上随意一搜就可找到安装软件 二.打开已经安装的fiddler,本人的安装目录:D:\AutoTest\fiddle\Fiddler2 三.打开的页面如图: 三.点击too ...

  8. 利用face_recognition库裁取人脸

    from PIL import Image import face_recognition # Load the jpg file into a numpy array image = face_re ...

  9. MongoDB 小记

    之前本人说过一款非关系型数据库的代表 Redis 的 < Redis 小记 >文章,觉得意犹未尽,今天就来介绍一款数据库 MongoDB ,先来看一下 MongoDB是一款基于分布式文件存 ...

  10. redis的bigkey扫描脚本

    众所周知,redis里面的大key存在是非常危险的一件事情.因为最近的工作转移到中间件相关的工作,因此关注了一下bigkey的扫描方法.首先介绍一下阿里云提供的扫描脚本: 具体可见:https://y ...