ids for this class must be manually assigned
来源:互联网 发布:卡乐xu3软件下载 编辑:程序博客网 时间:2024/06/05 00:02
异常信息:
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
异常原因:
<id>元素配置不正确,<id>元素缺少其子元素<generator></generator>的配置。
解决方法:
<id>元素映射了相应数据库表的主键字段,对其子元素<generator class="">,其中class的取值可以为increment、identity、sequence、hilo、native……等,更多的可参考hibernate参考文档,一般取其值为native 。
exp:
<hibernate-mapping>
<class name="com.fqf.Vipdata" table="vipdata" catalog="test">
<id name="vipId" type="Java.lang.Integer">
<column name="vipId" />
<generator class="assigned" />
</id>
<property name="vipName" type="java.lang.String">
<column name="vipName" length="20" not-null="true" />
</property>
<property name="vipTitle" type="java.lang.String">
<column name="vipTitle" length="20" not-null="true" />
</property>
</class>
</hibernate-mapping>
看看数据库表中的 id 是不是自增长类型,把<generator class="assigned" />中assigned改为increment
(vipId的类型为自增长)
- BUG:ids for this class must be manually assigned before....
- ids for this class must be manually assigned
- ids for this class must be manually assigned before calling save():***错误说明
- error:ids for this class must be manually assigned before calling save():
- error:ids for this class must be manually assigned before calling save()
- ids for this class must be manually assigned before calling save()
- error:ids for this class must be manually assigned before calling save():
- ids for this class must be manually assigned before calling save() hibernate
- 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():
- IdentifierGenerationException: ids for this class must be manually assigned before calling save()
- hibernate保存数据的时候出现:ids for this class must be manually assigned before 错误
- ids for this class must be manually assigned before calling save()..
- HibernateSystemException--ids for this class must be manually assigned before calling save()
- error:ids for this class must be manually assigned before calling save():
- 关于 error:ids for this class must be manually assigned before calling save(): 的解决方案
- ids for this class must be manually assigned before calling save():
- 工作札记--“ids for this class must be manually assigned before calling save”解决办法
- mysql学习笔记
- fl2440之initramfs文件系统制作与移植
- Spring AOP进行日志记录,管理
- Jupyter无法导入已安装的 module
- 2017最新手机版cps诱导支付源码
- ids for this class must be manually assigned
- 浏览者不需要在这个上面浪费时间,net一些问题解决方法--这是自己写的
- linux下 tar解压 gz解压 bz2等各种解压文件使用方法
- 谈一谈URL
- android ping 网络延迟
- ElementRef
- Uncaught TypeError: Cannot read property 'length' of undefined
- SPI的时钟极性CPOL和时钟相位CPHA的设置
- asp.net(c#)中String.Empty、NULL、"" 三者到底有啥区别和联系?