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

修改前

 

修改后

posted @ 2017-09-12 09:34  Kapa  阅读(1721)  评论(0编辑  收藏  举报