-->
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: Criteria..Query
PostPosted: Wed Aug 18, 2004 3:53 pm 
Newbie

Joined: Wed Aug 18, 2004 9:51 am
Posts: 2
Hibernate version:2.1.5

Hi,
I'm using the Criteria object to create my query. I want a list of records between two given dates (inclusive of both the dates)...

here is my code....

List ueis = session.createCriteria(UeiInstance.class)
.add( Expression.ge("CreateStamp", sd))
.add( Expression.le("CreateStamp", ed))

if sd -> 2004-08-03 00:00:00
& ed -> 2004-08-17 23:59:00

it is displaying...records for all days between 03 & 16.. but it is not displaying for 17th.. can anyone.. tell me what is wrong? I have even tried.. using.. Expression.between("CreateStamp",sd,ed)... even then, I don't get data for 17th...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2004 5:20 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Looks like the comparison is made on DATE and not on DATETIME...
Check your mapping and/or database model.
Have a look at the different Hibernate types and how they map on the db - mainly date, time and timestamp.


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.