1 package ent; 2 3 import java.util.Collection ; 4 import javax.ejb.*; 5 6 11 public abstract class ProductCodeBean implements EntityBean, ProductCodeLocalBusiness { 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 String getProdCode(); 69 public abstract void setProdCode(String prodCode); 70 71 public abstract String getDiscountCode(); 72 public abstract void setDiscountCode(String discountCode); 73 74 public abstract String getDescription(); 75 public abstract void setDescription(String description); 76 77 public abstract Collection getProductBean(); 78 public abstract void setProductBean(Collection productBean); 79 80 81 public String ejbCreate(String prodCode, String discountCode, String description) throws CreateException { 82 if (prodCode == null) { 83 throw new CreateException("The field \"prodCode\" must not be null"); 84 } 85 if (discountCode == null) { 86 throw new CreateException("The field \"discountCode\" must not be null"); 87 } 88 89 setProdCode(prodCode); 91 setDiscountCode(discountCode); 92 setDescription(description); 93 94 return null; 95 } 96 97 public void ejbPostCreate(String prodCode, String discountCode, String description) { 98 100 } 101 } 102 | Popular Tags |