KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > entity > BnAgentEdgeBean


1 package hero.entity;
2
3 import hero.interfaces.BnAgentEdgePK;
4 import hero.interfaces.BnAgentEdgeValue;
5 import hero.interfaces.BnAgentLocal;
6 import hero.interfaces.BnNodeLocal;
7 import hero.interfaces.BnProjectLocal;
8 import hero.interfaces.InvalidValueException;
9 import hero.util.BonitaServiceLocator;
10 import hero.util.BonitaServiceException;
11
12 import java.util.Date JavaDoc;
13
14 import javax.ejb.CreateException JavaDoc;
15 import javax.ejb.EJBException JavaDoc;
16 import javax.ejb.EntityBean JavaDoc;
17 import javax.ejb.EntityContext JavaDoc;
18 import javax.ejb.RemoveException JavaDoc;
19
20 /**
21  * The Entity bean represents a BnAgentEdge
22  *
23  * @author Miguel Valdes
24  * @version $Revision: 1.3 $
25  *
26  * @ejb:bean name="BnAgentEdge"
27  * display-name="BnAgentEdge Entity"
28  * type="CMP"
29  * jndi-name="ejb/hero/BnAgentEdge"
30  * local-jndi-name="ejb/hero/BnAgentEdge_L"
31  * view-type="both"
32  * cmp-version="2.x"
33  * reentrant="true"
34  *
35  * @ejb:transaction type="Supports"
36  *
37  * @jonas.bean
38  * ejb-name="BnAgentEdge"
39  * jndi-name="ejb/hero/BnAgentEdge"
40  * lock-policy="container-read-committed"
41  * @jonas.jdbc-mapping
42  * jndi-name="bonita"
43  * jdbc-table-name="BnAgentEdge"
44  *
45  * @jonas.shared false
46  *
47  * @ejb:finder signature="java.util.Collection findAll()"
48  * query="SELECT object(a) FROM BnAgentEdge a"
49  * transaction-type="Supports"
50  *
51  * @ejb:finder signature="hero.interfaces.BnAgentEdge findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Remote"
52  * query="SELECT OBJECT(a) FROM BnAgentEdge a WHERE a.name = ?1 AND a.bnProject.id = ?2"
53  * transaction-type="Supports"
54  * @ejb:finder signature="hero.interfaces.BnAgentEdgeLocal findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Local"
55  * query="SELECT OBJECT(a) FROM BnAgentEdge a WHERE a.name = ?1 AND a.bnProject.id = ?2"
56  * transaction-type="Supports"
57  * @ejb.value-object
58  * match="*"
59  * name="BnAgentEdge"
60  *
61  * @jboss:table-name table-name="BnAgentEdge"
62  *
63  * @jboss:create-table create="true"
64  *
65  * @jboss:remove-table remove="false"
66  **/

