|
WebLogic Server 6.0 Code Examples, BEA Systems, Inc. | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.ejb20.relationships.one2many.AccountBean
AccountBean is an EntityBean. This EJBean illustrates:
Field Summary | |
(package private) static boolean |
VERBOSE
|
Constructor Summary | |
AccountBean()
|
Method Summary | |
java.lang.String |
accountType()
Returns the account type. |
void |
addCustomer(Customer cust)
|
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. |
java.lang.String |
ejbCreate(java.lang.String accountId,
double initialBalance,
java.lang.String type)
This method corresponds to the create method in the home interface "AccountHome.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(java.lang.String accountId,
double initialBalance,
java.lang.String type)
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()
Sets the EJBean's modified flag to false. |
abstract java.lang.String |
getAccountId()
container managed fields |
abstract java.lang.String |
getAccountType()
|
abstract double |
getBalance()
|
abstract Customer |
getCustomer()
|
abstract void |
setAccountId(java.lang.String val)
|
abstract void |
setAccountType(java.lang.String val)
|
abstract void |
setBalance(double val)
|
abstract void |
setCustomer(Customer c)
|
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 |
|
Field Detail |
static final boolean VERBOSE
Constructor Detail |
public AccountBean()
Method Detail |
public java.lang.String accountType()
public void addCustomer(Customer cust)
public double balance()
public double deposit(double amount)
amount
- double Amountpublic void ejbActivate()
ejbActivate
in interface javax.ejb.EntityBean
public java.lang.String ejbCreate(java.lang.String accountId, double initialBalance, java.lang.String type) throws javax.ejb.CreateException
AccountHome.create()
, the container (which in WebLogic EJB is
also the home) allocates an instance of this EJBean 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.
accountID
- String Account IDinitialBalance
- double Initial Balancejavax.ejb.CreateException
- if there is a problem creating the beanpublic void ejbLoad()
ejbLoad
in interface javax.ejb.EntityBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.EntityBean
public void ejbPostCreate(java.lang.String accountId, double initialBalance, java.lang.String type) throws javax.ejb.CreateException
accountID
- String Account IdentificationinitialBalance
- double Initial Balancetype
- String Account typepublic void ejbRemove() throws javax.ejb.RemoveException
ejbRemove
in interface javax.ejb.EntityBean
javax.ejb.RemoveException
- if the EJBean does not allow removing the EJBeanpublic void ejbStore()
ejbStore
in interface javax.ejb.EntityBean
public abstract java.lang.String getAccountId()
public abstract java.lang.String getAccountType()
public abstract double getBalance()
public abstract Customer getCustomer()
public abstract void setAccountId(java.lang.String val)
public abstract void setAccountType(java.lang.String val)
public abstract void setBalance(double val)
public abstract void setCustomer(Customer c)
public void setEntityContext(javax.ejb.EntityContext ctx)
setEntityContext
in interface javax.ejb.EntityBean
ctx
- EntityContextpublic void unsetEntityContext()
unsetEntityContext
in interface javax.ejb.EntityBean
public double withdraw(double amount)
amount
- double Amount
|
Documentation is available at http://e-docs.bea.com/wls/docs60 |
|||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |