1 27 28 package dataregistry; 29 import java.math.BigDecimal ; 30 import java.util.logging.Level ; 31 import java.util.logging.Logger ; 32 import javax.ejb.*; 33 34 37 public abstract class LineItemBean implements EntityBean, LineItemLocalBusiness { 38 private EntityContext context; 39 40 46 public void setEntityContext(EntityContext aContext) { 47 context = aContext; 48 } 49 50 53 public void ejbActivate() { 54 55 } 56 57 60 public void ejbPassivate() { 61 62 } 63 64 67 public void ejbRemove() { 68 69 } 70 71 74 public void unsetEntityContext() { 75 context = null; 76 } 77 78 81 public void ejbLoad() { 82 83 } 84 85 88 public void ejbStore() { 89 90 } 91 93 94 public abstract Integer getOrderId(); 95 public abstract void setOrderId(Integer orderId); 96 97 public abstract BigDecimal getItemId(); 98 public abstract void setItemId(BigDecimal itemId); 99 100 public abstract BigDecimal getQuantity(); 101 public abstract void setQuantity(BigDecimal quantity); 102 103 public abstract VendorPartLocal getVendorPartNumber(); 104 public abstract void setVendorPartNumber(VendorPartLocal vendorPartNumber); 105 106 107 public LineItemPK ejbCreate(Integer orderId, BigDecimal itemId, 108 BigDecimal quantity, OrderLocal ordersBean, 109 VendorPartLocal vendorPartNumber) throws CreateException { 110 if (orderId == null) { 111 throw new CreateException("The field \"orderId\" must not be null"); 112 } 113 if (itemId == null) { 114 throw new CreateException("The field \"itemId\" must not be null"); 115 } 116 if (quantity == null) { 117 throw new CreateException("The field \"quantity\" must not be null"); 118 } 119 if (ordersBean == null) { 120 throw new CreateException("The field \"ordersBean\" must not be null"); 121 } 122 if (vendorPartNumber == null) { 123 throw new CreateException("The field \"vendorPartNumber\" must not be null"); 124 } 125 126 setOrderId(orderId); 128 setItemId(itemId); 129 setQuantity(quantity); 130 131 return null; 132 } 133 134 public void ejbPostCreate(Integer orderId, BigDecimal itemId, BigDecimal quantity, OrderLocal ordersBean, VendorPartLocal vendorPartNumber) { 135 setOrderBean(ordersBean); 137 setVendorPartNumber(vendorPartNumber); 138 139 } 140 141 public LineItemPK ejbCreate(OrderLocal ordersBean, BigDecimal quantity, VendorPartLocal vendorPartNumber) throws CreateException { 142 if (quantity == null) { 144 throw new CreateException("The field \"quantity\" must not be null"); 145 } 146 if (ordersBean == null) { 147 throw new CreateException("The field \"ordersBean\" must not be null"); 148 } 149 if (vendorPartNumber == null) { 150 throw new CreateException("The field \"vendorPartNumber\" must not be null"); 151 } 152 setOrderId(ordersBean.getOrderId()); 153 setItemId(new BigDecimal (ordersBean.getNexId())); 154 setQuantity(quantity); 155 156 return null; 157 } 158 159 public void ejbPostCreate(OrderLocal ordersBean, BigDecimal quantity, VendorPartLocal vendorPartNumber) throws CreateException { 160 setOrderBean(ordersBean); 162 setVendorPartNumber(vendorPartNumber); 163 } 164 165 public abstract dataregistry.OrderLocal getOrderBean(); 166 167 public abstract void setOrderBean(dataregistry.OrderLocal orderBean); 168 169 } 170 | Popular Tags |