org.hibernate.id.IdentifierGenerationException错误解决方法
来源:互联网 发布:百度免费域名 编辑:程序博客网 时间:2024/05/16 16:24
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
ID主键生成策略为assigned 由应用程序负责生成主键标识符
<id name="id" type="java.lang.String"> <column name="ID" length="32" /> <generator class="assigned" /></id>而在保存时没有设置ID
session.save(entity);
导致出现此错误
解决方法:
1、在保存时手动设置个ID即可:
entity.setId(UUID.randomUUID().toString());session.save(entity);
2、修改主键生成策略为其他
作者:itmyhome
0 0
- org.hibernate.id.IdentifierGenerationException错误解决方法
- org.hibernate.id.IdentifierGenerationException错误提示
- org.hibernate.id.IdentifierGenerationException错误解析
- org.hibernate.id.IdentifierGenerationException:
- org.hibernate.id.IdentifierGenerationException
- org.hibernate.id.IdentifierGenerationException
- org.hibernate.id.IdentifierGenerationException
- org.hibernate.id.IdentifierGenerationException异常
- org.hibernate.id.IdentifierGenerationException:我的第一个hibernate异常
- Exception in thread "main" org.hibernate.id.IdentifierGenerationException:
- org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property
- Hibernate报错:org.hibernate.id.IdentifierGenerationException:ids for this class must be manually assig
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
- 基于auto_ptr源码的智能指针实现
- 暑假NOIP笔记—数论
- hdu 1285 确定比赛名次 (拓扑排序)
- 运算符 &、∧、| 的使用;
- 火狐浏览器扩展的一些小瑕疵
- org.hibernate.id.IdentifierGenerationException错误解决方法
- ViewPager+Fragment基础
- iOS开发 ----- vim配色
- 数据采集系统开发流程-1
- 关机重启命令
- 【动态规划】【状态压缩DP】[UVa 1354]Mobile Computing
- 1028. List Sorting
- sgu158
- POJ3979