1 package org.objectweb.jonas.stests.appli; 3 4 import org.objectweb.jonas.common.Log; 5 import org.objectweb.util.monolog.api.Logger; 6 import org.objectweb.util.monolog.api.BasicLevel; 7 8 11 public abstract class CustomerEC2R implements javax.ejb.EntityBean { 12 13 static private Logger logger = null; 14 javax.ejb.EntityContext ejbContext; 15 16 27 28 public String ejbCreate(Integer custID, String fN, String lN, String phone) 29 throws javax.ejb.CreateException { 30 setCustomerID(custID); 31 setFirstName(fN); 32 setLastName(lN); 33 setPhone(phone); 34 setAddressLine1("unknown"); 35 setAddressLine2("unknown"); 36 setCity("unknown"); 37 setState("unknown"); 38 setZip("unknown"); 39 setCreditLimit(0); 40 setBalance(0); 41 setYearToDateBalance(0); 42 return null; 43 } 44 45 64 public String ejbCreate(Integer Id, String fN, String lN, String inits, 65 String addr1, String addr2, 66 String city, String state, String zip, 67 String phone, 68 float creditLimit) throws javax.ejb.CreateException { 69 logger.log(BasicLevel.DEBUG, ""); 70 71 setCustomerID(Id); 73 setFirstName(fN); 74 setLastName(lN); 75 setPhone(phone); 76 setAddressLine1(addr1); 77 setAddressLine2(addr2); 78 setCity(city); 79 setState(state); 80 setZip(zip); 81 setCreditLimit(creditLimit); 82 setBalance(0); 83 setYearToDateBalance(0); 84 return null; 85 } 86 87 public void ejbPostCreate(Integer custID, String fN, String lN, String phone) { 88 logger.log(BasicLevel.DEBUG, ""); 89 } 90 91 public void ejbPostCreate(Integer Id, String fN, String lN, String inits, 92 String addr1, String addr2, 93 String city, String state, String zip, 94 String phone, 95 float creditLimit) { 96 logger.log(BasicLevel.DEBUG, ""); 97 } 98 99 public abstract Integer getCustomerID(); 104 public abstract void setCustomerID(Integer id); 105 public abstract String getFirstName(); 106 public abstract void setFirstName(String fn); 107 public abstract String getLastName(); 108 public abstract void setLastName(String ln); 109 public abstract String getMiddleInitials(); 110 public abstract void setMiddleInitials(String mi); 111 public abstract String getPhone(); 112 public abstract void setPhone(String phone); 113 public abstract String getAddressLine1(); 114 public abstract void setAddressLine1(String line); 115 public abstract String getAddressLine2(); 116 public abstract void setAddressLine2(String line); 117 public abstract String getCity(); 118 public abstract void setCity(String city); 119 public abstract String getState(); 120 public abstract void setState(String state); 121 public abstract String getZip(); 122 public abstract void setZip(String zip); 123 public abstract float getBalance(); 124 public abstract void setBalance(float balance); 125 public abstract float getYearToDateBalance(); 126 public abstract void setYearToDateBalance(float ytdBalance); 127 public abstract float getCreditLimit(); 128 public abstract void setCreditLimit(float limit); 129 133 134 public void setEntityContext(javax.ejb.EntityContext ctx) { 135 if (logger == null) { 136 logger = Log.getLogger("org.objectweb.jonas_tests"); 137 } 138 logger.log(BasicLevel.DEBUG, ""); 139 ejbContext = ctx; 140 } 141 142 143 public void unsetEntityContext() { 144 logger.log(BasicLevel.DEBUG, ""); 145 ejbContext = null; 146 } 147 148 public void ejbRemove() throws javax.ejb.RemoveException { 149 logger.log(BasicLevel.DEBUG, ""); 150 } 151 152 153 public void ejbLoad() { 154 logger.log(BasicLevel.DEBUG, ""); 155 } 156 157 158 public void ejbStore() { 159 logger.log(BasicLevel.DEBUG, ""); 160 } 161 162 163 public void ejbPassivate() { 164 logger.log(BasicLevel.DEBUG, ""); 165 } 166 167 168 public void ejbActivate() { 169 logger.log(BasicLevel.DEBUG, ""); 170 } 171 172 179 180 public void updateBalance(float orderAmount) { 181 float ytd = getYearToDateBalance(); 182 setYearToDateBalance(ytd + orderAmount); 183 float balance = getBalance(); 184 setBalance(balance + orderAmount); 185 } 186 } 187 188 189 190 | Popular Tags |