【问题标题】:i am getting Hibernate error我收到休眠错误
【发布时间】:2014-12-23 16:39:34
【问题描述】:

为什么会出现这个错误

Exception in thread "Thread-2" org.hibernate.exception.SQLGrammarException: could not execute query
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.loader.Loader.doList(Loader.java:2214)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
    at org.hibernate.loader.Loader.list(Loader.java:2090)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    at daoimplclasses.site_configdaoimpl.listPendingSiteConfig(site_configdaoimpl.java:41)
    at service.Config.run(Config.java:119)
Caused by: java.sql.SQLException: Unknown column 'this_.temperEnabled' in 'field list'
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3026)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1137)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1231)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1778)
    at org.hibernate.loader.Loader.doQuery(Loader.java:662)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
    at org.hibernate.loader.Loader.doList(Loader.java:2211)
    ... 7 more

【问题讨论】:

  • 您的查询有误。你能发布查询吗?
  • 看到这个:) 原因:java.sql.SQLException: com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975) 的“字段列表”中的未知列“this_.temperEnabled”在
  • 因为在at daoimplclasses.site_configdaoimpl.listPendingSiteConfig(site_configdaoimpl.java:41)-stackoverflow.com/questions/3988788/…执行查询时出现问题
  • 看看这个和你的other question,你误解了你可以在 Stack Overflow 上问什么(以及如何问)。您可能需要tour 或查看help centre
  • 只需阅读堆栈跟踪手册

标签: java hibernate nio


【解决方案1】:

Hibernate 生成的查询在您的数据库表中找不到列 temperEnabled

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-14
    • 2017-03-21
    • 2012-04-19
    • 2014-03-25
    • 2011-12-03
    • 2011-07-26
    • 2016-11-19
    相关资源
    最近更新 更多