嵌套异常是java.lang.IllegalStateException:org.hibernate.TransientPropertyValueException

时间:2017-03-29 04:09:18

标签: java spring hibernate jpa jhipster

我有:

记录ManyToOne模板

当我点击保存模板时看到错误,我尝试添加@JsonIgnore然后确定,但此实体未在UI中显示

Document.Java

@ManyToOne(cascade = CascadeType.MERGE)
//cascade = CascadeType.PERSIST or cascade = CascadeType.ALL not success
@JoinColumn(name = "template_id")
private Template template;

错误

{"timestamp":"2017-03-29T04:03:30.553+0000","status":500,"error":"Internal Server Error","exception":"org.springframework.dao.InvalidDataAccessApiUsageException","message":"org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.paragonsystem.capture.domain.Document.template -> com.paragonsystem.capture.domain.Template; nested exception is java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.paragonsystem.capture.domain.Document.template -> com.paragonsystem.capture.domain.Template","path":"/api/documents"}

0 个答案:

没有答案