Override delete behaviour in NHibernate

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-07T15:21:10Z Indexed on 2010/04/07 15:23 UTC
Read the original article Hit count: 387

Filed under:
|
|
|

Hi all

In my application users cannot truly delete records. Rather, the record's Deleted field gets set to 1, which hides it from selects.

I need to maintain this behaviour and I'm looking into whether NHibernate is appropriate for my app. Can I override NHibnernate's delete behaviour so that instead of issuing DELETE statements, it issues UPDATES, as described above?

I would obviously also need to override its SELECT behaviour to include the 'AND Deleted = 0' clause. Or read from a view instead. I dunno.

TIA for your advice.

David

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about override