Yes but that would delete all of the children for a given parent ! What if I only want to delete a few of them ? The IN would still be appropriate and would be :
DELETE FROM TABLE_B WHERE CHILDREN_ID IN (1, 2, 3) On 8 avr, 12:02, Graham Bunce <grahambu...@hotmail.com> wrote: > I'm a little confused over your mapping of table to class but, > assuming you meant TABLE_A relates to class A and TABLE_B relates to > class B, your example would therefore be: > > DELETE FROM TABLE_B WHERE CHILDREN_ID IN (1, 2, 3) - Children_id is > the primary key > > Correct? > > If so, then If you're raising the JIRA then I would suggest that > surely the SQL: > > DELETE FROM TABLE_B WHERE PARENT_ID = ? is more efficent (as NH knows > the parent ID already). The way you are suggesting would mean the IN > statement would be massive if there were a large number of rows as it > needs to list every primary key value. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---