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