-
1. Re: EJB-QL LIKE clause
dsundstrom Apr 25, 2002 7:03 PM (in response to romeriz)EJB-QL does not support parameters in the like clause, but JBossQL does. To use JBossQL copy your query element to the jbosscmp-jdbc.xml file, and change ejb-ql to jboss-ql. For more information on the proper formatting of the jbosscmp-jdbc.xml file see the dtd.
http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd -
2. Re: EJB-QL LIKE clause
romeriz Apr 26, 2002 10:09 AM (in response to romeriz)Thanks for that. Does anyone know how you would achieve a similar result in EJB-QL?
Thanks.
Stephen. -
3. Re: EJB-QL LIKE clause
shogun Apr 27, 2002 7:20 AM (in response to romeriz)Extract the jboss.jar and search for it.
-
4. Re: EJB-QL LIKE clause
dsundstrom Apr 27, 2002 11:51 AM (in response to romeriz)You can't; that's why I wrote JBossQL.
-
5. Re: EJB-QL LIKE clause
morphace Apr 29, 2002 11:07 AM (in response to romeriz)You can achieve a similar result by using the LOCATE function (which produces a more expensive query of course).
-
6. Re: EJB-QL LIKE clause
semm May 15, 2002 8:38 AM (in response to romeriz)This doesn't work in EJB-QL, but shouldn't it ?
....
WHERE o.name LIKE CONCAT(?1, '%') -
7. Re: EJB-QL LIKE clause
dsundstrom May 15, 2002 12:51 PM (in response to romeriz)Read the grammar in the spec. The patters must be a string literal. I could easily add this to JBossQL, but I won't unless it is widely supported.
-
8. Re: EJB-QL LIKE clause
cwbrandon May 15, 2002 2:16 PM (in response to romeriz)Dain,
Will or does JBossQL support a max function? -
9. Re: EJB-QL LIKE clause
dsundstrom May 15, 2002 4:15 PM (in response to romeriz)Will. I think Antonio is about to start on this. Aggregate function are part of the forth coming EJB 2.1 specification.
-
10. Re: EJB-QL LIKE clause
cwbrandon May 15, 2002 4:18 PM (in response to romeriz)Cool, so since it will be part of the EJB-QL 2.1 spec I guess JBossQL won't have to support it.
-
11. Re: EJB-QL LIKE clause
dsundstrom May 15, 2002 4:22 PM (in response to romeriz)Until they release the spec this will only be in JBossQL.
-
12. Re: EJB-QL LIKE clause
ionel May 16, 2002 7:54 AM (in response to romeriz)Hi,
I've try to develop a "like" statement in jbosscmo-jdbc.xml but at deploy time, it complains :
"ERROR [XmlFileLoader] XmlFileLoader: File file:/users/vol1/gardais/app-serv/jboss-3.0.0beta/tmp/deploy/89.facade-jms-like.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 84. Error message: Element "query" does not allow "jboss-ql" here."
After studying the DTD, i see no explanation for that behaviour as the query tag allows "(jboss-ql|dynamic-ql|declared-ql)?"
Does anybody know why do i get this message ?
INFO [Server] JBoss (MX MicroKernel) [3.0.0beta Date:200202210220]
jbosscmp-jdbc.xml uses the following doctype :
<!DOCTYPE jbosscmp-jdbc PUBLIC
"-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
thanks for any help,
ionel -
13. Re: EJB-QL LIKE clause
dsundstrom May 17, 2002 4:34 PM (in response to romeriz)Order matters. Make sure you have the tags in the same order. If that doesn't work post the query section.
-
14. Re: EJB-QL LIKE clause
ionel May 21, 2002 2:43 AM (in response to romeriz)Hi,
I was wondering if order matters or not and you give me the answer.
I've check for the order thing already.
It doesn't solve my problem.
Here is my Query section :
selectionne les personnes dont le nom commence par ...
<query-method>
<method-name>findByNameLike</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql>select distinct object(p) from personneBean p where p.nom like ?1</jboss-ql>
I've try it with and without the same query declared in the ejb-jar.xml but the problem remains.
I also get an error message from JBoss when deploying a query in jbosscmp-jdbc.xml that wasn't declared in ejb-jar.xml such as "no matching request in ejb-jar.xml" or something like this.
But when I include the same request in the ejb-jar file, it complains that "like" isn't supported.
Any ideas,
thanks for your help,
ionel