The code "String findByName_query = "people.name like $1"" in the home
interface does not do anything for the bean, 
you have to modify the deployment descriptor (eq.
<orion_home>\application-deployments\<app>\<app>-ejb.jar\orion-ejb-jar.xml).

in the deployment descriptor look for <finder-method query=""> tag then 
        change it to <finder-method query="$name like $1" >
                        ...
                        ...
        call the method using findByName("%john%");
        
        stop and start the server.
this should do it.
        

> -----Original Message-----
> From: fresnaULL [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 13, 2001 8:43 AM
> To:   Orion-Interest
> Subject:      Problem with a finder QUERY.
> 
> Hi all,
>  
> Basically, this is the query i'm trying to do: (i'm using SQL SERVER 7.0)
>  
> SELECT * FROM people 
>         WHERE people.name LIKE '%john%'
>  
> This is what i've done now:
>     - In the people home interface
>  
>         String findByName_query  = "people.name like $1"; 
>         .
>         .
>         public java.util.Enumeration findByName(String value) throws
> java.rmi.RemoteException, javax.ejb.FinderException;
> 
>  
> I make a call to the finder query like this:
>  
> Enumeration en = PeopleHome.findByName("%John%");
>  
> But this doesn't work or at least I don't get any result(of course it
> should return a result). 
> If I replace the "like" clause by "=" and i make a call like 
>           Enumeration en = PeopleHome.findByName("John");
> it does work, I get a result.
>  
> Does anybody know what I'm doing wrong? is there any problem with the
> "like" clause?
>  
> Thanks in advance
>  
> P.S. I'm not trying to laugh at anybody :-)
>  
> >From: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> >[ <mailto:[EMAIL PROTECTED]>]On Behalf Of Geoff
> Marshall
> >Sent: Monday, February 12, 2001 10:31 AM
> >To: Orion-Interest
> >Subject: Re: Problems with a finder method in a cmp
> >
> >
> >Please don't laugh at me, but what IS a 'finder method in a CMP'??  Just
> a
> >simple explanation or a pointer to more info, please...
> >--
> >
> >-Geoff Marshall, Director of Development
> 

------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately 
notify the sender by e-mail at the address shown.  This e-mail transmission may 
contain confidential information.  This information is intended only for the use of 
the individual(s) or entity to whom it is intended even if addressed incorrectly.  
Please delete it from your files if you are not the intended recipient.  Thank you for 
your compliance.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Reply via email to