Uploaded image for project: 'NHibernate'
  1. NHibernate
  2. NH-2660

Db.Time types are being set as DateTime

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.1.0
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              ngroot Neal Groothuis added a comment -

              Test case illustrating the problem.

              Show
              ngroot Neal Groothuis added a comment - Test case illustrating the problem.
              Hide
              fabiomaulo Fabio Maulo added a comment -

              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)
              Show
              fabiomaulo Fabio Maulo added a comment - 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)

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  ngroot Neal Groothuis
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Who's Looking?