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: Unexpected token: single quotes?
PostPosted: Sun Oct 21, 2007 4:04 pm 
Newbie

Joined: Sun Oct 21, 2007 3:58 pm
Posts: 1
Hello,

I have following query:

Code:
List found =  getHibernateTemplate().find("from Position where (select now()- interval '24 hours' < time and pos.tag=?", tag.getMacAddr());


Unfortunately I get error:

nexpected token: '24 hours' near line 1, column 58 [from fi.mst.model.Position where (select now()- interval '24 hours' < time and pos.tag=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:

I guess that the problem is the single quotes. How could I fix this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 21, 2007 10:48 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Have you tried escaping the single quotes using \?

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 4:01 pm 
Newbie

Joined: Tue Oct 23, 2007 3:53 pm
Posts: 1
I think the error is from the keyword interval. I'm dealing with the same issue right now.


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.