Bugs item #634646, was opened at 2002-11-06 14:48
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=634646&group_id=22866

Category: JBossCMP
>Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Calvin (cwu9t9)
>Assigned to: Dain Sundstrom (dsundstrom)
Summary: ejb-ql - LIKE

Initial Comment:
Operating System: Suse Linux 7.3
JDK: jdk1.3.1
jboss version: 3.0.4

 I have a question in regards to the finders method
that involves the "LIKE" command. In my ejb-jar.xml, i
have a query as below (i.e.):

<query>
<query-method>
<method-name>findByVendor</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(i) FROM T_Item i WHERE
i.vendor.name LIKE '%?1%']]>
</ejb-ql>
</query>

Assuming 2 rows of data should be returned:

The above query would return nothing.  However,
<![CDATA[SELECT OBJECT(i) FROM T_Item i WHERE
i.vendor.name LIKE '%Sony%']]> works fine.  I noticed
from the forum of a similar question in regards to
3.0.1 that "LIKE" query would not work with any method
parameters.   Apparanlty, it didn't work for 3.0.4 as
well.  Is this still a bug or have I used it in a wrong
way??

Thanks,  

----------------------------------------------------------------------

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-11-06 17:30

Message:
Logged In: YES 
user_id=251431

Did you even take a look at the spec?  Have you read any
books on EJB-QL?  

The spec doesn't allow parameters in the like clause, and it
definately doesn't support them inside of a string literal.
 If you want to create this type of query you will have to
use JBossQL in 3.0.4 and either preprocess the argument to
include the % signs on either side, or you will have to use
the concat function to build it in the JBossQL statement.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=634646&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to