首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

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

2012-12-24 
SSH整合项目中容易出现的错误集整理1. org.hibernate.id.IdentifierGenerationException: ids for this cl

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)

热点排行