KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > entity > BnProjectConfigBean


1 package hero.entity;
2
3 import hero.interfaces.BnProjectConfigLocal;
4 import hero.interfaces.BnProjectConfigPK;
5 import hero.interfaces.BnProjectConfigValue;
6 import hero.interfaces.BnProjectLocal;
7 import hero.interfaces.InvalidValueException;
8 import hero.interfaces.Constants;
9
10 import hero.util.BonitaServiceLocator;
11 import hero.util.BonitaServiceException;
12 import hero.util.values.BonitaConfigValue;
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 BnProjectConfig
22  *
23  * @author Miguel Valdes Faura
24  * @version $Revision: 1.6 $
25  *
26  * @ejb:bean name="BnProjectConfig"
27  * display-name="BnProjectConfig Entity"
28  * type="CMP"
29  * jndi-name="ejb/hero/BnProjectConfig"
30  * local-jndi-name="ejb/hero/BnProjectConfig_L"
31  * view-type="both"
32  * cmp-version="2.x"
33  * reentrant="true"
34  *
35  *
36  * @ejb:transaction type="Supports"
37  *
38  * @jonas.bean
39  * ejb-name="BnProjectConfig"
40  * jndi-name="ejb/hero/BnProjectConfig"
41  * lock-policy="container-read-committed"
42  * @jonas.jdbc-mapping
43  * jndi-name="bonita"
44  * jdbc-table-name="BnProjectConfig"
45  *
46  * @jonas.shared false
47  *
48  * @ejb:finder signature="java.util.Collection findAll()"
49  * query="SELECT object(a) FROM BnProjectConfig a"
50  * transaction-type="Supports"
51  *
52  * @ejb.value-object
53  * match="*"
54  * name="BnProjectConfig"
55  *
56  * @jboss:table-name table-name="BnProjectConfig"
57  *
58  * @jboss:create-table create="true"
59  *
60  * @jboss:remove-table remove="false"
61  *
62  **/

