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

    修改前

    修改后

  • 相关阅读:
    mysql优化
    c语言学习的第10天
    学习c语言的第9天
    学习c的第8天
    学习c的第7天
    学习c的第6天2
    c语言学习的第6天
    sed命令实战
    grep命令实战
    c语言学习的第五天
  • 原文地址:https://www.cnblogs.com/liaohongbin/p/7508475.html
Copyright © 2011-2022 走看看