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. 因为查询结果与 ...
随机推荐
- JDK8日期时间操作小汇总
统一使用java.time.*包下的类 1.获取当前的日期.时间.日期加时间 LocalDate todayDate = LocalDate.now(); //今天的日期 LocalTime now ...
- 如约而至(walk)
LCA大佬的做法: 考虑暴力的高斯消元,我们优化它. $\sum\limits_{j} gcd(i,j)^{c-d} i^d j^d x_j=b_i$ $\sum\limits_{j} gcd(i,j ...
- H5C3--文本阴影text-shadow
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- mybatis深入理解(三)-----MyBatis事务管理机制
MyBatis作为Java语言的数据库框架,对数据库的事务管理是其非常重要的一个方面.本文将讲述MyBatis的事务管理的实现机制.首先介绍MyBatis的事务Transaction的接口设计以及其不 ...
- python自动化---各类发送邮件方法及其可能的错误
一.发送文本邮件 可能的问题1.:需要注意,目前QQ邮箱来讲,不能收到完整的邮件,即有些内容不能显示,最好全部使用网易邮箱: 可能的问题2.:在以往的文本邮件发送中,只写了 msg = MIMETex ...
- eclipse svn提交忽略文件及文件夹,ignore设置无效..
如果之前提交过此文件,就不能设置忽略该文件了.所以第一次提交的时候要搞清楚再提交. [亲测,的确如此,用 Windows -> Preferences -> Team -> Igno ...
- 2019-9-2-windows-10「设置」应用完整ms-settings快捷方式汇总
title author date CreateTime categories windows-10「设置」应用完整ms-settings快捷方式汇总 lindexi 2019-09-02 12:57 ...
- Google earth爬取卫星影像数据并进行标注路网的方法
一.下载goole earth 和GetScreen: 试了很多,找了可以使用的上传到百度网盘,链接如下所示: 链接:https://pan.baidu.com/s/1fp-W8u68iRsJ0xcu ...
- web前端学习(三)css学习笔记部分(4)-- CSS选择器详解
4. 元素选择器详解 4.1 元素选择器 4.2 选择器分组 用英文逗号","相连,使用相同的样式表 使用通配符对所有元素进行通用设定. 4.3 类选择器详解 4.3.1. ...
- Hdu 4920矩阵乘法(内存访问的讲究)
题目链接 Matrix multiplication Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K ( ...