-->
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.  [ 2 posts ] 
Author Message
 Post subject: java.util.Date and java.sql.Date
PostPosted: Mon Jun 27, 2005 6:11 am 
Newbie

Joined: Mon Jun 27, 2005 5:19 am
Posts: 1
Hibernate maps java.util.Date to java.sql.Date when serializing to DB, and returns java.sql.Date when deserializing. So you can get some class cast errors on compareTo if you are using JDK1.5.
I have copied DateType and TimestampType classes and modified them to return java.util.Date in get method.
Then I've placed them into separate jar and then I've tried to include this jar in CLASSPATH before hibernate.jar. So modified classes are loading instead original. It looks like all is ok now.
Is it good way for solving such trouble? Is it possible to change hibernate Type-clases to return java.util.Date?
I can upload modified classes if you want to see them.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 8:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Your solution is okay, but Hibernate will not be modified there - this has already been discussed extensively on this forum, just do a search.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.