读书人

SSH整合项目中容易出现的异常集整理

发布时间: 2012-12-24 10:43:13 作者: rapoo

SSH整合项目中容易出现的错误集整理

1.
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
原因:元素配置不正确,元素缺少其子元素的配置。解决方法:元素映射了相应数据库表的主键字段,对其子元素,其中class的取值可以为increment、identity、sequence、hilo、native......等,一般取其值为native 。
2.
java.lang.IllegalArgumentException: id to load is required for loading
方案:Users user=(Users)this.getHibernateTemplate().get(Users.class, id)

读书人网 >编程

热点推荐