1 package ent; 2 3 import java.math.BigDecimal ; 4 import java.sql.Date ; 5 import javax.ejb.*; 6 7 12 public abstract class OrdersBean implements EntityBean, OrdersLocalBusiness { 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 getOrderNum(); 70 public abstract void setOrderNum(Integer orderNum); 71 72 public abstract Integer getQuantity(); 73 public abstract void setQuantity(Integer quantity); 74 75 public abstract BigDecimal getShippingCost(); 76 public abstract void setShippingCost(BigDecimal shippingCost); 77 78 public abstract Date getSalesDate(); 79 public abstract void setSalesDate(Date salesDate); 80 81 public abstract Date getShippingDate(); 82 public abstract void setShippingDate(Date shippingDate); 83 84 public abstract String getFreightCompany(); 85 public abstract void setFreightCompany(String freightCompany); 86 87 public abstract ent.CustomerLocal getCustomerId(); 88 public abstract void setCustomerId(ent.CustomerLocal customerId); 89 90 public abstract ProductLocal getProductId(); 91 public abstract void setProductId(ProductLocal productId); 92 93 94 public Integer ejbCreate(Integer orderNum, Integer quantity, BigDecimal shippingCost, Date salesDate, Date shippingDate, String freightCompany, ent.CustomerLocal customerId, ProductLocal productId) throws CreateException { 95 if (orderNum == null) { 96 throw new CreateException("The field \"orderNum\" must not be null"); 97 } 98 if (customerId == null) { 99 throw new CreateException("The field \"customerId\" must not be null"); 100 } 101 if (productId == null) { 102 throw new CreateException("The field \"productId\" must not be null"); 103 } 104 105 setOrderNum(orderNum); 107 setQuantity(quantity); 108 setShippingCost(shippingCost); 109 setSalesDate(salesDate); 110 setShippingDate(shippingDate); 111 setFreightCompany(freightCompany); 112 113 return null; 114 } 115 116 public void ejbPostCreate(Integer orderNum, Integer quantity, BigDecimal shippingCost, Date salesDate, Date shippingDate, String freightCompany, ent.CustomerLocal customerId, ProductLocal productId) { 117 setCustomerId(customerId); 119 setProductId(productId); 120 121 } 122 } 123 | Popular Tags |