Get your CodeRanch badge!*
The moose likes JBoss/WildFly and the fly likes EJB-QL: how to use LIKE with input variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EJB-QL: how to use LIKE with input variable?" Watch "EJB-QL: how to use LIKE with input variable?" New topic
Author

EJB-QL: how to use LIKE with input variable?

Bruno Collet
Ranch Hand

Joined: Jun 08, 2004
Posts: 40
If I simply pass the search term, then the following code does not return any result (although there should be some).



When surrounding the input parameter with %, then JBoss throws an exception at deployment, saying that % should not be there.



In the end, I surrounded the search term with % before calling the finder method, which in my opinion is quite ugly Ugly but it works.



Any smart idea on how to correctly specify a LIKE search term with input parameter in EJB-QL with JBoss (4)?


Bruno Collet<br /><a href="http://www.practicalsoftwarearchitect.com" target="_blank" rel="nofollow">www.practicalsoftwarearchitect.com</a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB-QL: how to use LIKE with input variable?
 
Similar Threads
ejbSelect method problem
Using EJB-QL LIKE and a replacable param(?1).
EJB QL ....where o.parameter1 = *
EJB-QL: how to use LIKE with input variable?
need help in EJB QL with upper and like