`
pavel
  • 浏览: 916715 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

hibernate错误

阅读更多

错误1.

Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/workspace/MLDN2/WebRoot/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
把hibernate里的ehcache.xml拷贝到src目录下,hibernate3用到了ehcache

 

错误2.

在使用hql进行操作的时候,表名要和类名一致,否则会出现table is not mapping的错误

错误3.

database product name cannot be null 是因为在得到config的时候没有在后面加.config()造成的
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update   因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示数据库名称)这样的属性,将该属性删除就可以了
使用hql语句的时候,在select n.content from Newsvo  n where n.id=?的问号的位置是从0开始记数的.

错误4.

在使用Hibernate中,is not mapped 是hql语句中的表名首字母要大写
No value specified for parameter错误的原因少了pstmt.setInt(1, id);

错误5.

用hibernate自动生成的save方法,进行保存的时候,报了org.hibernate.exception.SQLGrammarException: could not insert table: 发现是因为表中创建了与关键字相同的字段group,修改之后就可以进行插入操作

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics