Thursday, January 17, 2013

Object references an unsaved transient instance - save the transient instance before flushing

This issue generally comes when you have a collection in your entity, and that collection has one or more items which are not present in the database. It is usually resolved by setting cascade property in collection mapping to "all".