1 package cmpdb; 2 3 import java.util.Collection ; 4 import javax.ejb.*; 5 6 9 public abstract class CustomerBean implements EntityBean, CustomerLocalBusiness { 10 private EntityContext context; 11 12 18 public void setEntityContext(EntityContext aContext) { 19 context = aContext; 20 } 21 22 25 public void ejbActivate() { 26 27 } 28 29 32 public void ejbPassivate() { 33 34 } 35 36 39 public void ejbRemove() { 40 41 } 42 43 46 public void unsetEntityContext() { 47 context = null; 48 } 49 50 53 public void ejbLoad() { 54 55 } 56 57 60 public void ejbStore() { 61 62 } 63 65 66 public abstract Integer getCustomerId(); 67 public abstract void setCustomerId(Integer customerId); 68 69 public abstract String getZip(); 70 public abstract void setZip(String zip); 71 72 public abstract String getName(); 73 public abstract void setName(String name); 74 75 public abstract String getAddressline1(); 76 public abstract void setAddressline1(String addressline1); 77 78 public abstract String getAddressline2(); 79 public abstract void setAddressline2(String addressline2); 80 81 public abstract String getCity(); 82 public abstract void setCity(String city); 83 84 public abstract String getState(); 85 public abstract void setState(String state); 86 87 public abstract String getPhone(); 88 public abstract void setPhone(String phone); 89 90 public abstract String getFax(); 91 public abstract void setFax(String fax); 92 93 public abstract String getEmail(); 94 public abstract void setEmail(String email); 95 96 public abstract Integer getCreditLimit(); 97 public abstract void setCreditLimit(Integer creditLimit); 98 99 public abstract Collection getOrdersBean(); 100 public abstract void setOrdersBean(Collection ordersBean); 101 102 public abstract DiscountCodeLocal getDiscountCode(); 103 public abstract void setDiscountCode(DiscountCodeLocal discountCode); 104 105 106 public Integer ejbCreate(Integer customerId, String zip, String name, String addressline1, String addressline2, String city, String state, String phone, String fax, String email, Integer creditLimit, DiscountCodeLocal discountCode) throws CreateException { 107 if (customerId == null) { 108 throw new CreateException("The field \"customerId\" must not be null"); 109 } 110 if (zip == null) { 111 throw new CreateException("The field \"zip\" must not be null"); 112 } 113 if (discountCode == null) { 114 throw new CreateException("The field \"discountCode\" must not be null"); 115 } 116 117 setCustomerId(customerId); 119 setZip(zip); 120 setName(name); 121 setAddressline1(addressline1); 122 setAddressline2(addressline2); 123 setCity(city); 124 setState(state); 125 setPhone(phone); 126 setFax(fax); 127 setEmail(email); 128 setCreditLimit(creditLimit); 129 130 return null; 131 } 132 133 public void ejbPostCreate(Integer customerId, String zip, String name, String addressline1, String addressline2, String city, String state, String phone, String fax, String email, Integer creditLimit, DiscountCodeLocal discountCode) { 134 setDiscountCode(discountCode); 136 137 } 138 } 139 | Popular Tags |