Db.Time types are being set as DateTime

Description

NHibernate.Type.TimeAsTimeSpanType and NHibernate.Type.TimeType add DateTime parameters to the commands passed to their Set() methods, but per this MSDN article: http://msdn.microsoft.com/en-us/library/cc716729.aspx , the .NET datatype that should be used for DbType.Time fields is TimeSpan. At least when trying to update TIME columns with SQL Server 2008, this causes an error.

I believe that this can be fairly easily corrected by having the Set() methods save TimeSpans rather than DateTimes to the parameter list.

Environment

None

Attachments

1

Activity

Show:

Fabio Maulo April 24, 2011 at 1:58 PM

Don't worry for the "won't fix"... I'm on the workaround of the Ms bug.
I'll introduce two new NH's types.

  • DateTimeToTimeSpanType

  • TimeSpanType (with a breaking change for the old one who will renamed to TimeSpanAsInte64Type)

Neal Groothuis April 20, 2011 at 11:06 AM

Test case illustrating the problem.

Won't Fix

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created April 20, 2011 at 9:44 AM
Updated April 24, 2011 at 1:58 PM
Resolved April 24, 2011 at 1:58 PM
Who's Looking?