You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Eric Northam <Er...@i4commerce.com> on 2003/07/02 20:12:02 UTC

REPOST: Timestamp and Order By

I have a class that has a java.util.Date as a member variable and I've
mapped it to a DATETIME type in MySQL via a TIMESTAMP type in my
repository.xml. If I do an order by through an OQL query the dates are
sorted up to the day only. The time seems to be ignored e.g.

5/21/2003 09:12:00
5/21/2003 10:14:00
5/21/2003 09:12:00
5/22/2003 09:12:00
5/23/2003 09:12:00

If anyone knows if this is a bug or how to get around it please let me know?
Is there a unit test that validates that this works?

Eric





DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorized. If you are not the
intended recipient please notify us immediately by returning the e-mail to
the originator.

RE: REPOST: Timestamp and Order By

Posted by David Choy <da...@alloy.com>.
try using DATE


-----Original Message-----
From: Eric Northam [mailto:Eric.Northam@i4commerce.com]
Sent: Wednesday, July 02, 2003 2:12 PM
To: 'ojb-user@db.apache.org'
Subject: REPOST: Timestamp and Order By


I have a class that has a java.util.Date as a member variable and I've
mapped it to a DATETIME type in MySQL via a TIMESTAMP type in my
repository.xml. If I do an order by through an OQL query the dates are
sorted up to the day only. The time seems to be ignored e.g.

5/21/2003 09:12:00
5/21/2003 10:14:00
5/21/2003 09:12:00
5/22/2003 09:12:00
5/23/2003 09:12:00

If anyone knows if this is a bug or how to get around it please let me know?
Is there a unit test that validates that this works?

Eric





DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorized. If you are not the
intended recipient please notify us immediately by returning the e-mail to
the originator.