[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4844) OracleDialect incorrectly maps timestamps and dates to Hibernate Date Type

Brian (JIRA) noreply at atlassian.com
Tue Jan 26 09:34:35 EST 2010


OracleDialect incorrectly maps timestamps and dates to Hibernate Date Type
--------------------------------------------------------------------------

                 Key: HHH-4844
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4844
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.5.0-Beta-3
         Environment: org.hibernate.dialect.OracleDialect
            Reporter: Brian


OracleDialect maps an jdbc timestamp type to a hibernate date type, and maps by default, jdbc date type to hibernate org.hibernate.type.DateType.  Hibernate Date Type translation uses ResultSet.getDate which means that time is truncated from the date.  This is not what you want, you want to include the time.  These should use a hibernate TypeStampType.  This is what a java.util.Date mapping uses.  Right now, you will get different results if running an sql query on the same table vs. a hibernate hql query, it will map to different types.  Propose the OracleDialect class do this:

registerColumnType( Types.DATE, Hibernate.TIMESTAMP.getName() );
registerColumnType( Types.TIMESTAMP, Hibernate.TIMESTAMP.getName() );

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list