1
2
3 package org.paneris.rimauresq.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.IntegerPoemType;
13 import org.melati.poem.JdbcPersistent;
14 import org.melati.poem.Persistent;
15 import org.melati.poem.PoemException;
16 import org.melati.poem.ReferencePoemType;
17 import org.melati.poem.Searchability;
18 import org.melati.poem.TroidPoemType;
19 import org.melati.poem.ValidationPoemException;
20 import org.paneris.rimauresq.model.Product;
21 import org.paneris.rimauresq.model.RimauresqDatabaseTables;
22 import org.paneris.rimauresq.model.RimauresqTable;
23 import org.paneris.rimauresq.model.ShopOrder;
24 import org.paneris.rimauresq.model.ShopOrderItem;
25 import org.paneris.rimauresq.model.User;
26
27
28
29
30
31
32
33
34
35 public class ShopOrderItemTableBase extends RimauresqTable {
36
37 private Column col_id = null;
38 private Column col_user = null;
39 private Column col_product = null;
40 private Column col_quantity = null;
41 private Column col_order = null;
42 private Column col_amount = null;
43
44
45
46
47
48
49
50
51
52
53
54 public ShopOrderItemTableBase(
55 Database database, String name,
56 DefinitionSource definitionSource) throws PoemException {
57 super(database, name, definitionSource);
58 }
59
60
61
62
63
64
65
66
67 public RimauresqDatabaseTables getRimauresqDatabaseTables() {
68 return (RimauresqDatabaseTables)getDatabase();
69 }
70
71 public void init() throws PoemException {
72 super.init();
73 defineColumn(col_id =
74 new Column(this, "id",
75 new TroidPoemType(),
76 DefinitionSource.dsd) {
77 public Object getCooked(Persistent g)
78 throws AccessPoemException, PoemException {
79 return ((ShopOrderItem)g).getId();
80 }
81
82 public void setCooked(Persistent g, Object cooked)
83 throws AccessPoemException, ValidationPoemException {
84 ((ShopOrderItem)g).setId((Integer)cooked);
85 }
86
87 public Field asField(Persistent g) {
88 return ((ShopOrderItem)g).getIdField();
89 }
90
91 protected boolean defaultUserEditable() {
92 return false;
93 }
94
95 protected boolean defaultUserCreateable() {
96 return false;
97 }
98
99 protected DisplayLevel defaultDisplayLevel() {
100 return DisplayLevel.record;
101 }
102
103 protected Searchability defaultSearchability() {
104 return Searchability.no;
105 }
106
107 protected int defaultDisplayOrder() {
108 return 0;
109 }
110
111 public Object getRaw_unsafe(Persistent g)
112 throws AccessPoemException {
113 return ((ShopOrderItem)g).getId_unsafe();
114 }
115
116 public void setRaw_unsafe(Persistent g, Object raw)
117 throws AccessPoemException {
118 ((ShopOrderItem)g).setId_unsafe((Integer)raw);
119 }
120
121 public Object getRaw(Persistent g)
122 throws AccessPoemException {
123 return ((ShopOrderItem)g).getId();
124 }
125
126 public void setRaw(Persistent g, Object raw)
127 throws AccessPoemException {
128 ((ShopOrderItem)g).setId((Integer)raw);
129 }
130 });
131
132 defineColumn(col_user =
133 new Column(this, "user",
134 new ReferencePoemType(getRimauresqDatabaseTables().
135 getUserTable(), false),
136 DefinitionSource.dsd) {
137 public Object getCooked(Persistent g)
138 throws AccessPoemException, PoemException {
139 return ((ShopOrderItem)g).getUser();
140 }
141
142 public void setCooked(Persistent g, Object cooked)
143 throws AccessPoemException, ValidationPoemException {
144 ((ShopOrderItem)g).setUser((User)cooked);
145 }
146
147 public Field asField(Persistent g) {
148 return ((ShopOrderItem)g).getUserField();
149 }
150
151 protected DisplayLevel defaultDisplayLevel() {
152 return DisplayLevel.summary;
153 }
154
155 protected Searchability defaultSearchability() {
156 return Searchability.primary;
157 }
158
159 protected Integer defaultDisplayOrderPriority() {
160 return new Integer(0);
161 }
162
163 protected String defaultDisplayName() {
164 return "User";
165 }
166
167 protected int defaultDisplayOrder() {
168 return 1;
169 }
170
171 protected boolean defaultIndexed() {
172 return true;
173 }
174
175 protected String defaultRenderinfo() {
176 return "SelectionWindow";
177 }
178
179 public Object getRaw_unsafe(Persistent g)
180 throws AccessPoemException {
181 return ((ShopOrderItem)g).getUser_unsafe();
182 }
183
184 public void setRaw_unsafe(Persistent g, Object raw)
185 throws AccessPoemException {
186 ((ShopOrderItem)g).setUser_unsafe((Integer)raw);
187 }
188
189 public Object getRaw(Persistent g)
190 throws AccessPoemException {
191 return ((ShopOrderItem)g).getUserTroid();
192 }
193
194 public void setRaw(Persistent g, Object raw)
195 throws AccessPoemException {
196 ((ShopOrderItem)g).setUserTroid((Integer)raw);
197 }
198 });
199
200 defineColumn(col_product =
201 new Column(this, "product",
202 new ReferencePoemType(getRimauresqDatabaseTables().
203 getProductTable(), false),
204 DefinitionSource.dsd) {
205 public Object getCooked(Persistent g)
206 throws AccessPoemException, PoemException {
207 return ((ShopOrderItem)g).getProduct();
208 }
209
210 public void setCooked(Persistent g, Object cooked)
211 throws AccessPoemException, ValidationPoemException {
212 ((ShopOrderItem)g).setProduct((Product)cooked);
213 }
214
215 public Field asField(Persistent g) {
216 return ((ShopOrderItem)g).getProductField();
217 }
218
219 protected DisplayLevel defaultDisplayLevel() {
220 return DisplayLevel.summary;
221 }
222
223 protected Searchability defaultSearchability() {
224 return Searchability.yes;
225 }
226
227 protected Integer defaultDisplayOrderPriority() {
228 return new Integer(1);
229 }
230
231 protected String defaultDisplayName() {
232 return "Product";
233 }
234
235 protected int defaultDisplayOrder() {
236 return 2;
237 }
238
239 protected boolean defaultIndexed() {
240 return true;
241 }
242
243 protected String defaultRenderinfo() {
244 return "SelectionWindow";
245 }
246
247 public Object getRaw_unsafe(Persistent g)
248 throws AccessPoemException {
249 return ((ShopOrderItem)g).getProduct_unsafe();
250 }
251
252 public void setRaw_unsafe(Persistent g, Object raw)
253 throws AccessPoemException {
254 ((ShopOrderItem)g).setProduct_unsafe((Integer)raw);
255 }
256
257 public Object getRaw(Persistent g)
258 throws AccessPoemException {
259 return ((ShopOrderItem)g).getProductTroid();
260 }
261
262 public void setRaw(Persistent g, Object raw)
263 throws AccessPoemException {
264 ((ShopOrderItem)g).setProductTroid((Integer)raw);
265 }
266 });
267
268 defineColumn(col_quantity =
269 new Column(this, "quantity",
270 new IntegerPoemType(false),
271 DefinitionSource.dsd) {
272 public Object getCooked(Persistent g)
273 throws AccessPoemException, PoemException {
274 return ((ShopOrderItem)g).getQuantity();
275 }
276
277 public void setCooked(Persistent g, Object cooked)
278 throws AccessPoemException, ValidationPoemException {
279 ((ShopOrderItem)g).setQuantity((Integer)cooked);
280 }
281
282 public Field asField(Persistent g) {
283 return ((ShopOrderItem)g).getQuantityField();
284 }
285
286 protected DisplayLevel defaultDisplayLevel() {
287 return DisplayLevel.summary;
288 }
289
290 protected Searchability defaultSearchability() {
291 return Searchability.yes;
292 }
293
294 protected String defaultDisplayName() {
295 return "Quantity";
296 }
297
298 protected int defaultDisplayOrder() {
299 return 3;
300 }
301
302 public Object getRaw_unsafe(Persistent g)
303 throws AccessPoemException {
304 return ((ShopOrderItem)g).getQuantity_unsafe();
305 }
306
307 public void setRaw_unsafe(Persistent g, Object raw)
308 throws AccessPoemException {
309 ((ShopOrderItem)g).setQuantity_unsafe((Integer)raw);
310 }
311
312 public Object getRaw(Persistent g)
313 throws AccessPoemException {
314 return ((ShopOrderItem)g).getQuantity();
315 }
316
317 public void setRaw(Persistent g, Object raw)
318 throws AccessPoemException {
319 ((ShopOrderItem)g).setQuantity((Integer)raw);
320 }
321 });
322
323 defineColumn(col_order =
324 new Column(this, "order",
325 new ReferencePoemType(getRimauresqDatabaseTables().
326 getShopOrderTable(), false),
327 DefinitionSource.dsd) {
328 public Object getCooked(Persistent g)
329 throws AccessPoemException, PoemException {
330 return ((ShopOrderItem)g).getOrder();
331 }
332
333 public void setCooked(Persistent g, Object cooked)
334 throws AccessPoemException, ValidationPoemException {
335 ((ShopOrderItem)g).setOrder((ShopOrder)cooked);
336 }
337
338 public Field asField(Persistent g) {
339 return ((ShopOrderItem)g).getOrderField();
340 }
341
342 protected DisplayLevel defaultDisplayLevel() {
343 return DisplayLevel.record;
344 }
345
346 protected Searchability defaultSearchability() {
347 return Searchability.yes;
348 }
349
350 protected String defaultDisplayName() {
351 return "Order Number";
352 }
353
354 protected int defaultDisplayOrder() {
355 return 4;
356 }
357
358 protected String defaultDescription() {
359 return "The order number for this pruchase";
360 }
361
362 public Object getRaw_unsafe(Persistent g)
363 throws AccessPoemException {
364 return ((ShopOrderItem)g).getOrder_unsafe();
365 }
366
367 public void setRaw_unsafe(Persistent g, Object raw)
368 throws AccessPoemException {
369 ((ShopOrderItem)g).setOrder_unsafe((Integer)raw);
370 }
371
372 public Object getRaw(Persistent g)
373 throws AccessPoemException {
374 return ((ShopOrderItem)g).getOrderTroid();
375 }
376
377 public void setRaw(Persistent g, Object raw)
378 throws AccessPoemException {
379 ((ShopOrderItem)g).setOrderTroid((Integer)raw);
380 }
381 });
382
383 defineColumn(col_amount =
384 new Column(this, "amount",
385 new DoublePoemType(false),
386 DefinitionSource.dsd) {
387 public Object getCooked(Persistent g)
388 throws AccessPoemException, PoemException {
389 return ((ShopOrderItem)g).getAmount();
390 }
391
392 public void setCooked(Persistent g, Object cooked)
393 throws AccessPoemException, ValidationPoemException {
394 ((ShopOrderItem)g).setAmount((Double)cooked);
395 }
396
397 public Field asField(Persistent g) {
398 return ((ShopOrderItem)g).getAmountField();
399 }
400
401 protected DisplayLevel defaultDisplayLevel() {
402 return DisplayLevel.record;
403 }
404
405 protected Searchability defaultSearchability() {
406 return Searchability.no;
407 }
408
409 protected String defaultDisplayName() {
410 return "Amount (in GBP)";
411 }
412
413 protected int defaultDisplayOrder() {
414 return 5;
415 }
416
417 protected String defaultDescription() {
418 return "The amount of this line (in GBP)";
419 }
420
421 public Object getRaw_unsafe(Persistent g)
422 throws AccessPoemException {
423 return ((ShopOrderItem)g).getAmount_unsafe();
424 }
425
426 public void setRaw_unsafe(Persistent g, Object raw)
427 throws AccessPoemException {
428 ((ShopOrderItem)g).setAmount_unsafe((Double)raw);
429 }
430
431 public Object getRaw(Persistent g)
432 throws AccessPoemException {
433 return ((ShopOrderItem)g).getAmount();
434 }
435
436 public void setRaw(Persistent g, Object raw)
437 throws AccessPoemException {
438 ((ShopOrderItem)g).setAmount((Double)raw);
439 }
440 });
441 }
442
443
444
445
446
447
448
449
450
451 public final Column getIdColumn() {
452 return col_id;
453 }
454
455
456
457
458
459
460
461
462
463 public final Column getUserColumn() {
464 return col_user;
465 }
466
467
468
469
470
471
472
473
474
475 public final Column getProductColumn() {
476 return col_product;
477 }
478
479
480
481
482
483
484
485
486
487 public final Column getQuantityColumn() {
488 return col_quantity;
489 }
490
491
492
493
494
495
496
497
498
499 public final Column getOrderColumn() {
500 return col_order;
501 }
502
503
504
505
506
507
508
509
510
511 public final Column getAmountColumn() {
512 return col_amount;
513 }
514
515
516
517
518
519
520
521
522
523 public ShopOrderItem getShopOrderItemObject(Integer troid) {
524 return (ShopOrderItem)getObject(troid);
525 }
526
527
528
529
530
531
532
533
534
535 public ShopOrderItem getShopOrderItemObject(int troid) {
536 return (ShopOrderItem)getObject(troid);
537 }
538
539 protected JdbcPersistent _newPersistent() {
540 return new ShopOrderItem();
541 }
542 protected String defaultDisplayName() {
543 return "Order Item";
544 }
545
546 protected String defaultDescription() {
547 return "Order Item";
548 }
549
550 protected String defaultCategory() {
551 return "Data";
552 }
553
554 protected int defaultDisplayOrder() {
555 return 70;
556 }
557 }
558