-->
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.  [ 2 posts ] 
Author Message
 Post subject: cascade delete relationship
PostPosted: Mon May 28, 2007 7:48 am 
Beginner
Beginner

Joined: Sat May 12, 2007 2:55 am
Posts: 24
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi friends,
i am new to hibernate and want to know how can i perform on delete cascade operation using hibernate. i.e. i have two tables parent(parentid as PK) and child(parent id as FK), when using GUI i delete a parent, all the child of that parent and the parent itself should be deleted..
i have generated bi-directional .hbm files but have not specified anywhere cascade options.
should i mention cascade in parent or in child?
do i need to modify my database tables for cascade options?


thanks in advance.
nirav

Hibernate version:3.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:MySQL 5.0

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject: cascade delete relationship
PostPosted: Mon May 28, 2007 5:10 pm 
Beginner
Beginner

Joined: Wed Apr 18, 2007 6:17 pm
Posts: 49
Location: Dominican Republic
not your tables but your hbm.xml files. Please go to the hibernate reference on the Chapter 21. Example: Parent/Child. If this help you pls rate the post.


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.