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”   或者修改下代码 手动转换

    修改前

    修改后

  • 相关阅读:
    解决Ubuntu下pycharm无法输入中文的问题
    爬取www.mmjpg.com网站图片,你懂得哦!
    批量查询ip地址归属地
    Opencv源码编译
    使用阿里云安装python模块
    Ansible运维自动化
    Mha-Atlas-MySQL高可用
    SVN
    Tomcat
    DHCP
  • 原文地址:https://www.cnblogs.com/liaohongbin/p/7508475.html
Copyright © 2011-2022 走看看