Problem somewhat solved. It turns out that the MySQL timestamp type doesn't store milliseconds, either. So, I'll have to a find another way to deal with this problem.
[quote="sgoldstein"]Thanks in advance for the help.
I'm using Hibernate 2.1 with MySQL 4.1 and I'm having a problem with losing precision when trying to store a java.util.Calendar object. Theorectically, I should be able to maintain precision if it's stored as a SQL Timestamp. However, when Hibernate creates the tables, a sql datetime is used instead. Looking at the MySQL Dialect, this is how it's implemented. Does anyone know why this is?
To fix my problem, I've attempted to override this mapping by using the sql-type attribute on the column element, but that doesn't appear to work. Here is the relevant portion of the mapping file that I'm using:
<property name="createdDate" access="field">
<column name="created_date" sql-type="TIMESTAMP" not-null="true"/>
</property>
Am I using this properly? If so and if this is not a solution to my problem, does anyone have any other suggestions for maitaning the time precision?
Thank you, again.
Scott[/quote]
|