I am new to Hibernate. In my application a class "Analysis" have unidirrectional many-to-one association with a class called "Dataset".
In the "Analysis" mapping file the relationship specified as follows:
<many-to-one
name="dataset"
class="emissions.emisview.Dataset"
column="DATASET_ID"
cascade="save-update"
/>
When I delete Dataset object using Session.delete() I am getting an exception, org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch updae.
Is there any setting available in Hibernate that will check whether the deleting dataset is referenced in the analyses table, if so set the reference to null before delete them.
|