org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance – save the transient instance before flushing.

org.springframework.dao.InvalidDataAccessApiUsageException org.hibernate.TransientPropertyValueException object references an unsaved transient instance - save the transient instance before flushi

To fix this issue do the below changes in entity class

Add cascade type into entity mapping

1. Add cascade setting to ALL
(cascade=CascadeType.ALL)
or
2.Add cascade to the PERSIST
(cascade=CascadeType.PERSIST)

 

Leave a Reply

Your email address will not be published. Required fields are marked *