Hi Leung,
You should'nt use the '%' symbols in the finder definition, instead you should attach them to the parameter you pass to the finder method.
i.e.
finder definition:
<finder-method query="select catname,description from cat_ejb_Category where $description like $1">
finder calling:
findBy...("%" + description + "%");
 
Hope this help
Giustino De Vincentiis
 
-----Messaggio originale-----
Da: Yeung Man Leung [mailto:[EMAIL PROTECTED]]
Inviato: giovedì 19 ottobre 2000 9.57
A: Orion-Interest
Oggetto: customize finder method

Hi all,
    I have try to customize the a findBy method in one of my Bean in the following.
                        <finder-method query="select catname,description from cat_ejb_Category where $description like '%$1%'" partial="false">
                                <!-- Generated SQL: "select catname,description from cat_ejb_Category where cat_ejb_Category.description like '%?%'" -->
                                <method>
                                        <ejb-name>cat.ejb.Category</ejb-name>
                                        <method-name>findByDesc</method-name>
                                        <method-params>
                                                <method-param>java.lang.String</method-param>
                                        </method-params>
                                </method>
                        </finder-method>
 
   However when I try to execute the findBy method,
    I got the following exception:
    com.evermind.server.rmi.OrionRemoteException: Database error: ORA-01006: bind variable does not exist
   
    Did anyone know what went wrong in my sql, thx
 
Leung

Reply via email to