KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > bea > cmr > SubscriberBean


1 package test.bea.cmr;
2
3 import java.rmi.RemoteException JavaDoc;
4
5 import javax.ejb.CreateException JavaDoc;
6 import javax.ejb.EJBException JavaDoc;
7 import javax.ejb.EntityBean JavaDoc;
8 import javax.ejb.EntityContext JavaDoc;
9 import javax.ejb.RemoveException JavaDoc;
10
11 import test.bea.cmr.MagazineLocal;
12
13 /**
14  * @ejb.bean display-name="Subscriber" name="Subscriber" schema="SubscriberSchema"
15  * view-type="local" type="CMP" cmp-version="2.x" primkey-field="boid"
16  * local-jndi-name="de.razeman.xdoclet.test.weblogic.ejb.relation.local.SubscriberLocalHome"
17  * @ejb.finder signature="java.util.Collection findAll()" query="SELECT OBJECT(o) FROM SubscriberSchema AS o"
18  * @ejb.transaction type = "Supports"
19  * @ejb.pk class="java.lang.String"
20  *
21  * @ejb.persistence table-name="Subscriber"
22  *
23  * @weblogic.table-name Subscriber
24  * @weblogic.data-source-name OracleDS
25  */

26 public abstract class SubscriberBean implements EntityBean JavaDoc
27 {
28     private EntityContext JavaDoc context;
29     
30     public SubscriberBean()
31     {
32     }
33     
34     /**
35      * @ejb.create-method
36      *
37      * Creates a new Entity Bean.
38      * @param boid The unique identifier.
39      * @throws CreateException If <code>id</code> is <code>null</code>.
40      */

41     public String JavaDoc ejbCreate(String JavaDoc boid) throws CreateException JavaDoc
42     {
43         if (boid == null) {
44             throw (new CreateException JavaDoc("ID must not be null!"));
45         }
46
47         setBoid(boid);
48
49         return null;
50     }
51
52     /**
53      * Called immediately after creation.
54      * @param boid The unique identifier.
55      */

56     public void ejbPostCreate(String JavaDoc boid) {
57     }
58
59     /**
60      * @ejb.interface-method
61      * @ejb.relation name="uniOne2One-Subscriber-has-a-Magazine" role-name="SubscriberRole"
62      * target-ejb="Magazine" target-role-name="MagazineRole"
63      * @weblogic.target-column-map key-column="boid" foreign-key-column="uniOne2OneSubscriberBoid"
64      */

65     public abstract MagazineLocal getUniOne2OneMagazine();
66
67     /**
68      * @ejb.interface-method
69      * @ejb.relation name="biOne2One-Magazine-Subscriber" role-name="Subscriber"
70      *
71      * @weblogic.column-map key-column="boid" foreign-key-column="biOne2OneMagazineBoid"
72      */

73     public abstract MagazineLocal getBiOne2OneMagazine();
74
75     /**
76      * @ejb.interface-method
77      *
78      * @ejb.transaction type = "Required"
79      *
80      * @ejb.relation name="uniOne2Many-Subscriber-has-many-Magazines" role-name="SubscriberRole"
81      * target-ejb="Magazine" target-role-name="MagazineRole"
82      *
83      * @weblogic.target-column-map key-column="boid" foreign-key-column="uniOne2ManySubscriberBoid"
84      */

85     public abstract java.util.Collection JavaDoc getUniOne2ManyMagazines();
86
87     /**
88      * @ejb.interface-method
89      *
90      * @ejb.transaction type = "Required"
91      *
92      * @ejb.relation name="biMany2One-Magazine-for-many-Subscribers"
93      * role-name="SubscriberRole"
94      */

95     public abstract java.util.Collection JavaDoc getBiOne2ManyMagazines();
96
97     /**
98      * @ejb.interface-method
99      *
100      * @ejb.relation name="uniMany2One-Magazine-for-many-Subscribers"
101      * role-name="SubscriberRole" target-multiple = "yes"
102      * target-ejb="Magazine" target-role-name="MagazineRole"
103      *
104      * @weblogic.column-map key-column="boid" foreign-key-column="uniMany2OneMagazineBoid"
105      */

106     public abstract MagazineLocal getUniMany2OneMagazine();
107
108     /**
109      * @ejb.interface-method
110      *
111      * @ejb.transaction type = "Required"
112      *
113      * @ejb.relation name="biMany2Many-Many-Subscribers-for-many-Magazines"
114      * role-name="SubscriberRole"
115      *
116      * @weblogic.relation join-table-name="BiMany2ManySubscriberMagazine"
117      *
118      * @weblogic.column-map key-column="boid" foreign-key-column="SubscriberBoid"
119      */

120     public abstract java.util.Collection JavaDoc getBiMany2ManyMagazines();
121
122     /**
123      * @ejb.interface-method
124      */

125     public abstract void setBiMany2ManyMagazines(java.util.Collection JavaDoc biMany2ManyMagArray);
126
127     /**
128      * @ejb.interface-method
129      */

130     public abstract void setUniOne2OneMagazine(MagazineLocal uniOne2OneMag);
131     
132     /**
133      * @ejb.interface-method
134      */

135     public abstract void setBiOne2OneMagazine(MagazineLocal biOne2OneMag);
136
137     /**
138      * @ejb.interface-method
139      */

140     public abstract void setUniOne2ManyMagazines(java.util.Collection JavaDoc uniOne2ManyMagArray);
141
142     /**
143      * @ejb.interface-method
144      */

145     public abstract void setBiOne2ManyMagazines(java.util.Collection JavaDoc biOne2ManyMagArray);
146     
147     /**
148      * @ejb.interface-method
149      */

150     public abstract void setUniMany2OneMagazine(MagazineLocal uniMany2OneMag);
151
152     /**
153      * @ejb.pk-field
154      * @ejb.persistent-field
155      * @ejb.interface-method
156      * @weblogic.dbms-column boid
157      */

158     public abstract String JavaDoc getBoid();
159
160     /**
161      *
162      * @param boid
163      */

164     public abstract void setBoid(String JavaDoc boid);
165
166     /**
167      * @return
168      */

169     public EntityContext JavaDoc getEntityContext() {
170         return context;
171     }
172
173     /**
174      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
175      */

176     public void setEntityContext(EntityContext JavaDoc context) throws EJBException JavaDoc, RemoteException JavaDoc
177     {
178         this.context = context;
179     }
180     
181     /**
182      * @see javax.ejb.EntityBean#unsetEntityContext()
183      */

184     public void unsetEntityContext() throws EJBException JavaDoc, RemoteException JavaDoc
185     {
186     }
187     
188     /**
189      * @see javax.ejb.EntityBean#ejbActivate()
190      */

191     public void ejbActivate() throws EJBException JavaDoc, RemoteException JavaDoc
192     {
193     }
194     
195     /**
196      * @see javax.ejb.EntityBean#ejbPassivate()
197      */

198     public void ejbPassivate() throws EJBException JavaDoc, RemoteException JavaDoc
199     {
200     }
201     
202     /**
203      * @see javax.ejb.EntityBean#ejbRemove()
204      */

205     public void ejbRemove() throws RemoveException JavaDoc, EJBException JavaDoc, RemoteException JavaDoc
206     {
207     }
208
209     /**
210      * @see javax.ejb.EntityBean#ejbLoad()
211      */

212     public void ejbLoad() throws EJBException JavaDoc, RemoteException JavaDoc
213     {
214     }
215
216     /**
217      * @see javax.ejb.EntityBean#ejbStore()
218      */

219     public void ejbStore() throws EJBException JavaDoc, RemoteException JavaDoc
220     {
221     }
222     
223     public String JavaDoc toString() {
224         return getClass().getName() + " [boid=" + getBoid() + "]";
225     }
226
227 }
Popular Tags