-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping DATETIME(6) Timestamps from MySQL
PostPosted: Wed Nov 06, 2013 8:22 am 
Newbie

Joined: Fri Sep 21, 2012 6:28 am
Posts: 1
Dear all,
I have a little problem with my mapped Timestamps in Hibernate.
I need Timestamps with a milliseconds precision, for which I'm using the DATETIME(6) format on the MySQL Server and java.sql.Timestamp Objects on the Client.
My problem is the conversion from the 6 digits milliseconds from the server side to the 9 digits in the Timestamp objects, because hibernate fills the first 3 millisecond-digits from the Timestamp object with zeros and not the last 3 digits.
Here is a little example:
My MySQL Server has the Timestamp: 2013-11-06 13:09:34.115395.
After I load it with Hibernate and I receive: 2013-11-06 13:09:34.000115395.

Can you tell me how to fix this?
Like I said before I'm using Datetime(6) to save the Timestamps on the server, and java.sql.Timestamp Objects on the client.
I'm using a MySQL 5.6.14 Community Server.

Many Greetings
biro


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.