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

    修改前

    修改后

  • 相关阅读:
    ibatis 循环迭代
    javascript 中Table、TableCell 、TableRow对象
    Java重载Java构造器
    java垃圾回收机制
    Java在J2EE工程中路径寻址问题终极解决方案
    JAVASCRIPT 验证计算中英文混合字符串长度的解决
    java基础学习及总结
    ORACLE nvarchar2和varchar2的区别
    StringBuffer的用法
    关于Ant下的路径查找
  • 原文地址:https://www.cnblogs.com/liaohongbin/p/7508475.html
Copyright © 2011-2022 走看看