📄 statementbean.java
字号:
package com.ebusiness.ebank.ejb.entitybean;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: eBusiness Inc., All right reserved</p> * @author unascribed * @version 1.0 */import java.sql.Timestamp;import javax.ejb.EntityBean;import javax.ejb.CreateException;import javax.ejb.EntityContext;import com.ebusiness.ebank.bean.StatementValue;abstract public class StatementBean implements EntityBean{ private EntityContext ctx; abstract public Long getObjectID(); abstract public void setObjectID(Long oid); abstract public Timestamp getBankingDate(); abstract public void setBankingDate(Timestamp bankingDate); abstract public String getDescription(); abstract public void setDescription(String description); abstract public double getWithdrawal(); abstract public void setWithdrawal(double withdrawal); abstract public double getDeposit(); abstract public void setDeposit(double deposit); abstract public double getBalance(); abstract public void setBalance(double balance); abstract public String getAccountNo(); abstract public void setAccountNo(String accountNo); abstract public String getClientCardNo(); abstract public void setClientCardNo(String clientCardNo); abstract public String getCreateUserID(); abstract public void setCreateUserID(String createUserID); abstract public Timestamp getCreateDate(); abstract public void setCreateDate(Timestamp createDate); // Business methods /** * Parse the entity bean value to StatementValue object * * @return StatementValue */ public long getStatementOID() { return this.getObjectID().longValue(); } public StatementValue getValueObject() { StatementValue value = new StatementValue(); value.setObjectID(this.getObjectID().longValue()); value.setBankingDate(this.getBankingDate()); value.setDescription(this.getDescription()); value.setWithdrawal(this.getWithdrawal()); value.setDeposit(this.getDeposit()); value.setBalance(this.getBalance()); value.setAccountNo(this.getAccountNo()); value.setClientCardNo(this.getClientCardNo()); value.setCreateUserID(this.getCreateUserID()); value.setCreateDate(this.getCreateDate()); return value; } //This method will insert a record to the Statement table. public Long ejbCreate(StatementValue value) throws CreateException { this.setBankingDate(new Timestamp(value.getBankingDate().getTime())); this.setDescription(value.getDescription()); this.setWithdrawal(value.getWithdrawal()); this.setDeposit(value.getDeposit()); this.setBalance(value.getBalance()); this.setAccountNo(value.getAccountNo()); this.setClientCardNo(value.getClientCardNo()); this.setCreateUserID(value.getCreateUserID()); this.setCreateDate(new Timestamp((new java.util.Date()).getTime())); return null; //for container managed persistence } public void ejbPostCreate(StatementValue value) {} public void ejbActivate() {} public void ejbLoad() {} public void ejbPassivate() {} public void ejbRemove() //this method will delete the record from database { //Log.info("An Acocunt with ID = " + "" + " is being deleted from database"); } public void ejbStore() {} public void setEntityContext(EntityContext ctx) { this.ctx = ctx; } public void unsetEntityContext() {}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -