These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Unable to cascade the delete in may-to-one association
PostPosted: Mon Jun 16, 2008 3:57 pm 
Newbie

Joined: Sat May 03, 2008 12:30 pm
Posts: 9
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.