-->
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.  [ 5 posts ] 
Author Message
 Post subject: Date and Calendar... again ? ;0)
PostPosted: Wed Sep 03, 2003 3:57 am 
Regular
Regular

Joined: Thu Aug 28, 2003 2:42 pm
Posts: 77
Location: The Netherlands
Hellu there,

I notice that I have to use query.setCalendar() in my HQL to use the datetime sql field , but I notice that hbm2java generates java.util.Date members in my persist objects...
I think they both work fine, but what's the logica behind this ? and what is the way to go ? For example: should I use Calendar as member in my persist objects instead of Date ?? or just leave it like this ?

Please someo light on this issue
Ed


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 5:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
eh??


Do you understand how to use Hibernate date, timestamp, time types correctly? And their corresponding Query.setDate(), Query.setTimestamp(), Query.setTime()?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 1:47 pm 
Regular
Regular

Joined: Thu Aug 28, 2003 2:42 pm
Posts: 77
Location: The Netherlands
Yep... at least I think so..
. I understand the usage like is explained in the manual.... but I am a bit confused....

In the examples in the manual you use Calendar in your value persist objects... but the hbm2java generates sql datetime fields as java.util.Date types... which works well..

Also in the manual there does appear the mapping from Date(), Calendar to the SQL type Time, timestamp, Date... but no datetime...
Yeeeyyee the manual says: (or equivalent)... but datetime is not equivalent to Date , Time and timestamp... or not ????: datetime=Date+Time... or am I missing something here ??

So what is my equivalent for datetime ??

Ed


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2003 8:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
DATETIME is the MySQL implementation of the ANSI SQL type TIMESTAMP, which (speaking loosely) Hibernate represents as the "timestamp" type.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 7:21 am 
Regular
Regular

Joined: Thu Aug 28, 2003 2:42 pm
Posts: 77
Location: The Netherlands
OK, thanx gavin.

I getting grazy of the sql types sometimes as MS gives his own interpretation of timestamp... I thought datetime is the sql ansi standard.

Tx,
Ed


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.