001: /**
002: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017: * USA
018: *
019: * Component of: Red Hat Application Server
020: *
021: * Initial Developers: Aizaz Ahmed
022: * Vivek Lakshmanan
023: * Andrew Overholt
024: * Matthew Wringe
025: *
026: */package olstore.entity;
027:
028: import javax.ejb.EntityBean;
029:
030: /**
031: * @ejb.bean name="Address"
032: * description="This bean is used to store information about the user's address."
033: * type="CMP"
034: * schema="olstore_address"
035: * reentrant="false"
036: * cmp-version="2.x"
037: * view-type="local"
038: * local-jndi-name="AddressLocal_L"
039: *
040: * @ejb.relation
041: * name="User-Address"
042: * role-name="Address-belongs-to-User"
043: * target-ejb="User"
044: * cascade-delete="yes"
045: *
046: * @ejb.transaction
047: * type="Required"
048: *
049: * @ejb:pk
050: * class="java.lang.Object"
051: * generate="false"
052: *
053: *--
054: * This is needed for JOnAS.
055: * If you are not using JOnAS you can safely remove the tags below.
056: * @jonas.bean ejb-name="Address"
057: * jndi-name="AddressLocal"
058: * @jonas.jdbc-mapping jndi-name="jdbc_1" jdbc-table-name="olstore_address"
059: * --
060: *
061: * @ejb.persistence
062: *
063: * @ejb.finder
064: * query="SELECT OBJECT(a) FROM olstore_address as a"
065: * signature="java.util.Collection findAll()"
066: *
067: *--
068: * This is needed for JOnAS.
069: * If you are not using JOnAS you can safely remove the tags below.
070: * @jonas.finder-method-jdbc-mapping method-name="findAll"
071: * jdbc-where-clause=""
072: * @jonas.jdbc-mapping jndi-name="jdbc_1"
073: * jdbc-table-name="olstore_address"
074: *
075: *--
076: *
077: **/
078:
079: public abstract class AddressBean implements EntityBean {
080:
081: /**
082: * The ejbCreate method.
083: *
084: * @ejb.create-method
085: */
086: public java.lang.String ejbCreate(String country, String city,
087: String postCode, String street1, String street2,
088: String province) throws javax.ejb.CreateException {
089: setCountry(country);
090: setCity(city);
091: setPostalCode(postCode);
092: setStreet1(street1);
093: setStreet2(street2);
094: setProvince(province);
095: return null;
096: }
097:
098: /**
099: * The container invokes this method immediately after it calls ejbCreate.
100: *
101: */
102: public void ejbPostCreate(String country, String city,
103: String postCode, String street1, String street2,
104: String province) throws javax.ejb.CreateException {
105: }
106:
107: /**
108: * Returns the country
109: * @return the country
110: *
111: * @ejb.persistent-field
112: * @ejb.persistence
113: * column-name="country"
114: * sql-type="VARCHAR"
115: *
116: * @ejb.interface-method
117: *
118: * --
119: * This is needed for JOnAS.
120: * If you are not using JOnAS you can safely remove the tags below.
121: * @jonas.cmp-field-jdbc-mapping field-name="country"
122: * jdbc-field-name="country"
123: *
124: --
125: */
126: public abstract java.lang.String getCountry();
127:
128: /**
129: * Sets the country
130: *
131: * @param java.lang.String the new country value
132: *
133: * @ejb.interface-method
134: */
135: public abstract void setCountry(java.lang.String country);
136:
137: /**
138: * Returns the province
139: * @return the province
140: *
141: * @ejb.persistent-field
142: * @ejb.persistence
143: * column-name="province"
144: * sql-type="VARCHAR"
145: *
146: * @ejb.interface-method
147: *
148: * --
149: * This is needed for JOnAS.
150: * If you are not using JOnAS you can safely remove the tags below.
151: * @jonas.cmp-field-jdbc-mapping field-name="province"
152: * jdbc-field-name="province"
153: *
154: --
155: */
156: public abstract java.lang.String getProvince();
157:
158: /**
159: * Sets the province
160: *
161: * @param java.lang.String the new province value
162: *
163: * @ejb.interface-method
164: */
165: public abstract void setProvince(java.lang.String province);
166:
167: /**
168: * Returns the city
169: * @return the city
170: *
171: * @ejb.persistent-field
172: * @ejb.persistence
173: * column-name="city"
174: * sql-type="VARCHAR"
175: *
176: * @ejb.interface-method
177: *
178: * --
179: * This is needed for JOnAS.
180: * If you are not using JOnAS you can safely remove the tags below.
181: * @jonas.cmp-field-jdbc-mapping field-name="city"
182: * jdbc-field-name="city"
183: *
184: --
185: */
186: public abstract java.lang.String getCity();
187:
188: /**
189: * Sets the city
190: *
191: * @param java.lang.String the new city value
192: *
193: * @ejb.interface-method
194: */
195: public abstract void setCity(java.lang.String city);
196:
197: /**
198: * Returns the postalCode
199: * @return the postalCode
200: *
201: * @ejb.persistent-field
202: * @ejb.persistence
203: * column-name="postalCode"
204: * sql-type="VARCHAR"
205: *
206: * @ejb.interface-method
207: *
208: * --
209: * This is needed for JOnAS.
210: * If you are not using JOnAS you can safely remove the tags below.
211: * @jonas.cmp-field-jdbc-mapping field-name="postalCode"
212: * jdbc-field-name="postalCode"
213: *
214: --
215: */
216: public abstract java.lang.String getPostalCode();
217:
218: /**
219: * Sets the postalCode
220: *
221: * @param java.lang.String the new postalCode value
222: *
223: * @ejb.interface-method
224: */
225: public abstract void setPostalCode(java.lang.String postalCode);
226:
227: /**
228: * Returns the street1
229: * @return the street1
230: *
231: * @ejb.persistent-field
232: * @ejb.persistence
233: * column-name="street1"
234: * sql-type="VARCHAR"
235: *
236: * @ejb.interface-method
237: *
238: * --
239: * This is needed for JOnAS.
240: * If you are not using JOnAS you can safely remove the tags below.
241: * @jonas.cmp-field-jdbc-mapping field-name="street1"
242: * jdbc-field-name="street1"
243: *
244: --
245: */
246: public abstract java.lang.String getStreet1();
247:
248: /**
249: * Sets the street1
250: *
251: * @param java.lang.String the new street1 value
252: *
253: * @ejb.interface-method
254: */
255: public abstract void setStreet1(java.lang.String street1);
256:
257: /**
258: * Returns the street2
259: * @return the street2
260: *
261: * @ejb.persistent-field
262: * @ejb.persistence
263: * column-name="street2"
264: * sql-type="VARCHAR"
265: *
266: * @ejb.interface-method
267: *
268: * --
269: * This is needed for JOnAS.
270: * If you are not using JOnAS you can safely remove the tags below.
271: * @jonas.cmp-field-jdbc-mapping field-name="street2"
272: * jdbc-field-name="street2"
273: *
274: --
275: */
276: public abstract java.lang.String getStreet2();
277:
278: /**
279: * Sets the street2
280: *
281: * @param java.lang.String the new street2 value
282: *
283: * @ejb.interface-method
284: */
285: public abstract void setStreet2(java.lang.String street2);
286:
287: }
|