Hello all!
We are using the Joined-Subclass mapping strategy (table per subclass). The classes look like this:
----------------------------Transaction (Class)----------------------- SaleTransaction (SubClass1)-----------------RefundTransaction(Subclass2)
We have an AFTER DELETE trigger on the SaleTransaction and the RefundTransaction tables to ensure that if a record on these tables is deleted, the corresponding record on the Transaction table gets deleted too.
The problem that we are facing is that when we are 'using' NHibernate to delete a record in the SaleTransaction or RefundTransaction tables, NHibernate's default behaviour is to automatically delete the record on the Transaction table as well, a record that is no longer there, because the Trigger has already deleted it, and this throws an error.
We would prefer to let the DB maintain referential integrity, so we wonder if there is a way to change this behaviour in Nhibernate.
|