-->
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: timestamp mapping not saving the milliseconds in database.
PostPosted: Wed Aug 13, 2008 1:45 pm 
Newbie

Joined: Wed Aug 13, 2008 1:30 pm
Posts: 1
3.0:

My java class has a field defined as java.sql.Timestamp and my database (oracle 9i) has column type as TIMESTAMP(6). My mapping file contains the type as timestamp.

<composite-id> <key-property name="memberId" type="long" column="MEMBER_ID"/>
<key-property name="eventDate" type="java.sql.Timestamp" column="EVENT_DATE"/>
</composite-id>

but when i am persisiting the records in database, it is not saving milliseconds of time. e.g. if my java time is 2008-08-12 00:07:33.519, it is saving 2008-08-12 00:07:33.000 in data base.

Please suggest if this is the problem with hibernate and let me know how i can persist time (with milliseconds) using hibernate.

PS - I have also tries other hibernate mappings like calendar, date etc.


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.