-->
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.  [ 3 posts ] 
Author Message
 Post subject: HQL date operations
PostPosted: Sun Jun 07, 2015 8:21 pm 
Newbie

Joined: Sun Jun 07, 2015 8:13 pm
Posts: 2
I'm a new with hibernate and trying to test if current_time > ( datefield + intervalfield seconds )
but I am getting: unexpected token: seconds
So does it mean HQL can only add dates ?

Thanks in advance


Top
 Profile  
 
 Post subject: Re: HQL date operations
PostPosted: Mon Jun 08, 2015 6:36 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I suspect here is something wrong in your query.

You can find details about the supported functions in the official documentation: http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch16.html#queryhql-where

hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: HQL date operations
PostPosted: Tue Jun 09, 2015 2:02 am 
Newbie

Joined: Sun Jun 07, 2015 8:13 pm
Posts: 2
solved with:

time_to_sec(timediff(pastTime, current_time())) > intervalSecs


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.