[jboss-jira] [JBoss JIRA] Commented: (HIBERNATE-120) Hibernate maps type "timestamp" to Mysql's type "datetime" not "timestamp"

zhou yanming (JIRA) jira-events at lists.jboss.org
Wed Aug 12 21:42:26 EDT 2009


    [ https://jira.jboss.org/jira/browse/HIBERNATE-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12480401#action_12480401 ] 

zhou yanming commented on HIBERNATE-120:
----------------------------------------

It could be fixed in org.hibernate.dialect.MySQLDialect

change
registerColumnType( Types.TIMESTAMP, "datetime" );
to
registerColumnType( Types.TIMESTAMP, "timestamp" );

> Hibernate maps type "timestamp" to Mysql's type "datetime" not "timestamp"
> --------------------------------------------------------------------------
>
>                 Key: HIBERNATE-120
>                 URL: https://jira.jboss.org/jira/browse/HIBERNATE-120
>             Project: Hibernate Integration
>          Issue Type: Bug
>            Reporter: zhou yanming
>            Assignee: Steve Ebersole
>            Priority: Critical
>
> datetime will trim millisecond
> record.setLastModified(new Date(1250053078708));
> session.save(record);
> ....
> record = session.load(record.getId());
> System.out.println(record.getLastModified()); // here is 125005307000 not expected 1250053078708

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

        



More information about the jboss-jira mailing list