KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > testGenerateBeans_DiscountCodeTblBean


1 package test;
2
3 import java.math.BigDecimal JavaDoc;
4 import java.util.Collection JavaDoc;
5 import javax.ejb.*;
6
7 /**
8  * This is the bean class for the DiscountCodeTblBean enterprise bean.
9  * Created Dec 18, 2005 11:19:15 PM
10  * @author honza
11  */

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

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

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

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

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

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

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

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

68     
69     public abstract String JavaDoc getDiscountCode();
70     public abstract void setDiscountCode(String JavaDoc discountCode);
71     
72     public abstract BigDecimal JavaDoc getRate();
73     public abstract void setRate(BigDecimal JavaDoc rate);
74     
75     public abstract Collection JavaDoc getCustomerTblBean();
76     public abstract void setCustomerTblBean(Collection JavaDoc customerTblBean);
77     
78     
79     public String JavaDoc ejbCreate(String JavaDoc discountCode, BigDecimal JavaDoc rate) throws CreateException {
80         if (discountCode == null) {
81             throw new CreateException("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(String JavaDoc discountCode, BigDecimal JavaDoc rate) {
92         // TODO populate relationships here if appropriate
93

94     }
95 }
96
Popular Tags