1
2
3 package org.paneris.jammyjoes.model.generated;
4
5 import org.melati.poem.AccessPoemException;
6 import org.melati.poem.Column;
7 import org.melati.poem.Database;
8 import org.melati.poem.DefinitionSource;
9 import org.melati.poem.DisplayLevel;
10 import org.melati.poem.DoublePoemType;
11 import org.melati.poem.Field;
12 import org.melati.poem.JdbcPersistent;
13 import org.melati.poem.Persistent;
14 import org.melati.poem.PoemException;
15 import org.melati.poem.ReferencePoemType;
16 import org.melati.poem.Searchability;
17 import org.melati.poem.TroidPoemType;
18 import org.melati.poem.ValidationPoemException;
19 import org.paneris.jammyjoes.model.DeliveryCarrier;
20 import org.paneris.jammyjoes.model.DeliveryCharge;
21 import org.paneris.jammyjoes.model.DeliveryZone;
22 import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
23 import org.paneris.jammyjoes.model.JammyjoesTable;
24
25
26 /**
27 * Melati POEM generated base class for
28 <code>Table</code> <code>DeliveryCharge</code>.
29 *
30 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
31 */
32
33 public class DeliveryChargeTableBase extends JammyjoesTable {
34
35 private Column col_id = null;
36 private Column col_zone = null;
37 private Column col_weight = null;
38 private Column col_cost = null;
39 private Column col_carrier = null;
40
41 /**
42 * Constructor.
43 *
44 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
45 * @param database the POEM database we are using
46 * @param name the name of this <code>Table</code>
47 * @param definitionSource which definition is being used
48 * @throws PoemException if anything goes wrong
49 */
50
51 public DeliveryChargeTableBase(
52 Database database, String name,
53 DefinitionSource definitionSource) throws PoemException {
54 super(database, name, definitionSource);
55 }
56
57
58 /**
59 * Get the database tables.
60 *
61 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
62 * @return the database tables
63 */
64 public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
65 return (JammyjoesDatabaseTables)getDatabase();
66 }
67
68 public void init() throws PoemException {
69 super.init();
70 defineColumn(col_id =
71 new Column(this, "id",
72 new TroidPoemType(),
73 DefinitionSource.dsd) {
74 public Object getCooked(Persistent g)
75 throws AccessPoemException, PoemException {
76 return ((DeliveryCharge)g).getId();
77 }
78
79 public void setCooked(Persistent g, Object cooked)
80 throws AccessPoemException, ValidationPoemException {
81 ((DeliveryCharge)g).setId((Integer)cooked);
82 }
83
84 public Field asField(Persistent g) {
85 return ((DeliveryCharge)g).getIdField();
86 }
87
88 protected boolean defaultUserEditable() {
89 return false;
90 }
91
92 protected boolean defaultUserCreateable() {
93 return false;
94 }
95
96 protected DisplayLevel defaultDisplayLevel() {
97 return DisplayLevel.record;
98 }
99
100 protected int defaultDisplayOrder() {
101 return 0;
102 }
103
104 public Object getRaw_unsafe(Persistent g)
105 throws AccessPoemException {
106 return ((DeliveryCharge)g).getId_unsafe();
107 }
108
109 public void setRaw_unsafe(Persistent g, Object raw)
110 throws AccessPoemException {
111 ((DeliveryCharge)g).setId_unsafe((Integer)raw);
112 }
113
114 public Object getRaw(Persistent g)
115 throws AccessPoemException {
116 return ((DeliveryCharge)g).getId();
117 }
118
119 public void setRaw(Persistent g, Object raw)
120 throws AccessPoemException {
121 ((DeliveryCharge)g).setId((Integer)raw);
122 }
123 });
124
125 defineColumn(col_zone =
126 new Column(this, "zone",
127 new ReferencePoemType(getJammyjoesDatabaseTables().
128 getDeliveryZoneTable(), false),
129 DefinitionSource.dsd) {
130 public Object getCooked(Persistent g)
131 throws AccessPoemException, PoemException {
132 return ((DeliveryCharge)g).getZone();
133 }
134
135 public void setCooked(Persistent g, Object cooked)
136 throws AccessPoemException, ValidationPoemException {
137 ((DeliveryCharge)g).setZone((DeliveryZone)cooked);
138 }
139
140 public Field asField(Persistent g) {
141 return ((DeliveryCharge)g).getZoneField();
142 }
143
144 protected DisplayLevel defaultDisplayLevel() {
145 return DisplayLevel.primary;
146 }
147
148 protected Searchability defaultSearchability() {
149 return Searchability.primary;
150 }
151
152 protected Integer defaultDisplayOrderPriority() {
153 return new Integer(0);
154 }
155
156 protected String defaultDisplayName() {
157 return "Delivery Zone";
158 }
159
160 protected int defaultDisplayOrder() {
161 return 1;
162 }
163
164 protected String defaultDescription() {
165 return "The Delivery Zone";
166 }
167
168 public Object getRaw_unsafe(Persistent g)
169 throws AccessPoemException {
170 return ((DeliveryCharge)g).getZone_unsafe();
171 }
172
173 public void setRaw_unsafe(Persistent g, Object raw)
174 throws AccessPoemException {
175 ((DeliveryCharge)g).setZone_unsafe((Integer)raw);
176 }
177
178 public Object getRaw(Persistent g)
179 throws AccessPoemException {
180 return ((DeliveryCharge)g).getZoneTroid();
181 }
182
183 public void setRaw(Persistent g, Object raw)
184 throws AccessPoemException {
185 ((DeliveryCharge)g).setZoneTroid((Integer)raw);
186 }
187 });
188
189 defineColumn(col_weight =
190 new Column(this, "weight",
191 new DoublePoemType(false),
192 DefinitionSource.dsd) {
193 public Object getCooked(Persistent g)
194 throws AccessPoemException, PoemException {
195 return ((DeliveryCharge)g).getWeight();
196 }
197
198 public void setCooked(Persistent g, Object cooked)
199 throws AccessPoemException, ValidationPoemException {
200 ((DeliveryCharge)g).setWeight((Double)cooked);
201 }
202
203 public Field asField(Persistent g) {
204 return ((DeliveryCharge)g).getWeightField();
205 }
206
207 protected DisplayLevel defaultDisplayLevel() {
208 return DisplayLevel.summary;
209 }
210
211 protected Searchability defaultSearchability() {
212 return Searchability.no;
213 }
214
215 protected Integer defaultDisplayOrderPriority() {
216 return new Integer(1);
217 }
218
219 protected String defaultDisplayName() {
220 return "Max Weight in grammes or Min Value in Pounds and Pence ";
221 }
222
223 protected int defaultDisplayOrder() {
224 return 2;
225 }
226
227 public Object getRaw_unsafe(Persistent g)
228 throws AccessPoemException {
229 return ((DeliveryCharge)g).getWeight_unsafe();
230 }
231
232 public void setRaw_unsafe(Persistent g, Object raw)
233 throws AccessPoemException {
234 ((DeliveryCharge)g).setWeight_unsafe((Double)raw);
235 }
236
237 public Object getRaw(Persistent g)
238 throws AccessPoemException {
239 return ((DeliveryCharge)g).getWeight();
240 }
241
242 public void setRaw(Persistent g, Object raw)
243 throws AccessPoemException {
244 ((DeliveryCharge)g).setWeight((Double)raw);
245 }
246 });
247
248 defineColumn(col_cost =
249 new Column(this, "cost",
250 new DoublePoemType(false),
251 DefinitionSource.dsd) {
252 public Object getCooked(Persistent g)
253 throws AccessPoemException, PoemException {
254 return ((DeliveryCharge)g).getCost();
255 }
256
257 public void setCooked(Persistent g, Object cooked)
258 throws AccessPoemException, ValidationPoemException {
259 ((DeliveryCharge)g).setCost((Double)cooked);
260 }
261
262 public Field asField(Persistent g) {
263 return ((DeliveryCharge)g).getCostField();
264 }
265
266 protected DisplayLevel defaultDisplayLevel() {
267 return DisplayLevel.summary;
268 }
269
270 protected Searchability defaultSearchability() {
271 return Searchability.no;
272 }
273
274 protected String defaultDisplayName() {
275 return "Cost";
276 }
277
278 protected int defaultDisplayOrder() {
279 return 3;
280 }
281
282 protected String defaultDescription() {
283 return "The Cost to deliver this weight to this zone";
284 }
285
286 public Object getRaw_unsafe(Persistent g)
287 throws AccessPoemException {
288 return ((DeliveryCharge)g).getCost_unsafe();
289 }
290
291 public void setRaw_unsafe(Persistent g, Object raw)
292 throws AccessPoemException {
293 ((DeliveryCharge)g).setCost_unsafe((Double)raw);
294 }
295
296 public Object getRaw(Persistent g)
297 throws AccessPoemException {
298 return ((DeliveryCharge)g).getCost();
299 }
300
301 public void setRaw(Persistent g, Object raw)
302 throws AccessPoemException {
303 ((DeliveryCharge)g).setCost((Double)raw);
304 }
305 });
306
307 defineColumn(col_carrier =
308 new Column(this, "carrier",
309 new ReferencePoemType(getJammyjoesDatabaseTables().
310 getDeliveryCarrierTable(), false),
311 DefinitionSource.dsd) {
312 public Object getCooked(Persistent g)
313 throws AccessPoemException, PoemException {
314 return ((DeliveryCharge)g).getCarrier();
315 }
316
317 public void setCooked(Persistent g, Object cooked)
318 throws AccessPoemException, ValidationPoemException {
319 ((DeliveryCharge)g).setCarrier((DeliveryCarrier)cooked);
320 }
321
322 public Field asField(Persistent g) {
323 return ((DeliveryCharge)g).getCarrierField();
324 }
325
326 protected DisplayLevel defaultDisplayLevel() {
327 return DisplayLevel.record;
328 }
329
330 protected Searchability defaultSearchability() {
331 return Searchability.yes;
332 }
333
334 protected String defaultDisplayName() {
335 return "Delivery Carrier";
336 }
337
338 protected int defaultDisplayOrder() {
339 return 4;
340 }
341
342 protected String defaultDescription() {
343 return "The Delivery Carrier";
344 }
345
346 public Object getRaw_unsafe(Persistent g)
347 throws AccessPoemException {
348 return ((DeliveryCharge)g).getCarrier_unsafe();
349 }
350
351 public void setRaw_unsafe(Persistent g, Object raw)
352 throws AccessPoemException {
353 ((DeliveryCharge)g).setCarrier_unsafe((Integer)raw);
354 }
355
356 public Object getRaw(Persistent g)
357 throws AccessPoemException {
358 return ((DeliveryCharge)g).getCarrierTroid();
359 }
360
361 public void setRaw(Persistent g, Object raw)
362 throws AccessPoemException {
363 ((DeliveryCharge)g).setCarrierTroid((Integer)raw);
364 }
365 });
366 }
367
368
369 /**
370 * Retrieves the <code>Id</code> <code>Column</code> for this
371 * <code>DeliveryCharge</code> <code>Table</code>.
372 *
373 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
374 * @return the id <code>Column</code>
375 */
376 public final Column getIdColumn() {
377 return col_id;
378 }
379
380
381 /**
382 * Retrieves the <code>Zone</code> <code>Column</code> for this
383 * <code>DeliveryCharge</code> <code>Table</code>.
384 *
385 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
386 * @return the zone <code>Column</code>
387 */
388 public final Column getZoneColumn() {
389 return col_zone;
390 }
391
392
393 /**
394 * Retrieves the <code>Weight</code> <code>Column</code> for this
395 * <code>DeliveryCharge</code> <code>Table</code>.
396 *
397 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
398 * @return the weight <code>Column</code>
399 */
400 public final Column getWeightColumn() {
401 return col_weight;
402 }
403
404
405 /**
406 * Retrieves the <code>Cost</code> <code>Column</code> for this
407 * <code>DeliveryCharge</code> <code>Table</code>.
408 *
409 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
410 * @return the cost <code>Column</code>
411 */
412 public final Column getCostColumn() {
413 return col_cost;
414 }
415
416
417 /**
418 * Retrieves the <code>Carrier</code> <code>Column</code> for this
419 * <code>DeliveryCharge</code> <code>Table</code>.
420 *
421 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
422 * @return the carrier <code>Column</code>
423 */
424 public final Column getCarrierColumn() {
425 return col_carrier;
426 }
427
428
429 /**
430 * Retrieve the <code>DeliveryCharge</code> as a <code>DeliveryCharge</code>.
431 *
432 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
433 * @param troid a Table Row Oject ID
434 * @return the <code>Persistent</code> identified by the <code>troid</code>
435 */
436 public DeliveryCharge getDeliveryChargeObject(Integer troid) {
437 return (DeliveryCharge)getObject(troid);
438 }
439
440
441 /**
442 * Retrieve the <code>DeliveryCharge</code>
443 * as a <code>DeliveryCharge</code>.
444 *
445 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
446 * @param troid a Table Row Object ID
447 * @return the <code>Persistent</code> identified */
448 public DeliveryCharge getDeliveryChargeObject(int troid) {
449 return (DeliveryCharge)getObject(troid);
450 }
451
452 protected JdbcPersistent _newPersistent() {
453 return new DeliveryCharge();
454 }
455 protected String defaultDisplayName() {
456 return "Delivery Charge";
457 }
458
459 protected String defaultDescription() {
460 return "A charge for delivery";
461 }
462
463 protected boolean defaultRememberAllTroids() {
464 return true;
465 }
466
467 protected String defaultCategory() {
468 return "Codes";
469 }
470
471 protected int defaultDisplayOrder() {
472 return 1040;
473 }
474 }
475