I am trying to save java Date with milliseconds in a MySQL timestamp column using Hibernate, but milliseconds are always saved as .000 .
The definition of a column in sleep mode is as follows:
@Type(type="timestamp")`` private Timestamp timestamp;
The column database is declared as TIMESTAMP(3)
I tried various combinations, including Date , but none of them helped. I am using MySQL 5.6.25, Connector / J version 5.1.37, Hibernate 4.0.1.
I have been doing this for a while, but could not find a solution that works for me.
Any help would be appreciated.
source share