org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance – save the transient instance before flushing.
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)