-->
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: criteria to comparing table column with DB current_timestamp
PostPosted: Mon Oct 28, 2013 5:32 am 
Newbie

Joined: Thu Dec 15, 2011 3:07 am
Posts: 2
Hi,

I am trying to query to database using hibernate criteria query, where one of the restriction is that the "validupto" property has to be grater than the DB's (oracle) "current_timestamp" ( from dual )

The criteria I made is --

Criteria criteria = session.createCriteria(Holiday.class, "h")
.add(Restrictions.ge("validUpTo", "current_timestamp");
List<Holiday> holidays = criteria.list();

I know this is not going to work.

So friends, please share some sample code or ideas, how to compare the date_column of a table with the DB's current_timestamp using hibernate criteria query.

Thanks
Paragflume


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.