1 27 28 package dataregistry; 29 30 import java.util.Collection ; 31 import javax.ejb.*; 32 33 36 public abstract class VendorBean implements EntityBean, VendorLocalBusiness { 37 private EntityContext context; 38 39 45 public void setEntityContext(EntityContext aContext) { 46 context = aContext; 47 } 48 49 52 public void ejbActivate() { 53 54 } 55 56 59 public void ejbPassivate() { 60 61 } 62 63 66 public void ejbRemove() { 67 68 } 69 70 73 public void unsetEntityContext() { 74 context = null; 75 } 76 77 80 public void ejbLoad() { 81 82 } 83 84 87 public void ejbStore() { 88 89 } 90 92 93 public abstract int getVendorId(); 94 public abstract void setVendorId(int vendorId); 95 96 public abstract String getName(); 97 public abstract void setName(String name); 98 99 public abstract String getAddress(); 100 public abstract void setAddress(String address); 101 102 public abstract String getContact(); 103 public abstract void setContact(String contact); 104 105 public abstract String getPhone(); 106 public abstract void setPhone(String phone); 107 108 public abstract Collection getVendorPartBean(); 109 public abstract void setVendorPartBean(Collection vendorPartBean); 110 111 112 public VendorKey ejbCreate(int vendorId, String name, String address, String contact, String phone) throws CreateException { 113 if (name == null) { 114 throw new CreateException("The field \"name\" must not be null"); 115 } 116 if (address == null) { 117 throw new CreateException("The field \"address\" must not be null"); 118 } 119 if (contact == null) { 120 throw new CreateException("The field \"contact\" must not be null"); 121 } 122 if (phone == null) { 123 throw new CreateException("The field \"phone\" must not be null"); 124 } 125 126 setVendorId(vendorId); 128 setName(name); 129 setAddress(address); 130 setContact(contact); 131 setPhone(phone); 132 133 return null; 134 } 135 136 public void ejbPostCreate(int vendorId, String name, String address, String contact, String phone) { 137 139 } 140 } 141
| Popular Tags
|