Via annotations I want to map a Java Timestamp to a MySql timestamp (default mapping). This timestamp may be not null, but therefore gets a default value of (0000-000 ...) to indicate, that no time has been set.
A problem ist the subtle difference between the two Timestamp implementations:
The java Timestamp counts from 1970-1-1, but the MySql one defaults to my intended "0000-00...". So I am not able to set a zero time value to the Java datatype. My thought is to write the zero date via the default datatype within the database. But in a case of saving the corresponding object like this:
Code:
session.save(myTimestampWrapperObject);
I see no chance of triggering the default value of the database. Within MySql the timestamp value would be left blank to indicate that the default should be used. How can I achive this in my code?
Hibernate version:
3.3
Name and version of the database you are using:
MySql 5.1.11