zoukankan      html  css  js  c++  java
  • Attempting to save one or more entities that have a non-nullable association with an unsaved transient entity.解决

    WARN org.hibernate.action.internal.UnresolvedEntityInsertActions[162] - HHH000437: Attempting to save one or more entities that have a non-nullable association with an unsaved transient entity. The unsaved transient entity must be saved in an operation prior to saving these dependent entities.
    Unsaved transient entity: ([com.zfounder.platform.core.model.Member#<null>])
    Dependent entities: ([[com.zfounder.ufx.model.MemberAccount#<null>]])
    Non-nullable association(s): ([com.zfounder.ufx.model.MemberAccount.member])
    2017-09-12 09:01:47.961 [http-bio-XXX-exec-2] ERROR COMMON-ERROR[28] - ""
    org.springframework.dao.InvalidDataAccessApiUsageException: Not-null property references a transient value - transient instance must be saved before current operation : com.XX.ufx.model.xx.XXX-> com.zfounder.platform.core.model.Member; nested exception is org.hibernate.TransientPropertyValueException: Not-null property references a transient value

    解决方式:

    先保存不为能为空的字段的表,在保存有关表,根本原因是前端传参问题   Date类型     要传成  “2018-01-01 22:22:22”   而不是  “2018-01-01”   或者修改下代码 手动转换

    修改前

    修改后

  • 相关阅读:
    [转]虚拟机下Redhat Linux系统的Mplayer安装实现
    结构定义中元素位置排列问题
    RPM 的介绍和应用
    yum 升级 rhe15
    Microsoft Access Data Types
    Eclipse配置SVN
    搭建本地YUM软件仓库
    2011年度最佳开源软件:Bossie奖结果公布
    Linux中文man在线手册
    PID算法
  • 原文地址:https://www.cnblogs.com/liaohongbin/p/7508475.html
Copyright © 2011-2022 走看看