-->
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.  [ 3 posts ] 
Author Message
 Post subject: Is SQL "ON DELETE CASCADE" used in table definitio
PostPosted: Sat Oct 06, 2007 2:33 am 
Newbie

Joined: Fri Jan 12, 2007 4:50 am
Posts: 6
Does Hibernate use the "ON DELETE CASCADE" option on foreign keys in mySQL?

Like this:

ADD CONSTRAINT `FK34FE7C671497435A` FOREIGN KEY `FK34FE7C671497435A` (`event_id`)
REFERENCES `event` (`id`)
ON DELETE CASCADE;

I tried all the "cascade" options in my hbm.xml file and it doesn't seem to generate the "ON DELETE CASCADE" option.

Thanks

Fred


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 06, 2007 6:07 pm 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Maybe this answers your question?

http://eddii.wordpress.com/2006/11/16/h ... rformance/

Regards,
Pavol


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 06, 2007 11:05 pm 
Newbie

Joined: Fri Jan 12, 2007 4:50 am
Posts: 6
pavol.zibrita wrote:
Maybe this answers your question?

http://eddii.wordpress.com/2006/11/16/h ... rformance/

Regards,
Pavol


Thanks Pavol! After following the trail to Gavin's original email

http://www.mail-archive.com/hibernate-devel@lists.sourceforge.net/msg03801.html

and back into the Hibermate documentation, I found some interesting information:
"
5.1.19. key
...
on-delete (optional, defaults to noaction): Specifies whether the foreign key constraint has databaselevel cascade delete enabled.
"

I missed that in all my searches in the documentation before.

On to trying that option in my project now. Thanks so much.

Fred


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.