-
1. Re: EJB-QL using LIKE with input parameter
dsundstrom Jun 30, 2002 2:16 PM (in response to cjne)This is supported in JBossQL which is an extension of EJB-QL. To use JBossQL, copy (not move) your query element the ejb-jar.xml file to the jbosscmp-jdbc.xml file. Change ejb-ql tag in the jbosscmp-jdbc.xml file to jboss-ql, and make the ejb-ql tag in the ejb-jar.xml file an empty element (i.e., <ejb-ql/>). JBossQL supports parameters in IN and LIKE clauses, and the ORDER BY clause proposed for EJB 2.1.
-
2. Re: EJB-QL using LIKE with input parameter
yyi2133 Aug 23, 2002 8:43 AM (in response to cjne)Yes, this is a good workaround but it's also a JBOSS limitation! in fact JBoss claim to be full EJB-QL compliant but EJB-QL specification states that:
The syntax for the use of the comparison operator [NOT] LIKE in a conditional expression is as follows:
cmp_path_expression [NOT] LIKE pattern_value [ESCAPE escape_character]
The cmp_path_expression must have a string value. The pattern_value is a string literal or a string-valued input parameter in which an underscore (_) stands for [...]
So the "like" expression can be an input parameter! however this is an extract from EJB v.2.1 not 2.0 . I don't know exactly if it is also a 2.0 requirement... however, does anybody know when this feature will be available in JBOSS? -
3. Re: EJB-QL using LIKE with input parameter
dsundstrom Aug 27, 2002 1:21 PM (in response to cjne)JBoss is written to the final EJB 2.0 specification. You are quoting from a draft of the 2.1 specification. It would be stupid for JBoss main releases to be witten to a draft specification. JBoss 4.0 will be written to the EJB 2.1 specification. If you would like to use parameters in LIKE clauses you must use the non spec compliant JBossQL.
The draft EJB 2.1 spec still falls short because it does not have a UCASE or LCASE function so you can't do a caseless search.