Group:

What is the appropriate scheme for using custom finders in a CMP ejb. Based
on the JBoss documentation, you define the finder method for example
findByUsernamePassword() in the HOME interface:

public Long findByUsernamePassword(String username, String password)
throws FinderException, RemoteException;

I add the SQL part of it in jaws.xml, I did that. But I keep getting the
javax.ejb.FinderException: Find failed error message. Do I need to provide
an implementation for the finder method in the Bean implementation class as
well, just like for findByPrimaryKey()? If any one has an example of using
customer finders, it will be great to see the process.

Here is my jaws.xml:

<?xml version="1.0" encoding="UTF-8"?>

<jaws>
   <enterprise-beans>
     <entity>
       <ejb-name>JamalSecurity</ejb-name>
       <table-name>AR_SECURITY</table-name>
       <create-table>false</create-table>
       <cmp-field>
         <field-name>security_id_</field-name>
         <column-name>SECURITY_ID</column-name>
       </cmp-field>
       <cmp-field>
         <field-name>username_</field-name>
         <column-name>USERNAME</column-name>
       </cmp-field>
       <cmp-field>
         <field-name>password_</field-name>
         <column-name>PASSWORD</column-name>
       </cmp-field>
                         
       <finder>
        <name>findByUsernamePassword</name>
                <query>username_ = {0} AND password_ = {1}</query>
                <order></order>
       </finder>
                         
            
     </entity>
   </enterprise-beans>
         
   <datasource>OraclePool</datasource> 
   <type-mapping>Oracle8</type-mapping> 
         
 </jaws>


Thank you very much for your help.

Regards,
Jamal.
 

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

Reply via email to