NHibernate: inserting additional calculated column

Posted by Andrey Shchekin on Stack Overflow See other posts from Stack Overflow or by Andrey Shchekin
Published on 2010-05-12T07:01:50Z Indexed on 2010/05/12 7:04 UTC
Read the original article Hit count: 330

Filed under:

What would be your approach with NHibernate to do the following:
When Comment is inserted into DB, and its property Text is inserted into column Text (due to a mapping), insert into column TextHash a hash of this property value.

It seems trivial if I map TextHash, but how should I do this without mapping it?
I do not need it in the domain model, its a DB-level optimization (I would use computed HashBytes if not for the length limit).

© Stack Overflow or respective owner

Related posts about nhibernate