java~springboot~ibatis Invalid bound statement (not found)原因
事实起因
最近在ORM上使用了ibatis,感觉挺繁琐的,没有jpa来的直接,但项目非要用也没有办法,最近在进行开发过程中出现了一个问题Invalid bound statement (not found)意思是说,你的xml映射和你的mapper方法不一致,这种不一致大叔总结几点,如果你出现了这种问题可以按着下面几后进行排查。
可能出现的原因
- xml输入参数类型不匹配,你可以改成
parameterType="map"试试 - xml返回参数类型问题,resultType="你的类型",不要写成resultMap="你的类型"
- 返回的DTO与返回结果集名称不匹配,这时你要对照类型的属性,去为sql设置别名
- 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)原因的更多相关文章
- springboot项目Invalid bound statement (not found): com.xxxx.dao.xxxDAO.xxx解决方法
1.首先判断自己的Dao和mapper的对应关系,注意要一一对应的. 2.配置信息出现问题,注意配置信息填写: 3.记住要细心细心,细心,重要的事情说三遍.
- 访问mapper方法提示invalid bound statement (not found)原因总结
1.访问所有的mapper都报此错误,检查 mapper.xml 中的 namespace 2.访问mapper中的部分方法时报此错误,检查xml文件中的id是否和接口中的方法名一致 3.mapper ...
- 完美解决: org.apache.ibatis.binding.BindingException Invalid bound statement (not found)
异常描述: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 原因: springboot ...
- 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 ...
- maven项目:Invalid bound statement
在使用maven做mybatis项目时会遇到这个问题, org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...
- 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 ...
- 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 ...
- 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 ...
- 【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) 需要检查的步骤: ...
随机推荐
- DOM常见操作
一.查找 1.直接查找 document.getElementById 根据ID获取一个标签 document.getElementsByName 根据name属性 ...
- 用java代码将从数据库中取出的具有父子关系的数据转成json格式
思路:①.取出数据中的所有父节点放入一个集合中②.取出数据中所有为该父节点的子节点放入另一个集合中③.用到迭代的方法将子节点一层一层的遍历工具类:package com.assasion.test;i ...
- syncer.go
package ) ) ) ].Key,)) )) }
- 在C++遇到有些关键字或者函数被弃用的情况
随着每一次C++的不断更新,可能都会有些函数或者关键字会被弃用,或者换成了其他的名字,这在编写代码的时候经常会碰到,碰到这种情况,可以在代码的第一行写上忽略此错误的句子,一般为: #pragma w ...
- 【贪心+背包】BZOJ1334 [Baltic2008]Elect
Description 从N个数中选出任意个数且和尽量大,但要满足去掉任意一个和就小于总和的一半.n<=300, ai<=1e5. Solution 这个条件其实就是 去掉选出的最小的一个 ...
- CISP-PTE注册信息安全专业人员渗透测试工程师知识体系大纲
CISP-PTE注册信息安全专业人员渗透测试工程师知识体系大纲 都是图.. 不足之处,欢迎补充
- java happens-before原则规则
程序次序规则:一个线程内,按照代码顺序,书写在前面的操作先行发生于书写在后面的操作: 锁定规则:一个unLock操作先行发生于后面对同一个锁额lock操作: volatile变量规则:对一个变量的写操 ...
- openoffice转换pdf 异常问题查找处理 errorCode 525
could not save output document; OOo errorCode: 525 该问题是由于java程序和openoffice的启动所属用户不同导致.使用以下命令查看端口和进程 ...
- h5仿微信聊天(高仿版)、微信聊天表情|对话框|编辑器
之前做过一版h5微信聊天移动端,这段时间闲来无事就整理了下之前项目,又重新在原先的那版基础上升级了下,如是就有了现在的h5仿微信聊天高仿版,新增了微聊.通讯录.探索.我四个模块 左右触摸滑屏切换,聊天 ...
- String去重方法
思路:利用集合的contains方法将某个字符串中的集合中没有的单个字符添加到集合中,然后再将集合中每个元素做拼接 @Test public void aa5(){ String aa="a ...