All Examples All EJB Examples This Package
Class examples.ejb.sequence.oracle.OracleBean
java.lang.Object
|
+----examples.ejb.sequence.oracle.OracleBean
- public class OracleBean
- extends Object
- implements EntityBean
OracleBean is an EntityBean. This EJBean illustrates:
- Container-managed JDBC persistence and transactions;
the code in this file never directly accesses the data storage for
storage.
- Direct access to the data storage to automatically obtain account IDs.
- Application-defined exceptions.
- Author:
- Copyright (c) 1998 by WebLogic, Inc. All Rights Reserved.
- Copyright (c) 1998-1999 by BEA WebXpress. All Rights Reserved.
-
accountId
-
-
lastKey
-
-
maxKey
-
-
salary
-
-
OracleBean()
-
-
accountId()
- Returns account ID.
-
ejbActivate()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbCreate(double)
- This method corresponds to the create method in the home interface
"OracleHome.java".
-
ejbCreate(Integer, double)
- This method corresponds to the create method in the home interface
"OracleHome.java".
-
ejbLoad()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbPassivate()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbPostCreate(double)
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbPostCreate(Integer, double)
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbRemove()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbStore()
- This method is required by the EJB Specification,
but is not used by this example.
-
id()
- Returns the Primary Key identifying this EJBean.
-
salary()
- Returns current salary.
-
setEntityContext(EntityContext)
- Sets the EntityContext for the EJBean.
-
unsetEntityContext()
- Unsets the EntityContext for the EJBean.
accountId
public Integer accountId
salary
public double salary
lastKey
public static int lastKey
maxKey
public static int maxKey
OracleBean
public OracleBean()
id
public String id()
- Returns the Primary Key identifying this EJBean.
- Returns:
- String Identification
ejbActivate
public void ejbActivate() throws RemoteException
- This method is required by the EJB Specification,
but is not used by this example.
- Throws: RemoteException
- if there is a communications or systems failure
ejbPassivate
public void ejbPassivate() throws RemoteException
- This method is required by the EJB Specification,
but is not used by this example.
- Throws: RemoteException
- if there is a communications or systems failure
setEntityContext
public void setEntityContext(EntityContext ctx) throws RemoteException
- Sets the EntityContext for the EJBean.
- Parameters:
- ctx - EntityContext
- Throws: RemoteException
- if there is a communications or systems failure
unsetEntityContext
public void unsetEntityContext() throws RemoteException
- Unsets the EntityContext for the EJBean.
- Throws: RemoteException
- if there is a communications or systems failure
ejbLoad
public void ejbLoad() throws RemoteException
- This method is required by the EJB Specification,
but is not used by this example.
- Throws: RemoteException
- if there is a communications or systems failure
ejbStore
public void ejbStore() throws RemoteException
- This method is required by the EJB Specification,
but is not used by this example.
- Throws: RemoteException
- if there is a communications or systems failure
ejbRemove
public void ejbRemove() throws RemoteException
- This method is required by the EJB Specification,
but is not used by this example.
- Throws: RemoteException
- if there is a communications or systems failure
ejbCreate
public void ejbCreate(Integer accountId,
double initialSalary)
- This method corresponds to the create method in the home interface
"OracleHome.java".
The parameter sets of the two methods are identical. When the client calls
OracleHome.create()
, the container (which in WebLogic EJB is
also the home) allocates an instance of this EJBean and
calls OracleBean.ejbCreate()
.
For container-managed persistence, ejbCreate()
returns
a void, unlike the case of bean-managed
persistence, where it returns a primary key.
- Parameters:
- accountID - Integer Account ID
- initialSalary - double Initial salary
ejbCreate
public void ejbCreate(double initialSalary) throws CreateException
- This method corresponds to the create method in the home interface
"OracleHome.java".
The parameter sets of the two methods are identical. When the client calls
OracleHome.create()
, the container (which in WebLogic EJB is
also the home) allocates an instance of this bean and
calls OracleBean.ejbCreate()
.
For bean-managed persistence, ejbCreate()
returns
a primary key, unlike the case of container-managed
persistence, where it returns a void.
Unlike the ejbCreate(Integer accountId, double initialSalary)
,
this version creates a new AccountID using getNewAccountId()
.
- Parameters:
- initialSalary - double Initial Salary
- Throws: CreateException
- if there is a problem getting an account ID
ejbPostCreate
public void ejbPostCreate(Integer accountId,
double initialSalary)
- This method is required by the EJB Specification,
but is not used by this example.
- Parameters:
- accountID - Integer Account Identification
- initialSalary - double Initial Salary
ejbPostCreate
public void ejbPostCreate(double initialSalary)
- This method is required by the EJB Specification,
but is not used by this example.
- Parameters:
- initialSalary - double Initial Salary
salary
public double salary()
- Returns current salary.
- Returns:
- double Salary
accountId
public Integer accountId()
- Returns account ID.
- Returns:
- Integer Account ID
All Examples All EJB Examples This Package