How To Make NHibernate Automatically change an "Updated" column

Posted by IanT8 on Stack Overflow See other posts from Stack Overflow or by IanT8
Published on 2010-03-17T03:39:17Z Indexed on 2010/03/17 3:41 UTC
Read the original article Hit count: 304

I am applying NHibernate to an existing project, where tables and columns are already defined and fixed.

The database is MS-SQL-2008. NHibernate 2.1.2

Many tables have a column of type timestamp named "ReplicationID", and also a column of type datetime named "UpdatedDT".

I understand I might be able to use the element of the mapping file to describe the "ReplicationID" column which will allow NHibernate to manage that column.

Is it possible to make NHibernate automatically update the UpdatedDT column when the row is updated? I suppose I could try mapping the UpdatedDT property to be of type timestamp, but that have other side effects.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about nhibernate-mapping