1 25 26 package eb; 27 28 35 36 37 import javax.ejb.CreateException; 38 import javax.ejb.EntityBean; 39 import javax.ejb.EntityContext; 40 import javax.ejb.RemoveException; 41 42 public class AccountImplBean implements EntityBean { 43 44 protected EntityContext entityContext; 46 47 public Integer accno; 49 50 public String customer; 51 52 public double balance; 53 54 55 56 64 public Integer ejbCreate(int val_accno, String val_customer, double val_balance) throws CreateException { 65 66 accno = new Integer(val_accno); 68 customer = val_customer; 69 balance = val_balance; 70 return null; 71 } 72 73 76 public void ejbPostCreate(int val_accno, String val_customer, double val_balance) { 77 } 79 80 84 85 93 public void ejbActivate() { 94 } 96 97 109 public void ejbLoad() { 110 } 112 113 122 public void ejbPassivate() { 123 } 125 126 143 public void ejbRemove() throws RemoveException { 144 } 146 147 159 public void ejbStore() { 160 } 162 163 177 public void setEntityContext(EntityContext ctx) { 178 179 entityContext = ctx; 181 } 182 183 197 public void unsetEntityContext() { 198 entityContext = null; 199 } 200 201 205 206 210 public double getBalance() { 211 212 return balance; 213 } 214 215 219 public void setBalance(double d) { 220 221 balance = balance + d; 222 } 223 224 228 public String getCustomer() { 229 230 return customer; 231 } 232 233 237 public void setCustomer(String c) { 238 239 customer = c; 240 } 241 242 245 public int getNumber() { 246 return accno.intValue(); 247 } 248 } | Popular Tags |