-->
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.  [ 2 posts ] 
Author Message
 Post subject: please help! escape % in HQL
PostPosted: Tue Aug 01, 2006 10:02 am 
Newbie

Joined: Fri Jan 27, 2006 11:14 am
Posts: 12
Hi, i have such a problem in my query.

i woudl like to query

"select * from student where name like '%er%' "

and in my HQL i put

findByNamedParam("FROM Student s WHERE s. name LIKE %:name%", "name", name)

and it causes error because program considers "name%" as the param not "name". How can i make sure that "name" is the named param, and the second "%" char is a wildcard character?

thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 10:16 am 
Newbie

Joined: Fri Jan 27, 2006 11:14 am
Posts: 12
oops sry! just realised that simply adding the "%" in the param rather than in the query string will get around with this! thnx


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