Hi

An ejbSelect() method is a query method just like finder method but it can
be used internally only.

A situation you want to use ejbSelect() method, for example, is when you
have a home method called ejbHomeGetTotalBankValue() which add up to totals
of all bank account values in the bank table. In this case the container
should generate JDBC for you in ejbSelect() method then you call this method
from ejbHomeGetTotalBankValue() method.

public abstract double ejbSelectAllAccountBalances()
    throws FinderException;

public double ejbHomeGetTotalBankValue() throws Exception {
    // Get a collection of bank account balances
    Collection c = this.ejbSelectAllAccountBalance();

    // Loop through collection and return sum
}

In this case ejbSelect() method return container-managed field, which is
collection of double value


Regards,
Tinnapat

----- Original Message -----
From: "xgao" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 5:15 PM
Subject: What is the difference between ejb find method and select method in
cmp2


> Hi all
>
> I am playing with the cmp2 and find cmp2 give us 2 solutions for EJB QL.
one
> is findByXXX , the other is EjbSelectXXX. Can anyone tell me when to use
> findByXXX , when to use EjbSelectXXX, and what is the difference between
> them?
>
> Thanks
> xiao
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to