1 package ent; 2 3 import java.util.Collection ; 4 import javax.ejb.*; 5 6 11 public abstract class CustomerBean implements EntityBean, CustomerLocalBusiness { 12 private EntityContext context; 13 14 20 public void setEntityContext(EntityContext aContext) { 21 context = aContext; 22 } 23 24 27 public void ejbActivate() { 28 29 } 30 31 34 public void ejbPassivate() { 35 36 } 37 38 41 public void ejbRemove() { 42 43 } 44 45 48 public void unsetEntityContext() { 49 context = null; 50 } 51 52 55 public void ejbLoad() { 56 57 } 58 59 62 public void ejbStore() { 63 64 } 65 67 68 public abstract Integer getCustomerId(); 69 public abstract void setCustomerId(Integer customerId); 70 71 public abstract String getZip(); 72 public abstract void setZip(String zip); 73 74 public abstract String getName(); 75 public abstract void setName(String name); 76 77 public abstract String getAddressline1(); 78 public abstract void setAddressline1(String addressline1); 79 80 public abstract String getAddressline2(); 81 public abstract void setAddressline2(String addressline2); 82 83 public abstract String getCity(); 84 public abstract void setCity(String city); 85 86 public abstract String getState(); 87 public abstract void setState(String state); 88 89 public abstract String getPhone(); 90 public abstract void setPhone(String phone); 91 92 public abstract String getFax(); 93 public abstract void setFax(String fax); 94 95 public abstract String getEmail(); 96 public abstract void setEmail(String email); 97 98 public abstract Integer getCreditLimit(); 99 public abstract void setCreditLimit(Integer creditLimit); 100 101 public abstract Collection getOrdersBean(); 102 public abstract void setOrdersBean(Collection ordersBean); 103 104 public abstract DiscountCodeLocal getDiscountCode(); 105 public abstract void setDiscountCode(DiscountCodeLocal discountCode); 106 107 108 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 { 109 if (customerId == null) { 110 throw new CreateException("The field \"customerId\" must not be null"); 111 } 112 if (zip == null) { 113 throw new CreateException("The field \"zip\" must not be null"); 114 } 115 if (discountCode == null) { 116 throw new CreateException("The field \"discountCode\" must not be null"); 117 } 118 119 setCustomerId(customerId); 121 setZip(zip); 122 setName(name); 123 setAddressline1(addressline1); 124 setAddressline2(addressline2); 125 setCity(city); 126 setState(state); 127 setPhone(phone); 128 setFax(fax); 129 setEmail(email); 130 setCreditLimit(creditLimit); 131 132 return null; 133 } 134 135 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) { 136 setDiscountCode(discountCode); 138 139 } 140 } 141 | Popular Tags |