`
Java_Fan
  • 浏览: 84965 次
  • 性别: Icon_minigender_1
  • 来自: 西安
文章分类
社区版块
存档分类
最新评论

HibernateSystemException--ids for this class must be manually assigned before calling save()

 
阅读更多

org.springframework.orm.hibernate3.HibernateSystemException:

ids for this class must be manually assigned before calling save():adam.bp.workflow.entity.TaResourceassign2;

nested exception is org.hibernate.id.IdentifierGenerationException:

ids for this class must be manually assigned before calling save(): adam.bp.workflow.entity.TaResourceassign2


异常的意思是:
adam.bp.workflow.entity.TaResourceassign2 类的id必须在调用save方法之前手工分配,而且这是一个内嵌的异常。

我在这个类对应的TaResourceassign2.hbm.xml中配置的id生成类型是class="assigned",即手工分配,这不存在任何错误--因为我确实是手工分配id的。

通过查证,错误原因有以下几点:
1.此类的id值为空(没有set该值 或 手工生成的值为null)
2.对应的id配置类型以及长度不正确
3.外键关联配置管理的多对一映射,传递的对象为null(导致手工set时为null)
分享到:
评论

相关推荐

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

    1. org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save() 这个错误是由于在Hibernate的mapping文件中,元素没有正确配置,缺少了其子元素的配置...

    ssh框架报错分析集合

    1. `org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()` 这个异常通常是因为Hibernate在尝试保存对象时,发现对象的ID没有被正确地设置或生成...

    hibernate常见问题及处理.doc

    4. `org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():` 此异常意味着在尝试保存对象前,对象的主键没有被正确设置。通常,这是由于在映射...

    工作周报10221

    - **Hibernate逆向工程**:解决`ids for this class must be manually assigned`错误,修改了自动生成的ID配置,添加了`dynamic-update`和`dynamic-insert`属性以优化数据库操作。 - **Spring与Hibernate集成**:...

    框架集合错误解决方案

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save() ``` **问题描述:** 当尝试保存一个实体对象时,如果该对象的`id`字段没有被手动赋值,...

    win 3.11 for workgroup tcpip支持

    RELEASE NOTES FOR MICROSOFT(R) TCP/IP-32 FOR WINDOWS(TM) FOR WORKGROUPS 3.11 PLEASE READ THIS ENTIRE DOCUMENT General ------- This product is compatible with, and supported exclusively on, the ...

    Diskeeper 2008 v12.0.759.0

    Note that Windows 2000 systems must be running Service Pack 3 or higher. The Windows versions supported vary by Diskeeper edition. See the Table of Supported Operating Systems later in this ...

    一个win32下的ARM开源编译器

    This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: ...

    acpi控制笔记本风扇转速

    ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work if it is byte-packed. Example Code and Data Size: These are the sizes for the OS- independent acpica.lib produced by ...

    EurekaLog_7.5.0.0_Enterprise

    This also reduces memory footprint for ecc32/emake 8)....Added: Showing call stacks for 2 new types of fatal memory errors 9)....Added: EMemLeaks._ReserveOutOfMemory to control reserve size of out of...

    Android代码-react-native-ble-manager

    npm i --save react-native-ble-manager After installing, you need to link the native library. You can either: Link native library with react-native link, or Link native library manually Both ...

    rubygems-master-(1).zip_GEM

    You must have an installation of RubyGems before this update can be applied. See Gem for information on RubyGems (or `ri Gem`) To upgrade to the latest RubyGems, run: $ gem update --system # you ...

    ICS delphixe10源码版

    The origin of this software must not be misrepresented, you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product ...

    QTP11补丁发布 - 支持64位IE浏览器

    1. Before installing this patch, you must install the QTP_00699 patch. 2. This patch does not provide 64-bit support for other Web-based environments, for example .NET WebForms, ActiveX, Siebel, ...

    macOS Unlocker 2.1 for VMware Workstation 11/12/14(VM14破解补丁)

    You will have to manually mount the darwin.iso for example on Workstation 11 and Player 7. The vmwarebase code does not need to be patched on macOS or ESXi so you will see a message on those systems ...

    EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8

    EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8 亲测可用,含全部源码及 Demo The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007...

    ak2新版内核AKAIO1.5

    ak2新版内核 AceKard All-In-One (AK-AIO) v1.5 ... - Third option in "which cheat file to download" box displays the setting window at plugin launch, can be used for future expansion + Uses gelu's...

    指纹仪linux开发包SDK,适用U.are.U4000/URU4000B

    You must have root privilege to install this product on the supported Linux operating systems. 1- Insert the Product CD in the CD-ROM drive. 2- Run Setup.sh located in the root folder on the CD. ...

    dwl-g122 b1 c1

    10. Add XP64 & Vista64 drivers for DWL-G122 (rev.C) 11. Add XP64 drivers for DWL-G122 (rev.B) ------------------------------------------------------------------------------------------- Setup Version:...

    MapReduce-based Assembly Clone Search for Reverse Engineering.pdf

    However, it is a manually intensive and time-consuming process even for experienced reverse engineers. An effective and efficient assembly code clone search engine can greatly reduce the effort of ...

Global site tag (gtag.js) - Google Analytics