Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Hiberante 3.0
Mapping documents:
<many-to-one name="followOnQuestionnaire" class="com.eskill.survey.Questionnaire" fetch="select" lazy="false" cascade="delete" >
<column name="FOLLOW_ON_QUESTIONNAIRE_ID" precision="22" scale="0" />
</many-to-one>
Code between sessionFactory.openSession() and session.close():
I have a many - to one relationship with the same table . FOLLOW_ON_QUESTIONNAIRE_ID points to a Questionnaire.
On the database I do not have on-delete-cascade constraint specified.
When I specify the cascading option to delete in the hbm file and delete a questionnaire, the follow-on-questionnaire is not deleted.
Can you please guide me how to cascade the delete?