📄 accountbean.java
字号:
package itso.ejb.model.entity;
import itso.bank.exception.InsufficientFundsException;
/**
* Bean implementation class for Enterprise Bean: Account
*/
public abstract class AccountBean implements javax.ejb.EntityBean {
private javax.ejb.EntityContext myEntityCtx;
/**
* setEntityContext
*/
public void setEntityContext(javax.ejb.EntityContext ctx) {
myEntityCtx = ctx;
}
/**
* getEntityContext
*/
public javax.ejb.EntityContext getEntityContext() {
return myEntityCtx;
}
/**
* unsetEntityContext
*/
public void unsetEntityContext() {
myEntityCtx = null;
}
/**
* ejbCreate
*/
public java.lang.String ejbCreate(java.lang.String id)
throws javax.ejb.CreateException {
setId(id);
return null;
}
/**
* ejbPostCreate
*/
public void ejbPostCreate(java.lang.String id)
throws javax.ejb.CreateException {
}
/**
* ejbActivate
*/
public void ejbActivate() {
}
/**
* ejbLoad
*/
public void ejbLoad() {
}
/**
* ejbPassivate
*/
public void ejbPassivate() {
}
/**
* ejbRemove
*/
public void ejbRemove() throws javax.ejb.RemoveException {
}
/**
* ejbStore
*/
public void ejbStore() {
}
/**
* Get accessor for persistent attribute: id
*/
public abstract java.lang.String getId();
/**
* Set accessor for persistent attribute: id
*/
public abstract void setId(java.lang.String newId);
/**
* Get accessor for persistent attribute: balance
*/
public abstract java.math.BigDecimal getBalance();
/**
* Set accessor for persistent attribute: balance
*/
public abstract void setBalance(java.math.BigDecimal newBalance);
/**
* Get accessor for persistent attribute: type
*/
public abstract java.lang.String getType();
/**
* Set accessor for persistent attribute: type
*/
public abstract void setType(java.lang.String newType);
public void deposit(java.math.BigDecimal amount) {
setBalance( getBalance().add(amount) );
}
public void withdraw(java.math.BigDecimal amount) throws InsufficientFundsException {
if ( getBalance().compareTo(amount) == -1 )
throw new InsufficientFundsException();
setBalance( getBalance().subtract(amount) );
}
/**
* This method was generated for supporting the relationship role named transRecords.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public abstract java.util.Collection getTransRecords();
/**
* This method was generated for supporting the relationship role named transRecords.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public abstract void setTransRecords(java.util.Collection aTransRecords);
/**
* This method was generated for supporting the relationship role named customers.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public abstract java.util.Collection getCustomers();
/**
* This method was generated for supporting the relationship role named customers.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public abstract void setCustomers(java.util.Collection aCustomers);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -