I am trying to use the LIKE keyword in a finder with a wildcard, using an input parameter, I want the ejb ql to look like this:SELECT OBJECT(i) FROM Person i WHERE i.lastName LIKE ?1%

I have used LIKE '?1%', (obviously doesn't work, looks for last names that start with ?1. so I tried LIKE CONCAT(?1,'%'). The descriptor won't parse, compains about expecting a string literal after the LIKE keyword. I have tried several other configurations as well, and nothing I do works. Either the descriptor won't parse, or the ejb ql doesn't do what I want. I am fairly sure this is not a new issue, but i cannot find the solution. I have read the spec, and it says I should be able to do LIKE CONCAT(?1,'%'). I also rigorously inspected a deployment descriptor from a different app that is running in a different app server, and it is written JUST LIKE THAT. Imagine my frustration. I can only assume I am making a noob error, but if you could, would you please let me know what it is. Your help is appreciated.

Sorry for the last response. In fact my code does not work, it return nothing like yours.Regarding the EJB spec, nothing in the spec says that the LIKE keyword in EJB-QL statement must work with input parameters. The only example is with literal strings. So the LIKE statement in EJB-QL is useless, in conclusion.

You must use a @jboss.query for that, but passing the % in the parameter.

Horay Horay Horay !!! that works beautifully. I no wish I should have looked closer at the jboss specific way to override finders.... I am new to JBoss and EJB in general. I suppose the spec does not specifically give an example of using input params in finders with LIKE... I am off to ask some questions on sun's boards now, as it seems a bit odd. the BNF for EJB QL says you can use a string expression with like, and CONCAT should be a String Expression... at least that's how I read it. Anyway, thank you. If there is anything I can do, let me know, as the ability to search in this way is very important in my app. Thanks again.