`

org.hibernate.PropertyValueException: not-null property references a null or tra

阅读更多
引用
org.hibernate.PropertyValueException: not-null property references a null or transient value:

org.hibernate.PropertyValueException: not-null property references a null or transient value: com.bjcx.project.entity.task.Equipmenttable.ProjPortfolioID
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate



解决办法:
字面意思:一个不允许为Null的属性引用了一个为Null的或者无效的值。

原因:在***.hbm.xml中的

<property name="ProjPortfolioID" column="ProjPortfolioID"
    type="big_decimal" not-null="true" length="10" />

中,not-null="true",这说明属性ProjPortfolioID 不允许为空,而在ActionForm中未给他赋值,则就为空,所以就会报错!
分享到:
评论

相关推荐

    解决SpringDataJPA报错:org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null w

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...

    Dart.Snmp.Dll Dart.Snmp.45.dll v4.9.4.9.0.1 Released: 2016-05-10 Fixed

    Then add/update references to Dart.Snmp.Dll in your project. No limits, no nagging messages. Enjoy. And if you like the product, then buy it. Support the software companies and developers!

    C#程序单词注释汇总

    - 表示数据库中的NULL值,在.NET框架中用于区分普通语言中的null。 18. **Profile**: - 配置文件。 - 通常包含特定于用户或应用程序的设置。 19. **Constraint**: - 约束。 - 数据库中用于确保数据完整性的...

    Hibernate映射导致的几个异常

    Not-null property references a null or transient value 当Hibernate尝试保存一个实体时,如果该实体中的某个被标记为`@NotNull`或在映射文件中定义为`not-null="true"`的属性值为null或者指向一个尚未持久化的...

    Hibernate,hibernate笔记

    在描述中提到的`org.hibernate.PropertyValueException: not-null property references a null or transient value`是Hibernate抛出的一个常见异常,表示尝试保存一个实体时,其某个非空属性为null或未持久化。...

    10_传智播客JPA详解_JPA中的一对多双向关联与级联操作

    在Java世界中,Java Persistence API(JPA)是Oracle公司推出的用于对象关系映射(ORM)的标准框架,它简化了数据库操作,使开发者能够用Java对象来操作数据库记录。本教程将深入探讨JPA中的一对多双向关联及级联...

    JPA 开发中遇到的错误

    org.hibernate.PropertyValueException: not-null property references a null or transient value 当你尝试保存一个实体时,如果该实体中某个被标记为`@NotNull`或`@Column(nullable = false)`的属性值为null,则...

    JLink_Windows_V648.zip

    Version V6.48 (2019-07-26) Added flash programming support for AmbiqMicro's AMA2B1KK ...Firmware: J-Link EDU Mini: RISC-V: On implementations that do not populate a "program buffer" CSRs could not ...

    10.1038_d41586-022-00985-9-references.ris (1)

    10.1038_d41586-022-00985-9-references.ris (1)

    10.1007_s11704-022-1389-x-references (2).ris

    10.1007_s11704-022-1389-x-references (2).ris

    编译好的x265,带y4m文件

    --level-idc |float&gt; Force a minumum required decoder level (as '5.0' or '50') --[no-]high-tier If a decoder level is specified, this modifier selects High tier of that level Threading, performance:...

    DB2数据库错误代码

    - **说明**:表示尝试为允许NULL的列设置NOT NULL约束。 45. **+65001538** - **SQLSTATE**: 538 - **说明**:表示索引的锁状态被非法更改。 46. **+65301551** - **SQLSTATE**: 551 - **说明**:表示指定...

    hibernate annotations

    **标题:“Hibernate Annotations”** **概述** Hibernate是一个流行的Java对象关系映射(ORM)框架,它简化了在Java应用程序中处理数据库的过程。Hibernate Annotations是Hibernate框架的一个重要组成部分,它...

    Lewis, J. M., & Looney, J. G. (1988). The long struggle: Well-functioning workingclass Black families. New York: Brunner/Mazel, 193 pp., no price listed

    REFERENCES GOUGH, H., (1975). Manual for the California Psychological Inventory. Palo Alto, CA: Consulting GOUGH, H. (1987). Administrator’s guidefor the California Psychological Inventory. Palo ...

    hibernate常见错误解决方案

    **PropertyValueException: not-null property references a null or transient value** **异常描述:** 此异常表明一个标记为不可为空的属性引用了一个null或瞬态值。 **解决方法:** - 确认所有标有`not-null`...

    Johnson转换系统,非高斯转换高斯,高斯转换非高斯

    % -----References:----- % Hill, I. D. 1976. Algorithm AS 100: Normal-Johnson and Johnson-Normal % Transformations. Journal of the Royal Statistical Society. Series C (Applied % Statistics) 25(2): 190-...

    db2 错误码 大全

    - **描述**: 在尝试向不允许NULL值的列插入NULL值时出现问题。 ##### 45. 锁定失败 - **SQLCODE**: +65001 - **SQLSTATE**: 538 - **描述**: 尝试锁定某行数据时失败。 ##### 46. 缓冲池问题 - **SQLCODE**: +...

    Senfore_DragDrop_v4.1

    E.g.: if (DragDetectPlus(THandle(MyControl-&gt;Handle), Point(X, Y))) { ... } * Virtual File Stream formats can only be pasted from the clipboard with live data (i.e. FlushClipboard/...

    Machine Learning: Step-by-Step Guide To Implement Algorithms with Python

    Benefits of reading this book that you’re not going to find anywhere else: Introduction to Machine Learning Classification How to train a Model Different Models Combinations CHAPTER1 INTRODUCTION TO ...

    cmake-3.18.4-Linux-x86_64.tar.gz

    CMake is a cross-platform, open-source build system generator. For full documentation visit the CMake Home Page and the CMake Documentation Page. The CMake Community Wiki also references useful guides...

Global site tag (gtag.js) - Google Analytics