我有:
记录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"}