This is almost the exact same type as the DateTime except it can be used
in the version column, stores it to the accuracy the database supports,
and will default to the value of DateTime.Now if the value is null.
Namespace: NHibernate.TypeAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
C# |
---|
[SerializableAttribute] public class TimestampType : PrimitiveType, IVersionType, IType, ICacheAssembler, ILiteralType |
Visual Basic |
---|
<SerializableAttribute> _ Public Class TimestampType _ Inherits PrimitiveType _ Implements IVersionType, IType, ICacheAssembler, ILiteralType |
Visual C++ |
---|
[SerializableAttribute] public ref class TimestampType : public PrimitiveType, IVersionType, IType, ICacheAssembler, ILiteralType |
Remarks
The value stored in the database depends on what your data provider is capable of storing. So there is a possibility that the DateTime you save will not be the same DateTime you get back when you check DateTime.Equals(DateTime) because they will have their milliseconds off.
For example - SQL Server 2000 is only accurate to 3.33 milliseconds. So if NHibernate writes a value of 01/01/98 23:59:59.995 to the Prepared Command, MsSql will store it as 1998-01-01 23:59:59.997.
Please review the documentation of your Database server.
Inheritance Hierarchy
System..::..Object
NHibernate.Type..::..AbstractType
NHibernate.Type..::..NullableType
NHibernate.Type..::..ImmutableType
NHibernate.Type..::..PrimitiveType
NHibernate.Type..::..TimestampType
NHibernate.Type..::..DbTimestampType
NHibernate.Type..::..AbstractType
NHibernate.Type..::..NullableType
NHibernate.Type..::..ImmutableType
NHibernate.Type..::..PrimitiveType
NHibernate.Type..::..TimestampType
NHibernate.Type..::..DbTimestampType