1 package cmpdb; 2 3 import java.math.BigDecimal ; 4 import java.util.Collection ; 5 import javax.ejb.*; 6 7 12 public abstract class ProductBean implements EntityBean, ProductLocalBusiness { 13 private EntityContext context; 14 15 21 public void setEntityContext(EntityContext aContext) { 22 context = aContext; 23 } 24 25 28 public void ejbActivate() { 29 30 } 31 32 35 public void ejbPassivate() { 36 37 } 38 39 42 public void ejbRemove() { 43 44 } 45 46 49 public void unsetEntityContext() { 50 context = null; 51 } 52 53 56 public void ejbLoad() { 57 58 } 59 60 63 public void ejbStore() { 64 65 } 66 68 69 public abstract Integer getProductId(); 70 public abstract void setProductId(Integer productId); 71 72 public abstract BigDecimal getPurchaseCost(); 73 public abstract void setPurchaseCost(BigDecimal purchaseCost); 74 75 public abstract Integer getQuantityOnHand(); 76 public abstract void setQuantityOnHand(Integer quantityOnHand); 77 78 public abstract BigDecimal getMarkup(); 79 public abstract void setMarkup(BigDecimal markup); 80 81 public abstract String getAvailable(); 82 public abstract void setAvailable(String available); 83 84 public abstract String getDescription(); 85 public abstract void setDescription(String description); 86 87 public abstract cmpdb.ManufactureLocal getManufactureId(); 88 public abstract void setManufactureId(cmpdb.ManufactureLocal manufactureId); 89 90 public abstract cmpdb.ProductCodeLocal getProductCode(); 91 public abstract void setProductCode(cmpdb.ProductCodeLocal productCode); 92 93 public abstract Collection getOrdersBean(); 94 public abstract void setOrdersBean(Collection ordersBean); 95 96 97 public Integer ejbCreate(Integer productId, BigDecimal purchaseCost, Integer quantityOnHand, BigDecimal markup, String available, String description, cmpdb.ManufactureLocal manufactureId, cmpdb.ProductCodeLocal productCode) throws CreateException { 98 if (productId == null) { 99 throw new CreateException("The field \"productId\" must not be null"); 100 } 101 if (manufactureId == null) { 102 throw new CreateException("The field \"manufactureId\" must not be null"); 103 } 104 if (productCode == null) { 105 throw new CreateException("The field \"productCode\" must not be null"); 106 } 107 108 setProductId(productId); 110 setPurchaseCost(purchaseCost); 111 setQuantityOnHand(quantityOnHand); 112 setMarkup(markup); 113 setAvailable(available); 114 setDescription(description); 115 116 return null; 117 } 118 119 public void ejbPostCreate(Integer productId, BigDecimal purchaseCost, Integer quantityOnHand, BigDecimal markup, String available, String description, cmpdb.ManufactureLocal manufactureId, cmpdb.ProductCodeLocal productCode) { 120 setManufactureId(manufactureId); 122 setProductCode(productCode); 123 124 } 125 } 126
| Popular Tags
|