I think you have the same problem I had.... NH will not (as I
understand it) generate a single DELETE FROM entity WHERE foreignkey =
X. From my tests it will work out the keys of the child table and
delete them all one-by-one, i.e. DELETE FROM entity WHERE primarykey =
Y, where NH has already got the primary keys into its cache.

The documentation is very misleading IMO about this.

On-delete-cascade does not mean NH will do the above, it means NH will
not do a delete at all and leave it up to the database (RI cascade
delete or a trigger).

Therefore if you cannot change your DB then you are stuck, which does
surprise me TBH as there are plenty of brownfield situations where you
cannot change the DB.

I'm happy for a NH expert to come along and say "no, you're an idiot,
this is the mapping you need" (and I wish they would) but I've raised
this query myself on these forums a while ago and this was the
response I eventually managed to work out from some of the very
cryptic responses I recieved.

If I'm wrong, then please let me know.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to