用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.异常的更多相关文章

  1. 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 ...

  2. 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 ...

  3. resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.

    resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...

  4. 启动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 ...

  5. 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. ...

  6. 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 ...

  7. Spring data jpa hibernate:查询异常java.sql.SQLException: Column '列名' not found

    使用spring boot,jap,hibernate不小心的错误: java.sql.SQLException: Column '列名' not found: 这句话的意思是:找不到此列 为什么会出 ...

  8. sql查询报java.sql.SQLException: Column 'LC_ID' not found 的错误实际上是mysql在hibernate别名的问题

    报java.sql.SQLException: Column 'LC_ID' not found 的错误实际上是mysql在hibernate别名的问题 我的查询sql是 String sql2 =& ...

  9. ibatis 更改resultmap后 java.sql.SQLException: Column 'del_status' not found.

    当在resultmap中增加字段后,查询语句也必须增加相应字段,否则会报错, java.sql.SQLException: Column 'del_status' not found. 因为查询结果与 ...

随机推荐

  1. mac linux 创建文件 Permission denied

    解决方法: $ sudo chmod -R 777  目录其中-R 是指级联应用到目录里的所有子目录和文件777 是所有用户都拥有最高权限

  2. 对比Model前后数据保存不同值

    1.示例代码 public class SysLogBLL<T,W> : BLLBase where T : new() { #region 比较方法 /// <summary> ...

  3. 【html、CSS、javascript-4】新特征之增强表单

    一.input元素及属性 input元素的属性 type属性:指定输入内容的类型,默认为text:单行文本框 name属性:输入内容的识别名称,传递参数时候的参数名称 value属性:默认值 maxl ...

  4. LUOGU P3708 koishi的数学题

    传送门 解题思路 发现当x+1时,有的x%i会+1,有的会变成0,而变成0的说明是x的约数,就可以nlogn预处理出每个约数的贡献,然后每次用n-约数. 代码 #include<iostream ...

  5. git与github建立链接(学习笔记)

    总结步骤: 1.将所有文件添加到本库 git add . 2. git commit -m "提示信息随便写" 3.查看git修改状态 git status 4.获取远程库与本地同 ...

  6. C#5.0 异步编程async/await用法

    微软在发布VS2012的同时推出了C#5.0,其中包含了async和await 代码如下: class Program { private static readonly Stopwatch watc ...

  7. Thinkphp5.0 模型hasOne、hasMany、belongsTo详解

    ThinkPHP5有关联模型的操作,但有部分初学者对数据表中常见的几种表与表的关系还存在着问题,所以使用不好关联查询. 这里将hasOne.hasMany.belongsTo进行一个详细举例说明. 首 ...

  8. 使用mybatis的延迟加载

    在某些情况下我们需要使用延迟加载技术来提高我们程序查询的性能,通过减少与数据库的连接操作,做到按需加载,这样达到提高程序性能的目的. 首先需要在全局配置文件(SqlMapConfig.xml)中配置全 ...

  9. 【JZOJ4711】【NOIP2016提高A组模拟8.17】Binary

    题目描述 输入 输出 样例输入 6 6 8 9 1 13 9 3 1 4 5 2 6 9 1 3 7 2 7 7 1 6 1 2 11 13 样例输出 45 19 21 数据范围 解法 40%暴力即可 ...

  10. 注解2 --- 自定义 Annotation --- 技术搬运工(尚硅谷)

    定义新的 Annotation 类型使用 @interface 关键字 自定义注解自动继承了java.lang.annotation.Annotation接口 Annotation 的成员变量在 An ...