-->
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: [Schemaexport] BUG ? Strange mapping for Date on Informix
PostPosted: Tue May 11, 2004 4:29 am 
Newbie

Joined: Mon Apr 26, 2004 11:01 am
Posts: 12
Location: France
I use Informix to do some test and I noticed that if I had a attribute in java.util.Date, it is automatically converted in DATETIME HOUR TO SECOND in Informix. By that way, the data base doesn't persist the day but only the hour (ex : 18:08:34). When I ask load the data from Informix, Java tolds me that the date is "1 May 1970 16:08:34 GMT", it's the right hour. (I live in French and we had 2 hours more that GMT)

With Informix, in order to obtain a right result I told in the mapping file that the field in Hibernate's type is "Time". The attribute is thus converted into DATETIME YEAR TO FRACTION(5). I have the good informations in Database (ex:2004-05-04 18:08:34.00000) but when I load the data from Informix, Java tolds me that the day is still "1 May 1970 17:08:34 GMT", it a wrong date and a wrong hour.

I found it strange and I wonder if it's a bug.

I did the same on MaxDB and I got a Timestamp. That was normal and I had the right date on loading : "4 May 2004 16:08:34 GMT".
When I specified that the hibernate's type is "Time", in my database the MaxDB type is Time and it just represents the hour.

_________________
Xavier MOGHRABI
http://www.enstimac.fr/~moghrabi


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.