I like it, added flexibility; I haven't thought this through much, but could the parent object, if it implemented the Lifecycle interface, tell that its a cascaded delete via onDelete or some other way? Maybe an onDeleteCascade() method in case its helpful to trap, or some way of telling in onDelete() via the session maybe.
Cheers, Joe > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Gavin > King > Sent: Wednesday, 21 July 2004 2:32 PM > To: hibernate-devel > Subject: [Hibernate] support for ON CASCADE DELETE > > > 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 > ------------------------------------------------------- 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