KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ent > ProductCodeBean


1 package ent;
2
3 import java.util.Collection JavaDoc;
4 import javax.ejb.*;
5
6 /**
7  * This is the bean class for the ProductCodeBean enterprise bean.
8  * Created 12.1.2006 17:52:53
9  * @author jungi
10  */

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

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

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

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

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

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

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

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

67     
68     public abstract String JavaDoc getProdCode();
69     public abstract void setProdCode(String JavaDoc prodCode);
70     
71     public abstract String JavaDoc getDiscountCode();
72     public abstract void setDiscountCode(String JavaDoc discountCode);
73     
74     public abstract String JavaDoc getDescription();
75     public abstract void setDescription(String JavaDoc description);
76     
77     public abstract Collection JavaDoc getProductBean();
78     public abstract void setProductBean(Collection JavaDoc productBean);
79     
80     
81     public String JavaDoc ejbCreate(String JavaDoc prodCode, String JavaDoc discountCode, String JavaDoc 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         // TODO add additional validation code, throw CreateException if data is not valid
90
setProdCode(prodCode);
91         setDiscountCode(discountCode);
92         setDescription(description);
93         
94         return null;
95     }
96     
97     public void ejbPostCreate(String JavaDoc prodCode, String JavaDoc discountCode, String JavaDoc description) {
98         // TODO populate relationships here if appropriate
99

100     }
101 }
102
Popular Tags