This works:
         <finder>
           <name>findSdhadBySearchString11</name>
           <query>had050 LIKE {0}</query>
           <order>had050</order>
         </finder>

build your string parameter as %abc%

On Wed, 2 May 2001 18:54:50 -0700 (PDT), Carles Pi-Sunyer wrote:

>Is it possible to to create LIKE queries in a jboss
>cmp bean? 
>
>I would like to do something that allows a query that
>is the same as:
>
>select * from users where last_name like %smith%
>
>I've looked through the archives and found a couple of
>examples. 
>
>One has the jaws.xml configured:
>            <finder>
>                <name>findByLikeLastname</name>
>                <query>lastName like {0}</query>
>                <order>lastName DESC</order>
>            </finder>
>
>when I do this I only get back the exact match.
>
>A second example has:
>            <finder>
>                <name>findByLikeLastname</name>
>                <query>lastName like '%{0}%'</query>
>                <order>lastName DESC</order>
>            </finder>
>this produces a FinderException.
>
>I've also tried: %{0}% and '{0}' which both also
>produce FinderExceptions.
>
>Has anyone had any luck creating a query that uses
>LIKE? 
>
>Any help is appreciated.
>
>Thanks,
>Carles
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Auctions - buy the things you want at great prices
>http://auctions.yahoo.com/
>
>_______________________________________________
>JBoss-user mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/jboss-user
>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Franco Biaggi">
<meta name="GENERATOR" content="Franco Biaggi">
</head>

<body>

<p>&nbsp; </p>

<table BORDER="1" COLS="1" WIDTH="452" BGCOLOR="#FFFF00">
  <tr>
    <td width="446"><font face="Comic Sans MS"><small><small><br>
    <font color="#3333FF"><a href="http://www.ticino.com/usr/fbiaggi/";>Franco 
Biaggi</a></font><small><br>
    <font color="#3333FF"><a href="http://www.sisa.ch";>SISA Studio Informatica 
SA</a></font><small><small><small> <br>
    </small></small></small><font color="#3333FF">R&amp;D 
Services</font><small><small><small>
    <br>
    </small></small></small><font color="#3333FF">Via Carvina 
1</font><small><small><small> <br>
    </small></small></small><font color="#3333FF">CH-6807 
Taverne</font><small><small><small> <br>
    </small></small></small><font color="#3333FF">Efax +1 801 705 
2839</font></small></small></small><br>
    </small></small></small><font color="#3333FF">Tel. +41 91 935 75 35&nbsp; Fax. +41 
91 935
    75 30</font></small></small></small><br>
    </small></small></small><font color="#3333FF">Sorry for my bad 
english...</font><small><small><small> <br>
</font></td>
  </tr>
</table>
</body>
</html>




_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to