KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > olstore > entity > AddressBean


1 /**
2  * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA
18  *
19  * Component of: Red Hat Application Server
20  *
21  * Initial Developers: Aizaz Ahmed
22  * Vivek Lakshmanan
23  * Andrew Overholt
24  * Matthew Wringe
25  *
26  */

27
28 /*
29  * AddressBean.java
30  *
31  * Created on Aug 16, 2004
32  *
33  */

34 package olstore.entity;
35
36 import javax.ejb.EntityBean;
37
38 /**
39  * @ejb.bean name="Address"
40  * description="This bean is used to store information about the user's address."
41  * type="CMP"
42  * schema="olstore_address"
43  * reentrant="false"
44  * cmp-version="2.x"
45  * view-type="local"
46  * local-jndi-name="AddressLocal_L"
47  *
48  * @ejb.relation
49  * name="User-Address"
50  * role-name="Address-belongs-to-User"
51  * target-ejb="User"
52  * cascade-delete="yes"
53  *
54  * @ejb.transaction
55  * type="Required"
56  *
57  * @ejb:pk
58  * class="java.lang.Object"
59  * generate="false"
60  *
61  *--
62  * This is needed for JOnAS.
63  * If you are not using JOnAS you can safely remove the tags below.
64  * @jonas.bean ejb-name="Address"
65  * jndi-name="AddressLocal"
66  * @jonas.jdbc-mapping jndi-name="jdbc_1" jdbc-table-name="olstore_address"
67  * --
68  *
69  * @ejb.persistence
70  *
71  * @ejb.finder
72  * query="SELECT OBJECT(a) FROM olstore_address as a"
73  * signature="java.util.Collection findAll()"
74  *
75  *--
76  * This is needed for JOnAS.
77  * If you are not using JOnAS you can safely remove the tags below.
78  * @jonas.finder-method-jdbc-mapping method-name="findAll"
79  * jdbc-where-clause=""
80  * @jonas.jdbc-mapping jndi-name="jdbc_1"
81  * jdbc-table-name="olstore_address"
82  *
83  *--
84  *
85  **/

86
87 public abstract class AddressBean implements EntityBean {
88     
89     /**
90      * The ejbCreate method.
91      *
92      * @ejb.create-method
93      */

94     public java.lang.String ejbCreate(String country, String city, String postCode, String street1, String street2, String province)
95     throws javax.ejb.CreateException {
96         setCountry (country);
97         setCity (city);
98         setPostalCode (postCode);
99         setStreet1 (street1);
100         setStreet2 (street2);
101         setProvince (province);
102         return null;
103     }
104     
105     /**
106      * The container invokes this method immediately after it calls ejbCreate.
107      *
108      */

109     public void ejbPostCreate(String country, String city, String postCode, String street1, String street2, String province) throws javax.ejb.CreateException {
110     }
111     
112     /**
113      * Returns the country
114      * @return the country
115      *
116      * @ejb.persistent-field
117      * @ejb.persistence
118      * column-name="country"
119      * sql-type="VARCHAR"
120      *
121      * @ejb.interface-method
122      *
123      * --
124      * This is needed for JOnAS.
125      * If you are not using JOnAS you can safely remove the tags below.
126      * @jonas.cmp-field-jdbc-mapping field-name="country"
127      * jdbc-field-name="country"
128      *
129      --
130      */

131     public abstract java.lang.String getCountry();
132     
133     /**
134      * Sets the country
135      *
136      * @param java.lang.String the new country value
137      *
138      * @ejb.interface-method
139      */

140     public abstract void setCountry(java.lang.String country);
141     
142     /**
143      * Returns the province
144      * @return the province
145      *
146      * @ejb.persistent-field
147      * @ejb.persistence
148      * column-name="province"
149      * sql-type="VARCHAR"
150      *
151      * @ejb.interface-method
152      *
153      * --
154      * This is needed for JOnAS.
155      * If you are not using JOnAS you can safely remove the tags below.
156      * @jonas.cmp-field-jdbc-mapping field-name="province"
157      * jdbc-field-name="province"
158      *
159      --
160      */

161     public abstract java.lang.String getProvince();
162     
163     /**
164      * Sets the province
165      *
166      * @param java.lang.String the new province value
167      *
168      * @ejb.interface-method
169      */

170     public abstract void setProvince(java.lang.String province);
171     
172     
173     /**
174      * Returns the city
175      * @return the city
176      *
177      * @ejb.persistent-field
178      * @ejb.persistence
179      * column-name="city"
180      * sql-type="VARCHAR"
181      *
182      * @ejb.interface-method
183      *
184      * --
185      * This is needed for JOnAS.
186      * If you are not using JOnAS you can safely remove the tags below.
187      * @jonas.cmp-field-jdbc-mapping field-name="city"
188      * jdbc-field-name="city"
189      *
190      --
191      */

192     public abstract java.lang.String getCity();
193     
194     /**
195      * Sets the city
196      *
197      * @param java.lang.String the new city value
198      *
199      * @ejb.interface-method
200      */

201     public abstract void setCity(java.lang.String city);
202     
203     /**
204      * Returns the postalCode
205      * @return the postalCode
206      *
207      * @ejb.persistent-field
208      * @ejb.persistence
209      * column-name="postalCode"
210      * sql-type="VARCHAR"
211      *
212      * @ejb.interface-method
213      *
214      * --
215      * This is needed for JOnAS.
216      * If you are not using JOnAS you can safely remove the tags below.
217      * @jonas.cmp-field-jdbc-mapping field-name="postalCode"
218      * jdbc-field-name="postalCode"
219      *
220      --
221      */

222     public abstract java.lang.String getPostalCode();
223     
224     /**
225      * Sets the postalCode
226      *
227      * @param java.lang.String the new postalCode value
228      *
229      * @ejb.interface-method
230      */

231     public abstract void setPostalCode(java.lang.String postalCode);
232     
233     /**
234      * Returns the street1
235      * @return the street1
236      *
237      * @ejb.persistent-field
238      * @ejb.persistence
239      * column-name="street1"
240      * sql-type="VARCHAR"
241      *
242      * @ejb.interface-method
243      *
244      * --
245      * This is needed for JOnAS.
246      * If you are not using JOnAS you can safely remove the tags below.
247      * @jonas.cmp-field-jdbc-mapping field-name="street1"
248      * jdbc-field-name="street1"
249      *
250      --
251      */

252     public abstract java.lang.String getStreet1();
253     
254     /**
255      * Sets the street1
256      *
257      * @param java.lang.String the new street1 value
258      *
259      * @ejb.interface-method
260      */

261     public abstract void setStreet1(java.lang.String street1);
262     
263     /**
264      * Returns the street2
265      * @return the street2
266      *
267      * @ejb.persistent-field
268      * @ejb.persistence
269      * column-name="street2"
270      * sql-type="VARCHAR"
271      *
272      * @ejb.interface-method
273      *
274      * --
275      * This is needed for JOnAS.
276      * If you are not using JOnAS you can safely remove the tags below.
277      * @jonas.cmp-field-jdbc-mapping field-name="street2"
278      * jdbc-field-name="street2"
279      *
280      --
281      */

282     public abstract java.lang.String getStreet2();
283     
284     /**
285      * Sets the street2
286      *
287      * @param java.lang.String the new street2 value
288      *
289      * @ejb.interface-method
290      */

291     public abstract void setStreet2(java.lang.String street2);
292     
293 }
294
Popular Tags