hibernate 出现Caused by: java.sql.SQLException: Column 'id' not found.异常
用hibernate进行映射查询时,出现Caused by: java.sql.SQLException: Column ‘id’ not found 异常,检查数据库表及映射都有id且已经正确映射,google后发现原因为:
Your query doesn’t return a field named id即查询sql中没有查询出主键id列,但返回结果集中用到,故出现异常特此记录。
详细解答见下:
http://stackoverflow.com/questions/34164411/caused-by-java-sql-sqlexception-column-id-not-found
原文地址:https://blog.csdn.net/motrsky/article/details/52369614
hibernate 出现Caused by: java.sql.SQLException: Column 'id' not found.异常的更多相关文章
- Hibernate报错:Caused by: java.sql.SQLException: Field 'ID' doesn't have a default value
问题一: 报错如下: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assig ...
- Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
1.错误描述 org.hibernate.exception.GenericJDBCException: error executing work at org.hibernate.exception ...
- resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.
resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...
- 启动Spring boot报错:nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
先看具体日志: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with n ...
- Caused by: java.sql.SQLException: Incorrect integer value: '' for column 'clientId' at row 41
1.错误描述 [ERROR:]2015-06-10 13:48:26,253 [异常拦截] oa.exception.ExceptionHandler org.hibernate.exception. ...
- Caused by: java.sql.SQLException: Operand should contain 1 column(s)
1.错误描述 [ERROR:]2015-05-05 15:48:55,847 [异常拦截] org.hibernate.exception.DataException: error executing ...
- 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 =& ...
- ibatis 更改resultmap后 java.sql.SQLException: Column 'del_status' not found.
当在resultmap中增加字段后,查询语句也必须增加相应字段,否则会报错, java.sql.SQLException: Column 'del_status' not found. 因为查询结果与 ...
随机推荐
- 09安装运行redis-trib.rb所需的环境
运行redis-trib.rb脚本配置Redis的cluster,需要安装ruby环境,这里采用源码安装: 1:下载源码包: https://cache.ruby-lang.org/pub/ruby/ ...
- leetcode 57 Insert Interval & leetcode 1046 Last Stone Weight & leetcode 1047 Remove All Adjacent Duplicates in String & leetcode 56 Merge Interval
lc57 Insert Interval 仔细分析题目,发现我们只需要处理那些与插入interval重叠的interval即可,换句话说,那些end早于插入start以及start晚于插入end的in ...
- node.js install and cecium apply
ubuntu 18.04 install node.js https://blog.csdn.net/m0_43404744/article/details/94364508
- PHP搜索优化 sphinx 实战
环境:win7 64 wamp 解压sphinx安装包后,简历如下结构.注意,conf目录是我的配置文件目录 在conf目录下,简历newdefend.conf文件,配置内容如下 # 配置数据源 so ...
- 20190719-FirstZero
这也许也是一个成就吧? First Zero 考试 第一次 爆0 好了好了. T1 你永远不知道你在想什么. 我仿佛想出一个$\Theta(NM\log^2 N)$的$dfs$??? 蒟蒻原地爆炸 T ...
- Spring松耦合示例(转)& IOC
Spring松耦合示例 轻松学习Spring<一> IoC容器和Dependency Injection模式 最近公司需要,项目中要用到Spring和Ibatis.趁着过年好好学习学习.I ...
- session失效刷新后登录页面嵌入在iframe中的解决办法
在login页面中添加以下一段代码: var _topWin = window; while (_topWin != _topWin.parent.window) { _topWin ...
- Lua 调用C模块DLL失败
Lua中使用 local a = require "xxx" 的方式加载自己用C实现的DLL,DLL中有导出函数 luaopen_xxx . 调试过程中发现,luaopen_xxx ...
- 第八章—BOM(一)
ECMAscript是JS的核心,而要在web上使用JS,那么BOM无疑是真正的核心.BOM叫浏览器对象模型,它提供了许多对象,用于访问浏览器的功能. BOM的核心对象是window,它表示浏览器的一 ...
- Hibernate的映射机制是怎样?
Hibernate的映射机制对象关系映射(Object Relation Mapping(ORM))是一种为了解决面向对象与面向关系数据库互不匹配现象的技术,简而言之ORM是通过使用描述对象之间映射的 ...