ibatis 更改resultmap后 java.sql.SQLException: Column 'del_status' not found.
当在resultmap中增加字段后,查询语句也必须增加相应字段,否则会报错,
java.sql.SQLException: Column 'del_status' not found.
因为查询结果与resultmap对应不上,ibatis在查询获得结果集中找不到resultmap的对应字段,
我是在resultmap中增加字段,但select语句中并没有增加,折腾了半天
如果属性类型为基本类型而非包装类型,并且数据库中数据为null,那么就会报错
Caused by: java.lang.RuntimeException:
Error setting property 'setTagId' of 'com.ginkgocap.ywxt.knowledge.model.KnowledgeColumn@16c1227'.
Cause: java.lang.IllegalArgumentException
这种情况很容易发生,比如在表中增加一个数字类型字段,对应的java属性是基本类型,就会出现
因此建议使用包装类型,遇到null类型数据就不会报错,否则数据库中就必须有值,即不为空,我看公司设计的其它数字字段都不能为空。
ibatis 更改resultmap后 java.sql.SQLException: Column 'del_status' not found.的更多相关文章
- [Mybatis - 1A] - Cause: java.sql.SQLException: Column count doesn't match value count at row 1
严重: Servlet.service() for servlet [springMVC] in context with path [/ExceptionManageSystem] threw ex ...
- hibernate 出现Caused by: java.sql.SQLException: Column 'id' not found.异常
用hibernate进行映射查询时,出现Caused by: java.sql.SQLException: Column 'id' not found 异常,检查数据库表及映射都有id且已经正确映射, ...
- resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.
resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...
- java.sql.SQLException:Column count doesn't match value count at row 1
1.错误描述 java.sql.SQLException:Column count doesn't match value count at row 1 2.错误原因 在插入数据时,插入的字段 ...
- java.sql.SQLException:Column Index out of range,0<1
1.错误描述 java.sql.SQLException:Column Index out of range,0<1 2.错误原因 try { Class.forName("com.m ...
- java.sql.SQLException: Column count doesn't match value count at row 1 Query: insert into category values(null,?,?,?) Parameters: [1111111, 1111, 软件]
java.sql.SQLException 问题: java.sql.SQLException: Column count doesn't match value count at row 1 Que ...
- java.sql.SQLException:Column count doesn't match value count at row 1
1.错误描写叙述 java.sql.SQLException:Column count doesn't match value count at row 1 2.错误原因 在插入数据时,插入的 ...
- Spring data jpa hibernate:查询异常java.sql.SQLException: Column '列名' not found
使用spring boot,jap,hibernate不小心的错误: java.sql.SQLException: Column '列名' not found: 这句话的意思是:找不到此列 为什么会出 ...
- sql查询报java.sql.SQLException: Column 'LC_ID' not found 的错误实际上是mysql在hibernate别名的问题
报java.sql.SQLException: Column 'LC_ID' not found 的错误实际上是mysql在hibernate别名的问题 我的查询sql是 String sql2 =& ...
随机推荐
- iOS 的 APP 在系统中如何适配不同的屏幕的尺寸
iOS 的 APP 在系统中如何适配不同的屏幕的尺寸 标签: 2007年,初代iPhone发布,屏幕的宽高是 320 x 480 像素.下文也是按照宽度,高度的顺序排列.这个分辨率一直到iPhone ...
- 关于开源中文搜索引擎架构coreseek中算法详解
Coreseek 是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和信息处理领域,适用于行业/垂直搜索.论坛/站内搜索.数据库搜索.文档/文献 ...
- 【VC编程技巧】文件☞2.3CArchive的用法
CArchive 对象提供了一个类型安全缓冲机制CArchive 对象提供了一个类型安全缓冲机制.用于将可序列化对象写入CFile 对象或从中读取可序列化对象.通常,CFile 对象表示磁盘文件:但是 ...
- SQL Server 通过一个表和另一个表联合 批量更新这个表的字段
UPDATE OutPzPersonSet SET cPerson = a.AAA --SELECT * FROM OutPzPersonSet d INNER JOIN AAAA a ON d.cz ...
- VS2013中C++创建DLL导出class类
1.创建"Win32 Console Application"项目,命名为"ClassDllLib",并在"Application type" ...
- 使用python/casperjs编写终极爬虫-客户端App的抓取-ZOL技术频道
使用python/casperjs编写终极爬虫-客户端App的抓取-ZOL技术频道 使用python/casperjs编写终极爬虫-客户端App的抓取
- JAVA判断上传表单中file是否为空
<form action="update.do"method="post" enctype="multipart/form-data" ...
- poj 2976 Dropping tests (二分搜索之最大化平均值之01分数规划)
Description In a certain course, you take n tests. If you get ai out of bi questions correct on test ...
- iOS UILabel UITextView UIButton 等等显示文本行间距
iOS UILabel UITextView UIButton 等等显示文本行间距都用如下方法 NSMutableParagraphStyle *paragraphStyle = [[NSMutab ...
- HDU 2025 查找最大元素
查找最大元素 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submis ...