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:
Post a Comment