KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > entity > BnAuthRoleBean


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

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

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

82    /**
83    * Retrieve the BnAuthRole's id.
84    *
85    * @return Returns an int representing the id of this BnAuthRole.
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    * key-jdbc-name="BnUser_id"
94    * @ejb:transaction type="Supports"
95    *
96    **/

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

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

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

124     public abstract void setName( String JavaDoc pName );
125     
126     
127     /**
128      * Retrieve the BnAuthRole's Group.
129      *
130      * @return Returns an int representing the Group of this BnAuthRole.
131      *
132      * @ejb:persistence column-name="authrolegroup"
133      * @ejb:transaction type="Supports"
134      **/

135     public abstract String JavaDoc getBnRoleGroup();
136     
137     /**
138      * Set the BnAuthRole's Group.
139      *
140      * @param pGroup the Group of this BnAuthRole
141      * @ejb:transaction type="Required"
142      **/

143     public abstract void setBnRoleGroup( String JavaDoc pGroup );
144     
145     
146     /**
147      * @returns the users of the role
148      * @ejb:interface-method view-type="local"
149      * @ejb:relation name="AuthRoles" role-name="is-authrole-of" multiple="yes"
150      * @jboss:auto-key-fields
151      * @jonas:automatic-pk="true"
152      * @jboss.relation-table table-name="BnUserAuthRole" create-table="true" remove-table="false"
153      * @ejb:transaction type="Supports"
154      *
155      * @jonas.ejb-relation
156      * pk-composite="true"
157      * ejb-relation-name="AuthRoles"
158      * ejb-relationship-role-name1="is-authrole-of"
159      * jdbc-table-name="BNAUTHROLE_BNUSER"
160      * foreign-key-jdbc-name1="BnUser_id"
161      *
162      */

163     public abstract Collection JavaDoc getBnUsers() ;
164
165     /**
166      * Set the AuthRoles of this project
167      *
168      * @param pUsers users of the role
169      * @ejb:transaction type="Required"
170      **/

171     public abstract void setBnUsers( Collection JavaDoc pUsers);
172
173     /**
174      * @ejb.interface-method
175      * @ejb:transaction type="Supports"
176      */

177     public abstract BnAuthRoleValue getBnAuthRoleValue();
178     
179     /**
180      * @ejb.interface-method
181      * @ejb:transaction type="Required"
182      */

183     public abstract void setBnAuthRoleValue(BnAuthRoleValue v);
184
185    // -------------------------------------------------------------------------
186
// Framework Callbacks
187
// -------------------------------------------------------------------------
188

189    /**
190    * Create a BnAuthRole based on the supplied BnAuthRole Value Object.
191    *
192    * @param pAuthRole The data used to create the BnAuthRole.
193    *
194    * @throws InvalidValueException If one of the values are not correct,
195    * this will not roll back the transaction
196    * because the caller has the chance to
197    * fix the problem and try again
198    * @throws EJBException If no new unique ID could be retrieved this will
199    * rollback the transaction because there is no
200    * hope to try again
201    * @throws CreateException Because we have to do so (EJB spec.)
202    *
203    * @ejb:create-method view-type="both"
204    **/

205    public BnAuthRolePK ejbCreate( BnAuthRoleValue pAuthRole )
206       throws
207          EJBException JavaDoc,
208          CreateException JavaDoc
209    {
210        setBnAuthRoleValue(pAuthRole);
211        this.setId(hero.interfaces.BnAuthRoleUtil.generateGUID(this));
212        return null;
213    }
214    
215    public void ejbPostCreate( BnAuthRoleData pAuthRole )
216    {
217    }
218    
219    public void setEntityContext( EntityContext JavaDoc lContext )
220    {
221       mContext = lContext;
222    }
223    
224    public void unsetEntityContext()
225    {
226       mContext = null;
227    }
228    
229    public void ejbActivate()
230    {
231    }
232    
233    public void ejbPassivate()
234    {
235    }
236    
237    public void ejbLoad()
238    {
239    }
240    
241    public void ejbStore()
242    {
243    }
244    
245    public void ejbRemove()
246       throws
247          RemoveException JavaDoc
248    {
249    }
250 }
251
Popular Tags