NHibernate query with filter by timestamp field

前端 未结 1 332
醉话见心
醉话见心 2021-01-27 07:20

I have table with versioning field of type Timestmap. Now I\'m trying to make a query with search by this field, but when I\'m passing parameter in next way:

que         


        
相关标签:
1条回答
  • 2021-01-27 08:12

    The NHibernate TimestampType specifies:

    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.

    This type is simply not for use with the MS SQL type TIMESTAMP. In fact, that column type is deprecated:

    The timestamp syntax is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

    rowversion (Transact-SQL)

    You should use NHibernateUtil.Binary or NHibernateUtil.BinaryBlob.

    0 讨论(0)
提交回复
热议问题