on-delete="cascade" make two things:1) create in DB CASCADE DELETE 2) NH know that there is a CASCADE DELETE and run only one SQL
If you want a one-shot-delete you can use Clear or on-delete="cascade" (with CASCADE DELETE in DB). What I don't understand is: I have two solution for my problem but I want another one. Obviously the most efficient solution is on-delete="cascade" 2008/11/27 Graham Bunce <[EMAIL PROTECTED]> > > Fabio, > > I want to have one shot delete performed by NHibernate. > > With the code - Session.Delete(newContent) and the above map in SQL > Profiler I see something like this: > > DELETE FROM Content WHERE Id = ? > > This causes a crash as my database does not have CASCADE DELETE. > > I expect to see this: > > DELETE FROM AssetContent WHEREContentId = ? > DELETE FROM Content WHERE Id = ? > > Therefore on-delete="cascade" does not do one shot delete as I > understand it. As far as I can tell, it does nothing at all. I accept > I may not understand what it does so please explain - thanks. > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
