-->
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.  [ 1 post ] 
Author Message
 Post subject: How to return current date on query of date field.
PostPosted: Tue Jul 27, 2010 3:39 pm 
Newbie

Joined: Tue Jul 27, 2010 3:34 pm
Posts: 1
I am using Hibernate 3 with a MySQL database and the current version of Java. I am currently implementing a search for dates and date ranges. My current table is very simple and contains a startDate and an endDate field. I am using a value of null in end date to signify the "present" or current date. Using HQL or the Criteria API is there a way for me to formulate my queries such that when searching against a row where the endDate is null that the current system date is used? I have looked into using a case..when...then...else...end type of statement, but there aren't any solid examples of how to use it. Any help is much appreciated!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.