Joined: Fri Jul 14, 2006 9:13 am Posts: 2 Location: Manchester, England
|
I need to add audit information to certain entities - in the usual format
createdDate, createdBy, modiedDate, modifiedBy.
The problem I have is I want the createdDate and modifiedDate values to be the database time values not the application values.
How can I do this in NHibernate; ideally I could set the values using a property type of formula (i.e. formula=getdate()) but formula values do not map to a column.
I can't use the <timestamp> attribute as I don't want this timestamp to be used in an 'optimistic locking' context as we already use a integer versionid to do this.
Problem in a nushell is how to I get NHibernate to insert (and update) database columns with the current database time getdate() (SQL Server)
Thanks
John
|
|