This content has been marked as final.
Show 1 reply
-
1. Re: EJB-QL LIKE
dsundstrom Aug 10, 2002 12:34 PM (in response to ruzmelin)In the furture you will be able to use string function in the like clause in JBossQL (it was just an over site). In the mean time I suggest you preprocess the input parameter in code to add the % to the begining and end. I would do the follwoing:
change findByKeyword in the Home to selectByKeyword
add the ejbHomeSelectByKeyword method to the Impl class
have the new method modify the keyword call an ejbSelect method
map the ejbSelect method to a JBossQL query in the jbosscmp-jdbc.xml file.
BTW, you have to use JBossQL instead of EJB-QL as EJB-QL does not allow parameters in a LIKE clause.