By using the <timestamp /> element you're telling NHibernate you want it to use that column for versioning purposes. If you don't want that, just map it as a regular column; you'll probably need to use the generated attribute to tell NH that the value will be created by the database.
On Aug 26, 7:37 am, Vosje <[email protected]> wrote: > Hi All, > > I want to add to some database (SQL Server 2005) tables a timestamp > column (type datetime). > This column is meant for logging purposes, so it’s not used for > versioning. > > When I add to the mapping a timestamp property only the timestamp is > updated > When a record is inserted. When I update the record the timestamp is > the same as before. > > Does somebody know a solution for this issue? > > Regards, > Arco de Vos > > Mapping: > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> > <class name="Mosos.Model.Data.ADT_Bed, Mosos.Model" > table="ADT_Bed" > > > <id name="Id" unsaved-value="0"> > <generator class="native"/> > </id> > > <timestamp name="TimeStamp" /> > > <property name="Name"> > <column name="Name" sql-type="varchar(20)"/> > </property> > > <property name="Deleted"/> > > </class> > </hibernate-mapping> -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
