1 package ent; 2 3 import java.math.BigDecimal ; 4 import java.util.Collection ; 5 import javax.ejb.*; 6 7 12 public abstract class DiscountCodeBean implements EntityBean, DiscountCodeLocalBusiness { 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 String getDiscountCode(); 70 public abstract void setDiscountCode(String discountCode); 71 72 public abstract BigDecimal getRate(); 73 public abstract void setRate(BigDecimal rate); 74 75 public abstract Collection getCustomerBean(); 76 public abstract void setCustomerBean(Collection customerBean); 77 78 79 public String ejbCreate(String discountCode, BigDecimal rate) throws CreateException { 80 if (discountCode == null) { 81 throw new CreateException("The field \"discountCode\" must not be null"); 82 } 83 84 setDiscountCode(discountCode); 86 setRate(rate); 87 88 return null; 89 } 90 91 public void ejbPostCreate(String discountCode, BigDecimal rate) { 92 94 } 95 } 96 | Popular Tags |