1
2
3 package org.paneris.bibliomania.generated;
4
5
6 import org.melati.poem.AccessPoemException;
7 import org.melati.poem.Column;
8 import org.melati.poem.Database;
9 import org.melati.poem.DefinitionSource;
10 import org.melati.poem.DisplayLevel;
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.Searchability;
16 import org.melati.poem.StringPoemType;
17 import org.melati.poem.TroidPoemType;
18 import org.melati.poem.ValidationPoemException;
19 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
20 import org.paneris.bibliomania.BibliomaniaTable;
21 import org.paneris.bibliomania.Supplier;
22
23
24
25
26
27
28
29
30 public class SupplierTableBase<T extends Supplier> extends BibliomaniaTable<T> {
31
32 private Column<Integer> col_id = null;
33 private Column<String> col_name = null;
34 private Column<String> col_address = null;
35 private Column<String> col_contact = null;
36 private Column<String> col_email = null;
37 private Column<String> col_website = null;
38 private Column<String> col_location = null;
39
40
41
42
43
44
45
46
47
48
49
50 public SupplierTableBase(
51 Database database, String name,
52 DefinitionSource definitionSource) throws PoemException {
53 super(database, name, definitionSource);
54 }
55
56
57
58
59
60
61
62
63 public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
64 return (BibliomaniaDatabaseTables)getDatabase();
65 }
66
67
68
69
70
71
72
73 public void init() throws PoemException {
74 super.init();
75 defineColumn(col_id =
76 new Column<Integer>(this, "id",
77 new TroidPoemType(),
78 DefinitionSource.dsd) {
79 public Object getCooked(Persistent g)
80 throws AccessPoemException, PoemException {
81 return ((Supplier)g).getId();
82 }
83
84 public void setCooked(Persistent g, Object cooked)
85 throws AccessPoemException, ValidationPoemException {
86 ((Supplier)g).setId((Integer)cooked);
87 }
88
89 public Field<Integer> asField(Persistent g) {
90 return ((Supplier)g).getIdField();
91 }
92
93 public boolean defaultUserEditable() {
94 return false;
95 }
96
97 public boolean defaultUserCreateable() {
98 return false;
99 }
100
101 public DisplayLevel defaultDisplayLevel() {
102 return DisplayLevel.record;
103 }
104
105 public Searchability defaultSearchability() {
106 return Searchability.no;
107 }
108
109 public int defaultDisplayOrder() {
110 return 0;
111 }
112
113 public Object getRaw_unsafe(Persistent g)
114 throws AccessPoemException {
115 return ((Supplier)g).getId_unsafe();
116 }
117
118 public void setRaw_unsafe(Persistent g, Object raw)
119 throws AccessPoemException {
120 ((Supplier)g).setId_unsafe((Integer)raw);
121 }
122
123 public Object getRaw(Persistent g)
124 throws AccessPoemException {
125 return ((Supplier)g).getId();
126 }
127
128 public void setRaw(Persistent g, Object raw)
129 throws AccessPoemException {
130 ((Supplier)g).setId((Integer)raw);
131 }
132 });
133
134 defineColumn(col_name =
135 new Column<String>(this, "name",
136 new StringPoemType(false, -1),
137 DefinitionSource.dsd) {
138 public Object getCooked(Persistent g)
139 throws AccessPoemException, PoemException {
140 return ((Supplier)g).getName();
141 }
142
143 public void setCooked(Persistent g, Object cooked)
144 throws AccessPoemException, ValidationPoemException {
145 ((Supplier)g).setName((String)cooked);
146 }
147
148 public Field<String> asField(Persistent g) {
149 return ((Supplier)g).getNameField();
150 }
151
152 public DisplayLevel defaultDisplayLevel() {
153 return DisplayLevel.primary;
154 }
155
156 public Searchability defaultSearchability() {
157 return Searchability.yes;
158 }
159
160 public String defaultDisplayName() {
161 return "Name";
162 }
163
164 public int defaultDisplayOrder() {
165 return 1;
166 }
167
168 public String defaultDescription() {
169 return "The full name of the Supplier";
170 }
171
172 public boolean defaultUnique() {
173 return true;
174 }
175
176 public int defaultWidth() {
177 return 20;
178 }
179
180 public Object getRaw_unsafe(Persistent g)
181 throws AccessPoemException {
182 return ((Supplier)g).getName_unsafe();
183 }
184
185 public void setRaw_unsafe(Persistent g, Object raw)
186 throws AccessPoemException {
187 ((Supplier)g).setName_unsafe((String)raw);
188 }
189
190 public Object getRaw(Persistent g)
191 throws AccessPoemException {
192 return ((Supplier)g).getName();
193 }
194
195 public void setRaw(Persistent g, Object raw)
196 throws AccessPoemException {
197 ((Supplier)g).setName((String)raw);
198 }
199 });
200
201 defineColumn(col_address =
202 new Column<String>(this, "address",
203 new StringPoemType(true, -1),
204 DefinitionSource.dsd) {
205 public Object getCooked(Persistent g)
206 throws AccessPoemException, PoemException {
207 return ((Supplier)g).getAddress();
208 }
209
210 public void setCooked(Persistent g, Object cooked)
211 throws AccessPoemException, ValidationPoemException {
212 ((Supplier)g).setAddress((String)cooked);
213 }
214
215 public Field<String> asField(Persistent g) {
216 return ((Supplier)g).getAddressField();
217 }
218
219 public DisplayLevel defaultDisplayLevel() {
220 return DisplayLevel.record;
221 }
222
223 public Searchability defaultSearchability() {
224 return Searchability.no;
225 }
226
227 public String defaultDisplayName() {
228 return "Address";
229 }
230
231 public int defaultDisplayOrder() {
232 return 2;
233 }
234
235 public String defaultDescription() {
236 return "A postal address for the Supplier";
237 }
238
239 public int defaultWidth() {
240 return 20;
241 }
242
243 public int defaultHeight() {
244 return 5;
245 }
246
247 public Object getRaw_unsafe(Persistent g)
248 throws AccessPoemException {
249 return ((Supplier)g).getAddress_unsafe();
250 }
251
252 public void setRaw_unsafe(Persistent g, Object raw)
253 throws AccessPoemException {
254 ((Supplier)g).setAddress_unsafe((String)raw);
255 }
256
257 public Object getRaw(Persistent g)
258 throws AccessPoemException {
259 return ((Supplier)g).getAddress();
260 }
261
262 public void setRaw(Persistent g, Object raw)
263 throws AccessPoemException {
264 ((Supplier)g).setAddress((String)raw);
265 }
266 });
267
268 defineColumn(col_contact =
269 new Column<String>(this, "contact",
270 new StringPoemType(true, -1),
271 DefinitionSource.dsd) {
272 public Object getCooked(Persistent g)
273 throws AccessPoemException, PoemException {
274 return ((Supplier)g).getContact();
275 }
276
277 public void setCooked(Persistent g, Object cooked)
278 throws AccessPoemException, ValidationPoemException {
279 ((Supplier)g).setContact((String)cooked);
280 }
281
282 public Field<String> asField(Persistent g) {
283 return ((Supplier)g).getContactField();
284 }
285
286 public DisplayLevel defaultDisplayLevel() {
287 return DisplayLevel.summary;
288 }
289
290 public Searchability defaultSearchability() {
291 return Searchability.yes;
292 }
293
294 public String defaultDisplayName() {
295 return "Contact Name";
296 }
297
298 public int defaultDisplayOrder() {
299 return 3;
300 }
301
302 public String defaultDescription() {
303 return "The person who will deal with queries";
304 }
305
306 public boolean defaultUnique() {
307 return true;
308 }
309
310 public int defaultWidth() {
311 return 20;
312 }
313
314 public Object getRaw_unsafe(Persistent g)
315 throws AccessPoemException {
316 return ((Supplier)g).getContact_unsafe();
317 }
318
319 public void setRaw_unsafe(Persistent g, Object raw)
320 throws AccessPoemException {
321 ((Supplier)g).setContact_unsafe((String)raw);
322 }
323
324 public Object getRaw(Persistent g)
325 throws AccessPoemException {
326 return ((Supplier)g).getContact();
327 }
328
329 public void setRaw(Persistent g, Object raw)
330 throws AccessPoemException {
331 ((Supplier)g).setContact((String)raw);
332 }
333 });
334
335 defineColumn(col_email =
336 new Column<String>(this, "email",
337 new StringPoemType(false, -1),
338 DefinitionSource.dsd) {
339 public Object getCooked(Persistent g)
340 throws AccessPoemException, PoemException {
341 return ((Supplier)g).getEmail();
342 }
343
344 public void setCooked(Persistent g, Object cooked)
345 throws AccessPoemException, ValidationPoemException {
346 ((Supplier)g).setEmail((String)cooked);
347 }
348
349 public Field<String> asField(Persistent g) {
350 return ((Supplier)g).getEmailField();
351 }
352
353 public DisplayLevel defaultDisplayLevel() {
354 return DisplayLevel.record;
355 }
356
357 public Searchability defaultSearchability() {
358 return Searchability.no;
359 }
360
361 public String defaultDisplayName() {
362 return "email";
363 }
364
365 public int defaultDisplayOrder() {
366 return 4;
367 }
368
369 public String defaultDescription() {
370 return "An email address used to submit orders to this Supplier";
371 }
372
373 public int defaultWidth() {
374 return 40;
375 }
376
377 public Object getRaw_unsafe(Persistent g)
378 throws AccessPoemException {
379 return ((Supplier)g).getEmail_unsafe();
380 }
381
382 public void setRaw_unsafe(Persistent g, Object raw)
383 throws AccessPoemException {
384 ((Supplier)g).setEmail_unsafe((String)raw);
385 }
386
387 public Object getRaw(Persistent g)
388 throws AccessPoemException {
389 return ((Supplier)g).getEmail();
390 }
391
392 public void setRaw(Persistent g, Object raw)
393 throws AccessPoemException {
394 ((Supplier)g).setEmail((String)raw);
395 }
396 });
397
398 defineColumn(col_website =
399 new Column<String>(this, "website",
400 new StringPoemType(true, -1),
401 DefinitionSource.dsd) {
402 public Object getCooked(Persistent g)
403 throws AccessPoemException, PoemException {
404 return ((Supplier)g).getWebsite();
405 }
406
407 public void setCooked(Persistent g, Object cooked)
408 throws AccessPoemException, ValidationPoemException {
409 ((Supplier)g).setWebsite((String)cooked);
410 }
411
412 public Field<String> asField(Persistent g) {
413 return ((Supplier)g).getWebsiteField();
414 }
415
416 public DisplayLevel defaultDisplayLevel() {
417 return DisplayLevel.record;
418 }
419
420 public Searchability defaultSearchability() {
421 return Searchability.no;
422 }
423
424 public String defaultDisplayName() {
425 return "Website";
426 }
427
428 public int defaultDisplayOrder() {
429 return 5;
430 }
431
432 public String defaultDescription() {
433 return "The website for this supplier, if they have one";
434 }
435
436 public int defaultWidth() {
437 return 40;
438 }
439
440 public Object getRaw_unsafe(Persistent g)
441 throws AccessPoemException {
442 return ((Supplier)g).getWebsite_unsafe();
443 }
444
445 public void setRaw_unsafe(Persistent g, Object raw)
446 throws AccessPoemException {
447 ((Supplier)g).setWebsite_unsafe((String)raw);
448 }
449
450 public Object getRaw(Persistent g)
451 throws AccessPoemException {
452 return ((Supplier)g).getWebsite();
453 }
454
455 public void setRaw(Persistent g, Object raw)
456 throws AccessPoemException {
457 ((Supplier)g).setWebsite((String)raw);
458 }
459 });
460
461 defineColumn(col_location =
462 new Column<String>(this, "location",
463 new StringPoemType(false, -1),
464 DefinitionSource.dsd) {
465 public Object getCooked(Persistent g)
466 throws AccessPoemException, PoemException {
467 return ((Supplier)g).getLocation();
468 }
469
470 public void setCooked(Persistent g, Object cooked)
471 throws AccessPoemException, ValidationPoemException {
472 ((Supplier)g).setLocation((String)cooked);
473 }
474
475 public Field<String> asField(Persistent g) {
476 return ((Supplier)g).getLocationField();
477 }
478
479 public DisplayLevel defaultDisplayLevel() {
480 return DisplayLevel.record;
481 }
482
483 public Searchability defaultSearchability() {
484 return Searchability.no;
485 }
486
487 public int defaultDisplayOrder() {
488 return 6;
489 }
490
491 public String defaultDescription() {
492 return "The Location of this supplier (eg London)";
493 }
494
495 public int defaultWidth() {
496 return 40;
497 }
498
499 public Object getRaw_unsafe(Persistent g)
500 throws AccessPoemException {
501 return ((Supplier)g).getLocation_unsafe();
502 }
503
504 public void setRaw_unsafe(Persistent g, Object raw)
505 throws AccessPoemException {
506 ((Supplier)g).setLocation_unsafe((String)raw);
507 }
508
509 public Object getRaw(Persistent g)
510 throws AccessPoemException {
511 return ((Supplier)g).getLocation();
512 }
513
514 public void setRaw(Persistent g, Object raw)
515 throws AccessPoemException {
516 ((Supplier)g).setLocation((String)raw);
517 }
518 });
519 }
520
521
522
523
524
525
526
527
528
529 public final Column<Integer> getIdColumn() {
530 return col_id;
531 }
532
533
534
535
536
537
538
539
540
541 public final Column<String> getNameColumn() {
542 return col_name;
543 }
544
545
546
547
548
549
550
551
552
553 public final Column<String> getAddressColumn() {
554 return col_address;
555 }
556
557
558
559
560
561
562
563
564
565 public final Column<String> getContactColumn() {
566 return col_contact;
567 }
568
569
570
571
572
573
574
575
576
577 public final Column<String> getEmailColumn() {
578 return col_email;
579 }
580
581
582
583
584
585
586
587
588
589 public final Column<String> getWebsiteColumn() {
590 return col_website;
591 }
592
593
594
595
596
597
598
599
600
601 public final Column<String> getLocationColumn() {
602 return col_location;
603 }
604
605
606
607
608
609
610
611
612
613 public Supplier getSupplierObject(Integer troid) {
614 return (Supplier)getObject(troid);
615 }
616
617
618
619
620
621
622
623
624
625 public Supplier getSupplierObject(int troid) {
626 return (Supplier)getObject(troid);
627 }
628
629 protected JdbcPersistent _newPersistent() {
630 return new Supplier();
631 }
632 public String defaultDisplayName() {
633 return "Supplier";
634 }
635
636 public String defaultDescription() {
637 return "Product Supplier";
638 }
639
640 public boolean defaultRememberAllTroids() {
641 return true;
642 }
643
644 public String defaultCategory() {
645 return "Shop";
646 }
647
648 public int defaultDisplayOrder() {
649 return 1210;
650 }
651 }
652