KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ent > MicroMarketsBean


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

10 public abstract class MicroMarketsBean implements EntityBean, MicroMarketsLocalBusiness {
11     private EntityContext 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(EntityContext 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     
67     public abstract String JavaDoc getZipCode();
68     public abstract void setZipCode(String JavaDoc zipCode);
69     
70     public abstract Double JavaDoc getRadius();
71     public abstract void setRadius(Double JavaDoc radius);
72     
73     public abstract Double JavaDoc getAreaLength();
74     public abstract void setAreaLength(Double JavaDoc areaLength);
75     
76     public abstract Double JavaDoc getAreaWidth();
77     public abstract void setAreaWidth(Double JavaDoc areaWidth);
78     
79     
80     public String JavaDoc ejbCreate(String JavaDoc zipCode, Double JavaDoc radius, Double JavaDoc areaLength, Double JavaDoc areaWidth) throws CreateException {
81         if (zipCode == null) {
82             throw new CreateException("The field \"zipCode\" must not be null");
83         }
84         
85         // TODO add additional validation code, throw CreateException if data is not valid
86
setZipCode(zipCode);
87         setRadius(radius);
88         setAreaLength(areaLength);
89         setAreaWidth(areaWidth);
90         
91         return null;
92     }
93     
94     public void ejbPostCreate(String JavaDoc zipCode, Double JavaDoc radius, Double JavaDoc areaLength, Double JavaDoc areaWidth) {
95         // TODO populate relationships here if appropriate
96

97     }
98 }
99
Popular Tags