|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--samples.j2ee.ejb.sequence.jdbc.AutoAccountBean
AutoAccountBean is an EntityBean. This EJBean illustrates:
| Field Summary | |
java.lang.String |
accountId
|
double |
balance
|
static int |
lastKey
|
static int |
maxKey
|
| Constructor Summary | |
AutoAccountBean()
|
|
| Method Summary | |
java.lang.String |
accountId()
Returns account ID. |
double |
balance()
Returns current balance. |
double |
deposit(double amount)
Adds amount to balance. |
void |
ejbActivate()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbCreate(double initialBalance)
This method corresponds to the create method in the home interface "AutoAccountHome.java". |
void |
ejbCreate(java.lang.String accountId,
double initialBalance)
This method corresponds to the create method in the home interface "AutoAccountHome.java". |
void |
ejbLoad()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbPassivate()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbPostCreate(double initialBalance)
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbPostCreate(java.lang.String accountId,
double initialBalance)
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbRemove()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbStore()
This method is required by the EJB Specification, but is not used by this example. |
void |
setEntityContext(javax.ejb.EntityContext ctx)
Sets the EntityContext for the EJBean. |
void |
unsetEntityContext()
Unsets the EntityContext for the EJBean. |
double |
withdraw(double amount)
Subtracts amount from balance. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public java.lang.String accountId
public double balance
public static int lastKey
public static int maxKey
| Constructor Detail |
public AutoAccountBean()
| Method Detail |
public void ejbActivate()
public void ejbPassivate()
public void setEntityContext(javax.ejb.EntityContext ctx)
ctx - EntityContextpublic void unsetEntityContext()
public void ejbLoad()
public void ejbStore()
public void ejbRemove()
throws javax.ejb.RemoveException
public void ejbCreate(java.lang.String accountId,
double initialBalance)
throws javax.ejb.CreateException
AutoAccountHome.create(), the container (which in WebLogic
EJB is also the home) allocates an instance of this EJBean and
calls AutoAccountBean.ejbCreate().
For container-managed persistence, ejbCreate() returns
a void, unlike the case of bean-managed
persistence, where it returns a primary key.
accountID - String Account IDinitialBalance - double Initial Balance
public void ejbCreate(double initialBalance)
throws javax.ejb.CreateException
AutoAccountHome.create(), the container (which in WebLogic
EJB is also the home) allocates an instance of this bean and
calls AutoAccountBean.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(String accountId, double initialBalance),
this version creates a new AccountID using getNewAccountId().
initialBalance - double Initial Balance
public void ejbPostCreate(java.lang.String accountId,
double initialBalance)
accountID - String Account IdentificationinitialBalance - double Initial Balancepublic void ejbPostCreate(double initialBalance)
initialBalance - double Initial Balancepublic double deposit(double amount)
amount - double Amount
public double withdraw(double amount)
throws ProcessingErrorException
amount - double Amountpublic double balance()
public java.lang.String accountId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||