TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: package.path.Contact
I have a persistence object "Affiliate" that has a child object "Contact".
This is shown in my contact object as
@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL, mappedBy="contact")
public java.util.List<Affiliate> getAffiliate() {
return affiliate;
}em.persist(affiliate);
check the reference doc of Hibernate.