KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > cmr > EmployeeCMP


1 /*
2  * Generated by XDoclet - Do not edit!
3  */

4 package test.ejb.cmr;
5
6 /**
7  * CMP layer for Employee.
8  * @xdoclet-generated at 16-04-05
9  * @copyright The XDoclet Team
10  * @author XDoclet
11  * @version 1.2.3
12  */

13 public abstract class EmployeeCMP
14    extends test.ejb.cmr.EmployeeBean
15    implements javax.ejb.EntityBean JavaDoc
16 {
17
18    public test.ejb.cmr.EmployeeData getData()
19    {
20       test.ejb.cmr.EmployeeData dataHolder = null;
21       try
22       {
23          dataHolder = new test.ejb.cmr.EmployeeData();
24
25          dataHolder.setId( getId() );
26          dataHolder.setName( getName() );
27
28       }
29       catch (RuntimeException JavaDoc e)
30       {
31          throw new javax.ejb.EJBException JavaDoc(e);
32       }
33
34       return dataHolder;
35    }
36
37    /**
38     * Generated ejbPostCreate for corresponding ejbCreate method.
39     *
40     * @see #ejbCreate(test.ejb.cmr.EmployeeValue ev)
41     */

42    public void ejbPostCreate(test.ejb.cmr.EmployeeValue ev)
43    {
44    }
45
46    public void ejbLoad()
47    {
48    }
49
50    public void ejbStore()
51    {
52    }
53
54    public void ejbActivate()
55    {
56    }
57
58    public void ejbPassivate()
59    {
60
61       EmployeeValue = null;
62    }
63
64    public void setEntityContext(javax.ejb.EntityContext JavaDoc ctx)
65    {
66    }
67
68    public void unsetEntityContext()
69    {
70    }
71
72    public void ejbRemove() throws javax.ejb.RemoveException JavaDoc
73    {
74
75    }
76
77  /* Value Objects BEGIN */
78
79    private test.ejb.cmr.EmployeeValue EmployeeValue = null;
80
81    public test.ejb.cmr.EmployeeValue getEmployeeValue()
82    {
83       EmployeeValue = new test.ejb.cmr.EmployeeValue();
84       try
85          {
86             EmployeeValue.setId( getId() );
87             EmployeeValue.setName( getName() );
88             if ( getHomeAddress() != null )
89                EmployeeValue.setHomeAddress( getHomeAddress().getEmployeeAddressValue() );
90             if ( getWorkAddress() != null )
91                EmployeeValue.setWorkAddress( getWorkAddress().getEmployeeAddressValue() );
92
93          }
94          catch (Exception JavaDoc e)
95          {
96             throw new javax.ejb.EJBException JavaDoc(e);
97          }
98
99       return EmployeeValue;
100    }
101
102    public void setEmployeeValue( test.ejb.cmr.EmployeeValue valueHolder )
103    {
104
105       try
106       {
107          setName( valueHolder.getName() );
108
109       {
110        // Checks for null aggregate
111
if (valueHolder.getHomeAddress() != null)
112        {
113          java.lang.Integer JavaDoc pk = valueHolder.getHomeAddress().getId();
114
115          test.ejb.cmr.EmployeeAddressLocalHome home = test.ejb.cmr.EmployeeAddressUtil.getLocalHome();
116
117          test.ejb.cmr.EmployeeAddressLocal relation = home.findByPrimaryKey(pk);
118          setHomeAddress(relation);
119         } else {
120          setHomeAddress(null);
121         }
122       }
123       {
124        // Checks for null aggregate
125
if (valueHolder.getWorkAddress() != null)
126        {
127          java.lang.Integer JavaDoc pk = valueHolder.getWorkAddress().getId();
128
129          test.ejb.cmr.EmployeeAddressLocalHome home = test.ejb.cmr.EmployeeAddressUtil.getLocalHome();
130
131          test.ejb.cmr.EmployeeAddressLocal relation = home.findByPrimaryKey(pk);
132          setWorkAddress(relation);
133         } else {
134          setWorkAddress(null);
135         }
136       }
137       }
138       catch (Exception JavaDoc e)
139       {
140          throw new javax.ejb.EJBException JavaDoc(e);
141       }
142    }
143
144 /* Value Objects END */
145
146    public abstract java.lang.Integer JavaDoc getId() ;
147
148    public abstract void setId( java.lang.Integer JavaDoc id ) ;
149
150    public abstract java.lang.String JavaDoc getName() ;
151
152    public abstract void setName( java.lang.String JavaDoc name ) ;
153
154 }
155
Popular Tags