• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bruno Collet
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic