| 
							
					| Regular |  
					|  |  Joined: Thu Aug 28, 2003 2:42 pm
 Posts: 77
 Location: The Netherlands
 | 
				
					| How can I map a Java Date to a Postgres Timestamp and visa versa?
 I don't want Hibernate to map Java Date to Postgres Date as the latter one has not seconds details, and I don't want Hibernate to return a Java Timestamp as that's the worse Java object there exists :( So I can't use the timestamp hibernate type as then it would return a Java Timestamp from the db.
 BTW: I don't need the nanosecond part in Timestamp...
 
 I did define define a Date -> timestamp mapping in the Postgres Dialect and did define it in the hibernate properties file.
 But for some reason, Hibernate still returns a Java Timestamp object. No idea why ... I get the feeling it's returned by the Jdbc driver and Hibernate will leave it like that as it's subclass of the Date object ...
 
 How to solve this ?
 - Ed
 
 
 |  |