67
68 public abstract class BnAgentEdgeBean
69    implements EntityBean JavaDoc
70 {
71    
72    // -------------------------------------------------------------------------
73
// Members
74
// -------------------------------------------------------------------------
75

76    public EntityContext JavaDoc mContext;
77      
78    // -------------------------------------------------------------------------
79
// Properties (Getters/Setters)
80
// -------------------------------------------------------------------------
81

82    /**
83    * Retrieve the BnAgentEdge's id.
84    *
85    * @return Returns an int representing the id of this BnAgentEdge.
86    *
87    * @ejb:pk-field
88    *
89    * @ejb:persistence column-name="id"
90    * @jonas.cmp-field-jdbc-mapping
91    * field-name="id"
92    * jdbc-field-name="id"
93    * @ejb:transaction type="Supports"
94    **/

95    public abstract String JavaDoc getId();
96    
97    /**
98    * Set the BnAgentEdge's id.
99    *
100    * @param pId The id of this BnAgentEdge. Is set at creation time.
101    * @ejb:transaction type="Required"
102   **/

103    public abstract void setId( String JavaDoc pId );
104    
105    /**
106    * Retrieve the BnAgentEdge's name.
107    *
108    * @return Returns a string representing the name of this BnAgentEdge.
109    *
110    * @ejb:interface-method view-type="both"
111    *
112    * @ejb:persistence column-name="name"
113    * @ejb:transaction type="Supports"
114    **/

115    public abstract String JavaDoc getName();
116    
117    /**
118    * Set the BnAgentEdge's name.
119    *
120    * @param pName The name of this BnAgentEdge. Is set at creation time.
121    * @ejb:transaction type="Required"
122   **/

123    public abstract void setName( String JavaDoc pName );
124
125     /**
126      * @return the project of the BnAgentEdge
127      * @ejb:interface-method view-type="local"
128      * @ejb:relation name="AgentEdges" role-name="is-edge-of" target-ejb="BnProject"
129      * @jboss:auto-key-fields
130      * @jonas:automatic-pk="true"
131      * @ejb:transaction type="Supports"
132      *
133      **/

134     public abstract BnProjectLocal getBnProject();
135     
136     /**
137      * Set the BnProject Name.
138      *
139      * @param pName The Name of this BnAgentEdge. Is set at creation time.
140      * @ejb:interface-method view-type="local"
141      * @ejb:transaction type="Required"
142      **/

143     public abstract void setBnProject(BnProjectLocal pProject);
144     
145     /**
146      * @return the state of the BnAgentEdge
147      * @ejb:interface-method view-type="local"
148      * @ejb:persistence column-name="state"
149      * @ejb:transaction type="Supports"
150      *
151      **/

152     public abstract int getState();
153     
154     /**
155      * Set the State value.
156      *
157      * @param pstate The new state of this BnAgentEdge.
158      * @ejb:interface-method view-type="local"
159      * @ejb:transaction type="Required"
160      **/

161     public abstract void setState(int state);
162
163     /**
164      * @return the In BnAgent of the BnAgentEdge
165      * @ejb:interface-method view-type="local"
166      * @ejb:relation name="InAgent" role-name="has-node-in" target-ejb="BnAgent"
167      * @ejb:value-object match="*"
168      * relation="external"
169      * aggregate="hero.interfaces.BnAgentLightValue"
170      * aggregate-name="InAgent"
171      * @jboss:auto-key-fields
172      * @jonas:automatic-pk="true"
173      * @ejb:transaction type="Supports"
174      **/

175     public abstract BnAgentLocal getInBnAgent();
176     
177    /**
178    * Set the BnProject Name.
179    *
180    * @param pAgent The In BnAgent of the BnAgentEdge
181    * @ejb:interface-method view-type="local"
182    * @ejb:transaction type="Required"
183    **/

184     public abstract void setInBnAgent(BnAgentLocal pAgent);
185
186     /**
187      * @return the Out BnNode of the BnEdge
188      * @ejb:interface-method view-type="local"
189      * @ejb:relation name="OutNodeInAgentEdge" role-name="has-node-out" target-ejb="BnNode"
190      * @ejb:value-object match="*"
191      * relation="external"
192      * aggregate="hero.interfaces.BnNodeLightValue"
193      * aggregate-name="OutNodeInAgentEdge"
194      * @jboss:auto-key-fields
195      * @jonas:automatic-pk="true"
196      * @ejb:transaction type="Supports"
197      *
198      **/

199     public abstract BnNodeLocal getOutBnNode();
200
201    /**
202    * Set the BnProject Name.
203    *
204    * @param pNode The Name of this BnEdge. Is set at creation time.
205    * @ejb:interface-method view-type="local"
206    * @ejb:transaction type="Required"
207    **/

208     public abstract void setOutBnNode(BnNodeLocal pNode);
209
210     /**
211      * @return Return the creation date of the BnAgentEdge
212      * @ejb:interface-method view-type="both"
213      * @ejb:persistence column-name="creationdate"
214      * @ejb:transaction type="Supports"
215      *
216      **/

217
218     public abstract Date JavaDoc getCreationDate();
219
220     /**
221      * @param pDate the creation date of the BnAgentEdge
222      * @ejb:interface-method view-type="both"
223      * @ejb:transaction type="Required"
224      *
225      **/

226     public abstract void setCreationDate(Date JavaDoc pDate);
227
228     /**
229      * @ejb.interface-method
230      * @ejb:transaction type="Supports"
231      */

232     public abstract BnAgentEdgeValue getBnAgentEdgeValue();
233     
234     /**
235      * @ejb.interface-method
236      * @ejb:transaction type="Required"
237      */

238     public abstract void setBnAgentEdgeValue(BnAgentEdgeValue v);
239     
240    
241    // -------------------------------------------------------------------------
242
// Framework Callbacks
243
// -------------------------------------------------------------------------
244

245    /**
246    * Create a BnAgentEdge based on the supplied BnAgentEdge Value Object.
247    *
248    *
249    * @throws InvalidValueException If one of the values are not correct,
250    * this will not roll back the transaction
251    * because the caller has the chance to
252    * fix the problem and try again
253    * @throws EJBException If no new unique ID could be retrieved this will
254    * rollback the transaction because there is no
255    * hope to try again
256    * @throws CreateException Because we have to do so (EJB spec.)
257    *
258    * @ejb:create-method view-type="both"
259    **/

260    public BnAgentEdgePK ejbCreate()
261       throws
262          InvalidValueException,
263          EJBException JavaDoc,
264          CreateException JavaDoc
265    {
266      this.setName("BnAgentEdge"+this.getId());
267      this.setId(hero.interfaces.BnAgentEdgeUtil.generateGUID(this));
268      return null;
269    }
270
271    /**
272    * Create a BnAgentEdge based on the supplied BnAgentEdge Value Object. (c'est merdique)
273    *
274    *
275    * @throws InvalidValueException If one of the values are not correct,
276    * this will not roll back the transaction
277    * because the caller has the chance to
278    * fix the problem and try again
279    * @throws EJBException If no new unique ID could be retrieved this will
280    * rollback the transaction because there is no
281    * hope to try again
282    * @throws CreateException Because we have to do so (EJB spec.)
283    *
284    * @ejb:create-method view-type="both"
285    **/

286    public BnAgentEdgePK ejbCreate(BnAgentEdgeValue pAgentEdge)
287       throws
288          CreateException JavaDoc
289    {
290        this.setBnAgentEdgeValue(pAgentEdge);
291        return null;
292    }
293
294    
295    public void ejbPostCreate( )
296    {
297    }
298    
299    public void setEntityContext( EntityContext JavaDoc lContext )
300    {
301       mContext = lContext;
302    }
303    
304    public void unsetEntityContext()
305    {
306       mContext = null;
307    }
308    
309    public void ejbActivate()
310    {
311    }
312    
313    public void ejbPassivate()
314    {
315    }
316    
317    public void ejbLoad()
318    {
319    }
320    
321    public void ejbStore()
322    {
323    }
324    
325    public void ejbRemove()
326       throws
327          RemoveException JavaDoc
328    {
329    }
330
331 }
332
Popular Tags