63 public abstract class BnProjectConfigBean
64    implements EntityBean JavaDoc
65 {
66    
67    // -------------------------------------------------------------------------
68
// Members
69
// -------------------------------------------------------------------------
70

71    public EntityContext JavaDoc mContext;
72    
73    
74    // -------------------------------------------------------------------------
75
// Properties (Getters/Setters)
76
// -------------------------------------------------------------------------
77

78    /**
79    * Retrieve the BnProjectConfig's id.
80    *
81    * @return Returns an int representing the id of this BnProjectConfig.
82    * @ejb:pk-field
83    *
84    * @ejb:persistence column-name="id"
85    * @jonas.cmp-field-jdbc-mapping
86    * field-name="id"
87    * jdbc-field-name="id"
88    * @ejb:transaction type="Supports"
89    **/

90    public abstract String JavaDoc getId();
91    
92    /**
93    * Set the BnProjectConfig's id.
94    *
95    * @param pId The id of this BnProjectConfig. Is set at creation time.
96    * @ejb:transaction type="Required"
97   **/

98    public abstract void setId( String JavaDoc pId );
99    
100    /**
101    * Retrieve the BnProjectConfig's jms attribute.
102    *
103    * @return Returns a boolean representing the jms attribute of this BnProjectConfig.
104    * @ejb:interface-method view-type="both"
105    *
106    * @ejb:persistence column-name="jms"
107    * @ejb:transaction type="Supports"
108    **/

109    public abstract boolean getJMS();
110    
111    /**
112    * Set the BnProjectConfig's jms attribute.
113    *
114    * @param jms The jms attribute of this BnProjectConfig. Is set at creation time.
115    * @ejb:interface-method view-type="local"
116    * @ejb:transaction type="Required"
117   **/

118    public abstract void setJMS( boolean jms);
119    
120    /**
121     * Retrieve the BnProjectConfig's log attribute.
122     *
123     * @return Returns a boolean representing the log attribute of this BnProjectConfig.
124     * @ejb:interface-method view-type="both"
125     *
126     * @ejb:persistence column-name="log"
127     * @ejb:transaction type="Supports"
128     **/

129     public abstract boolean getLog();
130     
131     /**
132     * Set the BnProjectConfig's log attribute.
133     *
134     * @param log The log attribute of this BnProjectConfig. Is set at creation time.
135     * @ejb:interface-method view-type="local"
136     * @ejb:transaction type="Required"
137    **/

138     public abstract void setLog( boolean log);
139     
140     /**
141      * Retrieve the BnProjectConfig's LogLevel attribute.
142      *
143      * @return Returns a string representing the LogLevel attribute of this BnProjectConfig.
144      * @ejb:interface-method view-type="both"
145      *
146      * @ejb:persistence column-name="loglevel"
147      * @ejb:transaction type="Supports"
148      **/

149      public abstract String JavaDoc getLogLevel();
150      
151      /**
152      * Set the BnProjectConfig's logLevel attribute for the BnProjectConfig (Debug/Info/Error).
153      *
154      * @param historic The LogLevel attribute of this BnProjectConfig. Is set at creation time.
155      * @ejb:interface-method view-type="local"
156      * @ejb:transaction type="Required"
157     **/

158      public abstract void setLogLevel( String JavaDoc traceLevel);
159     
160     /**
161      * Retrieve the BnProjectConfig's trace.
162      *
163      * @return Returns a boolean representing the trace attribute of this BnProjectConfig.
164      * @ejb:interface-method view-type="both"
165      *
166      * @ejb:persistence column-name="trace"
167      * @ejb:transaction type="Supports"
168      **/

169      public abstract boolean getTrace();
170      
171      /**
172      * Set the BnProjectConfig's trace attribute.
173      *
174      * @param trace The trace attribute of this BnProjectConfig. Is set at creation time.
175      * @ejb:interface-method view-type="local"
176      * @ejb:transaction type="Required"
177     **/

178      public abstract void setTrace( boolean trace);
179      
180      /**
181       * Retrieve the BnProjectConfig's TraceLevel attribute.
182       *
183       * @return Returns a string representing the TraceLevel attribute of this BnProjectConfig.
184       * @ejb:interface-method view-type="both"
185       *
186       * @ejb:persistence column-name="tracelevel"
187       * @ejb:transaction type="Supports"
188       **/

189       public abstract String JavaDoc getTraceLevel();
190       
191       /**
192       * Set the BnProjectConfig's traceLevel attribute for the BnProjectConfig (Debug/Info/Error).
193       *
194       * @ejb:interface-method view-type="local"
195       * @param historic The TraceLevel attribute of this BnProjectConfig. Is set at creation time.
196       * @ejb:transaction type="Required"
197      **/

198       public abstract void setTraceLevel( String JavaDoc traceLevel);
199     
200      /**
201       * Retrieve the BnProjectConfig's historic attribute.
202       *
203       * @return Returns a string representing the historic attribute of this BnProjectConfig.
204       * @ejb:interface-method view-type="both"
205       *
206       * @ejb:persistence column-name="historic"
207       * @ejb:transaction type="Supports"
208       **/

209       public abstract String JavaDoc getHistoric();
210       
211       /**
212       * Set the BnProjectConfig's historic attribute for the BnProjectConfig (Purge/Transfer).
213       *
214       * @param historic The historic attribute of this BnProjectConfig. Is set at creation time.
215       * @ejb:interface-method view-type="local"
216       * @ejb:transaction type="Required"
217      **/

218       public abstract void setHistoric( String JavaDoc historic);
219      
220     /** Retrieve the project.
221     *
222     * @return Returns a BnProjectLocal.
223     * @ejb:interface-method view-type="both"
224     * @ejb:relation name="project-config" role-name=project2config" cascade-delete="yes"
225     * @jboss:auto-key-fields
226     * @jonas:automatic-pk="true"
227     * @ejb:transaction type="Supports"
228     **/

229     public abstract BnProjectLocal getBnProject();
230     
231     /**
232      * Set the BnProject Name.
233      *
234      * @param pName The Name of this BnProjectConfig. Is set at creation time.
235      * @ejb:interface-method view-type="local"
236      * @ejb:transaction type="Required"
237      **/

238     public abstract void setBnProject(BnProjectLocal pProject);
239      
240     /**
241       * @ejb.interface-method
242       * @ejb:transaction type="Supports"
243       */

244      public abstract BnProjectConfigValue getBnProjectConfigValue();
245     
246      /**
247       * @ejb.interface-method
248       * @ejb:transaction type="Required"
249       */

250      public abstract void setBnProjectConfigValue(BnProjectConfigValue v);
251    
252    // -------------------------------------------------------------------------
253
// Framework Callbacks
254
// -------------------------------------------------------------------------
255

256    /**
257    * Create a BnProjectConfig based on the supplied BnProjectConfig Value Object.
258    *
259    *
260    * @throws InvalidValueException If one of the values are not correct,
261    * this will not roll back the transaction
262    * because the caller has the chance to
263    * fix the problem and try again
264    * @throws EJBException If no new unique ID could be retrieved this will
265    * rollback the transaction because there is no
266    * hope to try again
267    * @throws CreateException Because we have to do so (EJB spec.)
268    *
269    * @ejb:create-method view-type="both"
270    **/

271    public BnProjectConfigPK ejbCreate(BonitaConfigValue project, String JavaDoc instance) throws InvalidValueException, EJBException JavaDoc, CreateException JavaDoc
272    {
273     if (instance.matches(".*_instance.*"))
274     {
275         this.setJMS(project.getJms());
276         this.setLog(project.getLog());
277         this.setTrace(project.getTrace());
278         this.setHistoric(project.getHistoric());
279         this.setLogLevel(project.getLogLevel());
280         this.setTraceLevel(project.getTraceLevel());
281         this.setId(hero.interfaces.BnProjectConfigUtil.generateGUID(this));
282     }
283     else
284     {
285         this.setJMS(true);
286         this.setLog(true);
287         this.setTrace(true);
288         this.setHistoric(Constants.TRANSFER);
289         this.setLogLevel(Constants.DEBUG);
290         this.setTraceLevel(Constants.DEBUG);
291         this.setId(hero.interfaces.BnProjectConfigUtil.generateGUID(this));
292     }
293             
294       return null;
295    }
296
297    
298    /**
299    * Create a BnProjectConfig based on the supplied BnProjectConfig Value Object.
300    *
301    *
302    * @throws InvalidValueException If one of the values are not correct,
303    * this will not roll back the transaction
304    * because the caller has the chance to
305    * fix the problem and try again
306    * @throws EJBException If no new unique ID could be retrieved this will
307    * rollback the transaction because there is no
308    * hope to try again
309    * @throws CreateException Because we have to do so (EJB spec.)
310    *
311    * @ejb:create-method view-type="both"
312    **/

313    public BnProjectConfigPK ejbCreate() throws InvalidValueException, EJBException JavaDoc, CreateException JavaDoc
314    {
315         this.setJMS(true);
316         this.setLog(true);
317         this.setTrace(true);
318         this.setHistoric(Constants.TRANSFER);
319         this.setLogLevel(Constants.DEBUG);
320         this.setTraceLevel(Constants.DEBUG);
321         this.setId(hero.interfaces.BnProjectConfigUtil.generateGUID(this));
322       return null;
323    }
324    
325    /**
326    * Create a BnProjectConfig based on the supplied BnProjectConfig Value Object. (c'est merdique)
327    *
328    *
329    * @throws InvalidValueException If one of the values are not correct,
330    * this will not roll back the transaction
331    * because the caller has the chance to
332    * fix the problem and try again
333    * @throws EJBException If no new unique ID could be retrieved this will
334    * rollback the transaction because there is no
335    * hope to try again
336    * @throws CreateException Because we have to do so (EJB spec.)
337    *
338    * @ejb:create-method view-type="both"
339    **/

340    public BnProjectConfigPK ejbCreate(BnProjectConfigValue pProjectConfig)
341       throws
342          CreateException JavaDoc
343    {
344        this.setBnProjectConfigValue(pProjectConfig);
345        this.setId(hero.interfaces.BnProjectConfigUtil.generateGUID(this));
346        
347        return null;
348    }
349
350    
351    public void ejbPostCreate( )
352    {
353    }
354    
355    public void setEntityContext( EntityContext JavaDoc lContext )
356    {
357       mContext = lContext;
358    }
359    
360    public void unsetEntityContext()
361    {
362       mContext = null;
363    }
364    
365    public void ejbActivate()
366    {
367    }
368    
369    public void ejbPassivate()
370    {
371    }
372    
373    public void ejbLoad()
374    {
375    }
376    
377    public void ejbStore()
378    {
379    }
380    
381    public void ejbRemove()
382       throws
383          RemoveException JavaDoc
384    {
385    }
386
387 }
388
Popular Tags