-->
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: How to ignore the time in criteria.add(Expression.eq("","))
PostPosted: Thu Oct 08, 2009 9:53 am 
Newbie

Joined: Thu Oct 08, 2009 9:44 am
Posts: 1
I want to search for a record with Date as the criteria.

I am doing:-
Criteria criteria = session.createCriteria(MyClass.class);
criteria.add(Expression.eq("columnName", dateValue));

This is trying to equate the two dates with time also.
I want that only date should be compared and not the time.

For e.g. I have a row in database -- 10/05/2009 5:30:00 AM
and my search criteria value(dateValue) is - 10/05/2009 00:00:00 AM

In this case the Expression criteria is not equal to the record in db so this record id not fetched.

How to ignore the time in -
criteria.add(Expression.eq("columnName", dateValue));

Thanks


Top
 Profile  
 
 Post subject: Re: How to ignore the time in criteria.add(Expression.eq("","))
PostPosted: Wed Jul 14, 2010 5:34 pm 
Newbie

Joined: Wed Jul 14, 2010 5:30 pm
Posts: 1
Did you ever figure out how to do this?
I'm havin the exact same problem.

Thanks n advance for your help


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.