hibernate 出现Caused by: java.sql.SQLException: Column 'id' not found.异常

Posted jpfss

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.异常的主要内容,如果未能解决你的问题,请参考以下文章

SpringDataJPA中出现的保存出现的Caused by: org.hibernate.PersistentObjectException: detached entity passed to

Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:20880 Caused by: ja

Caused by org hibernate DuplicateMappingException Duplicat

Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

Caused by: org.hibernate.property.access.spi.PropertyAccessBuildingException: Could not locate gette

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when