-->
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: How to handle timestamps with hibernate an ingres via jdbc ?
PostPosted: Fri Mar 05, 2010 11:12 am 
Newbie

Joined: Fri May 11, 2007 3:04 am
Posts: 3
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.html
In 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.


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.