hibernate-devel  

[Hibernate] support for ON CASCADE DELETE

Gavin King
Tue, 20 Jul 2004 22:01:41 -0700

I've implemented support for ON DELETE CASCADE foreign key
definitions for parent/child associations (ie. for inverse
one-to-many).

You map this like:

<set name="children" inverse="true" cascade="all">
   <key name="PARENT_ID" on-delete="cascade"/>
   <one-to-many class="Child"/>
</set>

So, when the Parent instance is deleted, Hibernate
does not need to perform n+1 deletes; instead, we
leave that to the database to take care of.

Any comments?

--
Gavin King
+61 41 053 4454
+1 404 822 8349

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel