KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > my > db > ebeans > DiscountCodeTblBean


1 package my.db.ebeans;
2
3 import javax.ejb.*;
4
5 /**
6  * This is the bean class for the DiscountCodeTbl enterprise bean.
7  * Created Feb 19, 2005 9:21:18 PM
8  * @author mg116726
9  */

10 public abstract class DiscountCodeTblBean implements javax.ejb.EntityBean JavaDoc, my.db.ebeans.DiscountCodeTblLocalBusiness {
11     private javax.ejb.EntityContext JavaDoc context;
12     
13     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
14
// TODO Consider creating Transfer Object to encapsulate data
15
// TODO Review finder methods
16
/**
17      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
18      */

19     public void setEntityContext(javax.ejb.EntityContext JavaDoc aContext) {
20         context = aContext;
21     }
22     
23     /**
24      * @see javax.ejb.EntityBean#ejbActivate()
25      */

26     public void ejbActivate() {
27         
28     }
29     
30     /**
31      * @see javax.ejb.EntityBean#ejbPassivate()
32      */

33     public void ejbPassivate() {
34         
35     }
36     
37     /**
38      * @see javax.ejb.EntityBean#ejbRemove()
39      */

40     public void ejbRemove() {
41         
42     }
43     
44     /**
45      * @see javax.ejb.EntityBean#unsetEntityContext()
46      */

47     public void unsetEntityContext() {
48         context = null;
49     }
50     
51     /**
52      * @see javax.ejb.EntityBean#ejbLoad()
53      */

54     public void ejbLoad() {
55         
56     }
57     
58     /**
59      * @see javax.ejb.EntityBean#ejbStore()
60      */

61     public void ejbStore() {
62         
63     }
64     // </editor-fold>
65

66     // <editor-fold defaultstate="collapsed" desc="CMP fields and relationships. Click on the + sign on the left to edit the code.">
67

68     public abstract java.lang.String JavaDoc getDiscountCode();
69     public abstract void setDiscountCode(java.lang.String JavaDoc discountCode);
70     
71     public abstract java.math.BigDecimal JavaDoc getRate();
72     public abstract void setRate(java.math.BigDecimal JavaDoc rate);
73     
74     public abstract java.util.Collection JavaDoc getCustomerTbl();
75     public abstract void setCustomerTbl(java.util.Collection JavaDoc customerTbl);
76     
77     // </editor-fold>
78

79     public java.lang.String JavaDoc ejbCreate(java.lang.String JavaDoc discountCode, java.math.BigDecimal JavaDoc rate) throws javax.ejb.CreateException JavaDoc {
80         if (discountCode == null) {
81             throw new javax.ejb.CreateException JavaDoc("The field \"discountCode\" must not be null");
82         }
83         
84         // TODO add additional validation code, throw CreateException if data is not valid
85
setDiscountCode(discountCode);
86         setRate(rate);
87         
88         return null;
89     }
90     
91     public void ejbPostCreate(java.lang.String JavaDoc discountCode, java.math.BigDecimal JavaDoc rate) {
92         // TODO populate relationships here if appropriate
93

94     }
95 }
96
Popular Tags