All Examples All EJB Examples This Package
Interface examples.ejb.basic.containerManaged.AccountHome
- public interface AccountHome
This interface is the home interface for the EJBean AccountBean,
which in WebLogic is implemented by the code-generated container class
AccountBeanC. A home interface may support one or more create methods,
which must correspond to methods named "ejbCreate" in the EJBean.
-
create(String, double, String)
- This method corresponds to the ejbCreate method in the bean
"AccountBean.java".
-
findAccount(double)
- Finds an EJBean with a balance equal to a given amount.
-
findBigAccounts(double)
- Finds all EJBeans with a balance greater than a given amount.
-
findByPrimaryKey(String)
- Given a Primary Key, refreshes the EJBean from
the persistent storage.
-
findNullAccounts()
- Finds all EJBeans with a type of 'null'.
create
public Account create(java.lang.String accountId,
double initialBalance,
java.lang.String type) throws javax.ejb.CreateException, java.rmi.RemoteException
This method corresponds to the ejbCreate method in the bean
"AccountBean.java".
The parameter sets of the two methods are identical. When the client calls
AccountHome.create()
, the container (which in WebLogic EJB is
also the factory) allocates an instance of the bean and
calls AccountBean.ejbCreate()
For container-managed persistence, ejbCreate()
returns a null, unlike the case of bean-managed
persistence, where it returns a primary key. See section 9.4.2
- Parameters:
accountID
- String Account ID
initialBalance
- double Initial balance
type
- String Account type
- Returns:
- Account
- Throws:
- javax.ejb.CreateException - if there is an error creating the bean
- java.rmi.RemoteException - if there is
a communications or systems failure
- See Also:
- AccountBean
findByPrimaryKey
public Account findByPrimaryKey(java.lang.String primaryKey) throws javax.ejb.FinderException, java.rmi.RemoteException
Given a Primary Key, refreshes the EJBean from
the persistent storage.
- Parameters:
primaryKey
- Primary Key
- Returns:
- Account
- Throws:
- javax.ejb.FinderException - if there is an error finding the bean
- java.rmi.RemoteException - if there is
a communications or systems failure
- See Also:
- AccountBean
findAccount
public Account findAccount(double balanceEqual) throws javax.ejb.FinderException, java.rmi.RemoteException
Finds an EJBean with a balance equal to a given amount.
Returns a single EJBean Account.
- Parameters:
balanceEqual
- double Test Amount
- Returns:
- Account
- Throws:
- javax.ejb.FinderException - if an error occurs while accessing
the persistent storage
- java.rmi.RemoteException - if there is
a communications or systems failure
- See Also:
- AccountBean
findBigAccounts
public java.util.Enumeration findBigAccounts(double balanceGreaterThan) throws javax.ejb.FinderException, java.rmi.RemoteException
Finds all EJBeans with a balance greater than a given amount.
Returns an Enumeration of found EJBean Accounts.
- Parameters:
balanceGreaterThan
- double Test Amount
- Returns:
- Enumeration of Account
- Throws:
- javax.ejb.FinderException - if an error occurs while accessing
the persistent storage
- java.rmi.RemoteException - if there is
a communications or systems failure
- See Also:
- AccountBean
findNullAccounts
public java.util.Enumeration findNullAccounts() throws javax.ejb.FinderException, java.rmi.RemoteException
Finds all EJBeans with a type of 'null'.
- Returns:
- Enumeration of Account
- Throws:
- javax.ejb.FinderException - if an error occurs while accessing
the persistent storage
- java.rmi.RemoteException - if there is
a communications or systems failure
- See Also:
- AccountBean
All Examples All EJB Examples This Package