-->
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: Why do we use scale and precision with sqltype DateTime?
PostPosted: Tue Mar 28, 2006 11:53 am 
Newbie

Joined: Mon Oct 13, 2003 4:15 pm
Posts: 4
Hello,

I've been searching and I couldn't find the reason, but why so some people use scale and precision when mapping a datetime field?

example:
<property name="dateModified" type="java.util.Date">
<column name="dateModified" scale="23" precision="3" sql-type="datetime"/>
</property>

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 2:23 pm 
Expert
Expert

Joined: Mon Jan 09, 2006 5:01 pm
Posts: 311
Location: Sacramento, CA
ok - so I won't answer your question, since I don't know off-hand, but you should use "timestamp" instead, since it is more portable.

I can give you a guess at your question:
scale makes a little sense, since you want to be able to store a large #, that is milliseconds. "precision" doesn't make sense to me at all, and perhaps is a mistake, since it milliseconds will always be an integer, and never a rational-number (in a mathematical sense).

_________________
-JT

If you find my replies helpful, please rate by clicking 'Y' on them. I appreciate it.


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.