Hi Carles ,

change your finder as below :

   <finder>
      <name>findByLikeProjectTitle</name>
      <query>projectitle like {0}||'%'</query>
      <order>companyid</order>
  </finder>
 


Thanks .

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

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

Reply via email to