title: Hibernate MSSQL datetime2 mapping
body: <p>I have a stored procedure which is returning a column having datatype as datetime2 in database and Date in Java file. When I am trying to call getTime() on that obtained time from database. It's returning 19994321211 millisecond which is equivalent to Mon May 04 00:00:00 IST 2015. ideally it should return milliseconds of 2015-05-04 15:21:52 as this is the time shown in database when procedure is executed directly. </p>
  
  <p>As I am new to Hibernate , I am unable to understand if the issue is related to hibernate mapping or something else I am missing out.</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
     &lt;sql-query name="getMLC"&gt;
              &lt;return-scalar column="mlcid" type="int" /&gt;
              &lt;return-scalar column="completionTime" type="date" /&gt;
              { call lsc.MLC_Get(:ABC, :XYZ, :ErrorCode)}
      &lt;/sql-query&gt;
  &lt;/hibernate-mapping&gt;
  
  class Mlc implements java.io.Serializable {
  
      private Integer mlcid;
      private Date completionTime;
      // getter and setter
  }
  </code></pre>