If there is no exception, the query was executed successfully.

alex

Thursday, June 26, 2003, 2:24:11 AM, Marco Tedone wrote:

MT> Hi, I'm trying to use a finder method which I defined with EJB-QL:

MT> The signature is as follows:

MT> public java.util.Collection findByEmailPassword(java.lang.String email,
MT> java.lang.String password)
MT>     throws javax.ejb.FinderException;

MT> in the ejb-jar.xml file I have the following:

MT> <query>
MT> <description><![CDATA[Returns all the people with the specified
email]]>></description>
MT> <query-method>
MT> <method-name>findByEmailPassword</method-name>
MT> <method-params>
MT> <method-param>java.lang.String</method-param>
MT> <method-param>java.lang.String</method-param>
MT> </method-params>
MT> </query-method>
MT> <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM People o WHERE o.email = ?1
MT> AND o.password = ?2]]></ejb-ql>
MT> </query>

MT> and in the server.log file I have the following (does it mean that the query
MT> has been executed succesfully?):

MT> 2003-06-26 00:09:34,703 DEBUG
MT> [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.People.findByEmailPassword]
MT> Executing SQL: SELECT DISTINCT t0_o.peopleId FROM People t0_o WHERE
MT> t0_o.email = ? AND t0_o.password = ?

MT> The finder method is on a local entity bean and I'm executing it from a
MT> Session bean; I know the parameter's values are correct, but I still receive
MT> no records, even if the record is on the table.

MT> Here follows the client's signature:

MT> private PeopleLocal getUser(String entityName,
MT> String email,
MT> String password){
MT> PeopleLocal local = null;
MT> try {
MT> log.info("email: " + email + " password: " + password);
MT> local = (PeopleLocal) getHome(entityName).findByEmailPassword(email,
MT> password);
MT> } catch (FinderException e) {
MT> log.equals("Exception while getting user: " + e.getMessage());
MT> }
MT> finally{
MT> return local;
MT> }
MT> }

MT> Please help!

MT> Marco



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to