I have:
Document ManyToOne Template
When I click save Template see error, I try add @JsonIgnore
then OK but this entity not show in UI
Document.Java
@ManyToOne(cascade = CascadeType.MERGE)
//cascade = CascadeType.PERSIST or cascade = CascadeType.ALL not success
@JoinColumn(name = "template_id")
private Template template;
Error
{"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"}