You are not able to pass input parameters to the LIKE. I tried to do the same but I read in the book "Enterpise Javabeans- O'reilly" that it's not possible, so you just can use the LIKE wiht a predefined String,
ex: SELECT .. FROM ... WHERE ... c.name LIKE '%_%'
% stands for any sequence of characters
_ stands for any single character
Hope it helps !
It sure doesn't make sense to me that the EJB 2.0 specification doesn't include support for "LIKE" expressions with parameters.
Thanks for the quick, helpful response.
i've encountered the same problem. it's not jboss - it's a shortcoming in standard ejb-ql (doesn't work in the R.I. either). isn't that the worst? sometimes i wonder if EJB-QL was put through any stringent use cases. the language is strong but has several shortcomings that render it almost useless.
you may want to look into using jboss-ql to get around these problems. it supports "like" with run-time arguments as well as dynamic ejb-ql.