KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > AccountCMP


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

4 package test.ejb;
5
6 /**
7  * CMP layer for Account.
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 AccountCMP
14    extends test.ejb.AccountBean
15    implements javax.ejb.EntityBean JavaDoc
16 {
17
18    public test.interfaces.AccountData getData()
19    {
20       test.interfaces.AccountData dataHolder = null;
21       try
22       {
23          dataHolder = new test.interfaces.AccountData();
24
25          dataHolder.setId( getId() );
26          dataHolder.setOwner( getOwner() );
27          dataHolder.setBalance( getBalance() );
28          dataHolder.setLastModificationDate( getLastModificationDate() );
29          dataHolder.setAccountId( getAccountId() );
30          dataHolder.setCreationDate( getCreationDate() );
31
32       }
33       catch (RuntimeException JavaDoc e)
34       {
35          throw new javax.ejb.EJBException JavaDoc(e);
36       }
37
38       return dataHolder;
39    }
40
41    public void setData( test.interfaces.AccountData dataHolder )
42    {
43       try
44       {
45          setOwner( dataHolder.getOwner() );
46          setBalance( dataHolder.getBalance() );
47          setLastModificationDate( dataHolder.getLastModificationDate() );
48          setCreationDate( dataHolder.getCreationDate() );
49
50       }
51       catch (Exception JavaDoc e)
52       {
53          throw new javax.ejb.EJBException JavaDoc(e);
54       }
55    }
56
57    public void ejbLoad() throws javax.ejb.EJBException JavaDoc
58    {
59       super.ejbLoad();
60    }
61
62    public void ejbStore() throws javax.ejb.EJBException JavaDoc
63    {
64          super.ejbStore();
65    }
66
67    public void ejbActivate() throws javax.ejb.EJBException JavaDoc
68    {
69       super.ejbActivate();
70    }
71
72    public void ejbPassivate() throws javax.ejb.EJBException JavaDoc
73    {
74       super.ejbPassivate();
75
76       AccountValue = null;
77    }
78
79    public void setEntityContext(javax.ejb.EntityContext JavaDoc ctx) throws javax.ejb.EJBException JavaDoc
80    {
81       super.setEntityContext(ctx);
82    }
83
84    public void unsetEntityContext() throws javax.ejb.EJBException JavaDoc
85    {
86       super.unsetEntityContext();
87    }
88
89    public void ejbRemove() throws javax.ejb.EJBException JavaDoc, javax.ejb.RemoveException JavaDoc
90    {
91       super.ejbRemove();
92
93    }
94
95  /* Value Objects BEGIN */
96
97    private test.interfaces.AccountValue AccountValue = null;
98
99    public test.interfaces.AccountValue getAccountValue()
100    {
101       AccountValue = new test.interfaces.AccountValue();
102       try
103          {
104             AccountValue.setId( getId() );
105             AccountValue.setBalance( getBalance() );
106             if ( getOwner() != null )
107                AccountValue.setOwnerNormalValue( getOwner().getCustomerNormalValue() );
108
109          }
110          catch (Exception JavaDoc e)
111          {
112             throw new javax.ejb.EJBException JavaDoc(e);
113          }
114
115       return AccountValue;
116    }
117
118    public void setAccountValue( test.interfaces.AccountValue valueHolder )
119    {
120
121       try
122       {
123          setBalance( valueHolder.getBalance() );
124
125       {
126        // Checks for null aggregate
127
if (valueHolder.getOwnerNormalValue() != null)
128        {
129          test.interfaces.CustomerPK pk = new test.interfaces.CustomerPK(valueHolder.getOwnerNormalValue().getId());
130
131          test.interfaces.CustomerHome home = test.interfaces.CustomerUtil.getHome();
132
133          test.interfaces.Customer relation = home.findByPrimaryKey(pk);
134          setOwner(relation);
135         } else {
136          setOwner(null);
137         }
138       }
139       }
140       catch (Exception JavaDoc e)
141       {
142          throw new javax.ejb.EJBException JavaDoc(e);
143       }
144    }
145
146 /* Value Objects END */
147
148    public abstract java.lang.Integer JavaDoc getId() ;
149
150    public abstract void setId( java.lang.Integer JavaDoc id ) ;
151
152    public abstract test.interfaces.Customer getOwner() ;
153
154    public abstract void setOwner( test.interfaces.Customer owner ) ;
155
156    public abstract float getBalance() ;
157
158    public abstract void setBalance( float balance ) ;
159
160    public abstract java.util.Date JavaDoc getLastModificationDate() ;
161
162    public abstract void setLastModificationDate( java.util.Date JavaDoc lastModificationDate ) ;
163
164    public abstract java.lang.String JavaDoc getAccountId() ;
165
166    public abstract void setAccountId( java.lang.String JavaDoc accountId ) ;
167
168    public abstract java.util.Date JavaDoc getCreationDate() ;
169
170    public abstract void setCreationDate( java.util.Date JavaDoc creationDate ) ;
171
172 }
173
Popular Tags