-->
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: Date interval with null options
PostPosted: Tue Jan 04, 2011 8:33 am 
Beginner
Beginner

Joined: Thu Feb 25, 2010 11:33 am
Posts: 36
Hi there,
I've a little problem I cannot solve properly.

I've in a table, two date fields. The first one is called Valid_From and cannot be null. The second one is Valid_to and can be null.
The idea is that if valid_to is null, there is no expiration date.

I wish to only retreive valid rows from the database.

The way I work now is to retreive every row that is after Valid_From and then, manually check if Valid_to is not null and before now, remove it from the results, wich can become very heavy.

My question: is there any nicer way to do that in HQL directly ?

Thanks in advance,

Romain.


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.