I have searched for the correct solution, but am not sure of the correct way of handling timestamps with nanos with hibernate.
Hibernate version: 3.2.6, using JDK 1.4 java.sql.Timestamp handling
Ingres Databas Version: , version: II 9.3.0 (int.w32/159)
Ingres Jdbc driver version: Ingres Corporation - JDBC Driver, version: 3.4.9
I have now implemented the HibernateUTC UserType approach see:
https://www.hibernate.org/100.html or
https://www.hibernate.org/461.htmlIn my mapping xml documents i map the database column to the HibernateUTC type and in the java class i map this field/property to a java.sql.TimeStamp.
Is this the recommended way of handling timestamps ?
Even with this solution i seem to have the problem of nanos for the timestamp only being 3 digits.
Is there no other way in hibernate than this ?
I have looked at
https://forum.hibernate.org/viewtopic.php?t=925275 and several other forum topics which indicate to me that you should actually be able to have a java.util.date property mapped to a timestamp column and hibernate should handle all, but i cant get that to work.
Could someone let me know if this is the way to solve timestamps or if i should use other mapping for this, please.