Thursday, 27 December 2018

org.springframework.dao.InvalidDataAccessApiUsageException:


org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.yardbud.entities.Order.lister -> com.yardbud.entities.Lister; nested exception is java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.yardbud.entities.Order.lister -> com.yardbud.entities.Lister

Data object A has one data object b; object A has one data object c. 
Adding the cascade type attribute into the one-to-one relationship solved the exception above.

@OneToOne(cascade = CascadeType.ALL)

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...