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)
Syntax
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class TimestampType _ Inherits ValueTypeType _ Implements IVersionType, IType, ICacheAssembler, ILiteralType |
C# |
---|
[SerializableAttribute] public class TimestampType : ValueTypeType, IVersionType, IType, ICacheAssembler, ILiteralType |
Visual C++ |
---|
[SerializableAttribute] public ref class TimestampType : public ValueTypeType, IVersionType, IType, ICacheAssembler, ILiteralType |
JavaScript |
---|
NHibernate.Type.TimestampType = function(); Type.createClass( 'NHibernate.Type.TimestampType', NHibernate.Type.ValueTypeType, NHibernate.Type.IVersionType, NHibernate.Type.IType, NHibernate.Type.ICacheAssembler, NHibernate.Type.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..::.ValueTypeType
NHibernate.Type..::.TimestampType
NHibernate.Type..::.AbstractType
NHibernate.Type..::.NullableType
NHibernate.Type..::.ImmutableType
NHibernate.Type..::.ValueTypeType
NHibernate.Type..::.TimestampType