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.DeletedPoemType; |
11 | |
import org.melati.poem.DisplayLevel; |
12 | |
import org.melati.poem.DoublePoemType; |
13 | |
import org.melati.poem.Field; |
14 | |
import org.melati.poem.JdbcPersistent; |
15 | |
import org.melati.poem.Persistent; |
16 | |
import org.melati.poem.PoemException; |
17 | |
import org.melati.poem.ReferencePoemType; |
18 | |
import org.melati.poem.Searchability; |
19 | |
import org.melati.poem.StandardIntegrityFix; |
20 | |
import org.melati.poem.StringPoemType; |
21 | |
import org.melati.poem.TroidPoemType; |
22 | |
import org.melati.poem.ValidationPoemException; |
23 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
24 | |
import org.paneris.bibliomania.BibliomaniaTable; |
25 | |
import org.paneris.bibliomania.Book; |
26 | |
import org.paneris.bibliomania.BookFormat; |
27 | |
import org.paneris.bibliomania.Download; |
28 | |
import org.paneris.bibliomania.Product; |
29 | |
import org.paneris.bibliomania.Publisher; |
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
public class ProductTableBase<T extends Product> extends BibliomaniaTable<T> { |
39 | |
|
40 | 2 | private Column<Integer> col_id = null; |
41 | 2 | private Column<Integer> col_book = null; |
42 | 2 | private Column<Integer> col_publisher = null; |
43 | 2 | private Column<Integer> col_download = null; |
44 | 2 | private Column<String> col_name = null; |
45 | 2 | private Column<String> col_description = null; |
46 | 2 | private Column<Double> col_price = null; |
47 | 2 | private Column<Double> col_listprice = null; |
48 | 2 | private Column<String> col_ISBN = null; |
49 | 2 | private Column<String> col_picture = null; |
50 | 2 | private Column<Boolean> col_deleted = null; |
51 | 2 | private Column<Integer> col_format = null; |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
public ProductTableBase( |
64 | |
Database database, String name, |
65 | |
DefinitionSource definitionSource) throws PoemException { |
66 | 2 | super(database, name, definitionSource); |
67 | 2 | } |
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
77 | 8 | return (BibliomaniaDatabaseTables)getDatabase(); |
78 | |
} |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public void init() throws PoemException { |
87 | 2 | super.init(); |
88 | 2 | defineColumn(col_id = |
89 | |
new Column<Integer>(this, "id", |
90 | |
new TroidPoemType(), |
91 | 2 | DefinitionSource.dsd) { |
92 | |
public Object getCooked(Persistent g) |
93 | |
throws AccessPoemException, PoemException { |
94 | 0 | return ((Product)g).getId(); |
95 | |
} |
96 | |
|
97 | |
public void setCooked(Persistent g, Object cooked) |
98 | |
throws AccessPoemException, ValidationPoemException { |
99 | 0 | ((Product)g).setId((Integer)cooked); |
100 | 0 | } |
101 | |
|
102 | |
public Field<Integer> asField(Persistent g) { |
103 | 0 | return ((Product)g).getIdField(); |
104 | |
} |
105 | |
|
106 | |
public boolean defaultUserEditable() { |
107 | 0 | return false; |
108 | |
} |
109 | |
|
110 | |
public boolean defaultUserCreateable() { |
111 | 0 | return false; |
112 | |
} |
113 | |
|
114 | |
public DisplayLevel defaultDisplayLevel() { |
115 | 0 | return DisplayLevel.summary; |
116 | |
} |
117 | |
|
118 | |
public Searchability defaultSearchability() { |
119 | 0 | return Searchability.yes; |
120 | |
} |
121 | |
|
122 | |
public int defaultDisplayOrder() { |
123 | 0 | return 0; |
124 | |
} |
125 | |
|
126 | |
public Object getRaw_unsafe(Persistent g) |
127 | |
throws AccessPoemException { |
128 | 0 | return ((Product)g).getId_unsafe(); |
129 | |
} |
130 | |
|
131 | |
public void setRaw_unsafe(Persistent g, Object raw) |
132 | |
throws AccessPoemException { |
133 | 0 | ((Product)g).setId_unsafe((Integer)raw); |
134 | 0 | } |
135 | |
|
136 | |
public Object getRaw(Persistent g) |
137 | |
throws AccessPoemException { |
138 | 0 | return ((Product)g).getId(); |
139 | |
} |
140 | |
|
141 | |
public void setRaw(Persistent g, Object raw) |
142 | |
throws AccessPoemException { |
143 | 0 | ((Product)g).setId((Integer)raw); |
144 | 0 | } |
145 | |
}); |
146 | |
|
147 | 2 | defineColumn(col_book = |
148 | |
new Column<Integer>(this, "book", |
149 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
150 | |
getBookTable(), false), |
151 | 2 | DefinitionSource.dsd) { |
152 | |
public Object getCooked(Persistent g) |
153 | |
throws AccessPoemException, PoemException { |
154 | 0 | return ((Product)g).getBook(); |
155 | |
} |
156 | |
|
157 | |
public void setCooked(Persistent g, Object cooked) |
158 | |
throws AccessPoemException, ValidationPoemException { |
159 | 0 | ((Product)g).setBook((Book)cooked); |
160 | 0 | } |
161 | |
|
162 | |
public Field<Integer> asField(Persistent g) { |
163 | 0 | return ((Product)g).getBookField(); |
164 | |
} |
165 | |
|
166 | |
public DisplayLevel defaultDisplayLevel() { |
167 | 0 | return DisplayLevel.primary; |
168 | |
} |
169 | |
|
170 | |
public Searchability defaultSearchability() { |
171 | 0 | return Searchability.primary; |
172 | |
} |
173 | |
|
174 | |
public int defaultDisplayOrder() { |
175 | 0 | return 1; |
176 | |
} |
177 | |
|
178 | |
public String defaultDescription() { |
179 | 0 | return "The book to be sold"; |
180 | |
} |
181 | |
|
182 | |
public boolean defaultIndexed() { |
183 | 0 | return true; |
184 | |
} |
185 | |
|
186 | |
public String defaultRenderinfo() { |
187 | 0 | return "SelectionWindow"; |
188 | |
} |
189 | |
|
190 | |
public Object getRaw_unsafe(Persistent g) |
191 | |
throws AccessPoemException { |
192 | 0 | return ((Product)g).getBook_unsafe(); |
193 | |
} |
194 | |
|
195 | |
public void setRaw_unsafe(Persistent g, Object raw) |
196 | |
throws AccessPoemException { |
197 | 0 | ((Product)g).setBook_unsafe((Integer)raw); |
198 | 0 | } |
199 | |
|
200 | |
public Object getRaw(Persistent g) |
201 | |
throws AccessPoemException { |
202 | 0 | return ((Product)g).getBookTroid(); |
203 | |
} |
204 | |
|
205 | |
public void setRaw(Persistent g, Object raw) |
206 | |
throws AccessPoemException { |
207 | 0 | ((Product)g).setBookTroid((Integer)raw); |
208 | 0 | } |
209 | |
|
210 | |
public StandardIntegrityFix defaultIntegrityFix() { |
211 | 0 | return StandardIntegrityFix.delete; |
212 | |
} |
213 | |
}); |
214 | |
|
215 | 2 | defineColumn(col_publisher = |
216 | |
new Column<Integer>(this, "publisher", |
217 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
218 | |
getPublisherTable(), true), |
219 | 2 | DefinitionSource.dsd) { |
220 | |
public Object getCooked(Persistent g) |
221 | |
throws AccessPoemException, PoemException { |
222 | 0 | return ((Product)g).getPublisher(); |
223 | |
} |
224 | |
|
225 | |
public void setCooked(Persistent g, Object cooked) |
226 | |
throws AccessPoemException, ValidationPoemException { |
227 | 0 | ((Product)g).setPublisher((Publisher)cooked); |
228 | 0 | } |
229 | |
|
230 | |
public Field<Integer> asField(Persistent g) { |
231 | 0 | return ((Product)g).getPublisherField(); |
232 | |
} |
233 | |
|
234 | |
public DisplayLevel defaultDisplayLevel() { |
235 | 0 | return DisplayLevel.record; |
236 | |
} |
237 | |
|
238 | |
public Searchability defaultSearchability() { |
239 | 0 | return Searchability.yes; |
240 | |
} |
241 | |
|
242 | |
public int defaultDisplayOrder() { |
243 | 0 | return 2; |
244 | |
} |
245 | |
|
246 | |
public String defaultDescription() { |
247 | 0 | return "The publisher for this product"; |
248 | |
} |
249 | |
|
250 | |
public boolean defaultIndexed() { |
251 | 0 | return true; |
252 | |
} |
253 | |
|
254 | |
public Object getRaw_unsafe(Persistent g) |
255 | |
throws AccessPoemException { |
256 | 0 | return ((Product)g).getPublisher_unsafe(); |
257 | |
} |
258 | |
|
259 | |
public void setRaw_unsafe(Persistent g, Object raw) |
260 | |
throws AccessPoemException { |
261 | 0 | ((Product)g).setPublisher_unsafe((Integer)raw); |
262 | 0 | } |
263 | |
|
264 | |
public Object getRaw(Persistent g) |
265 | |
throws AccessPoemException { |
266 | 0 | return ((Product)g).getPublisherTroid(); |
267 | |
} |
268 | |
|
269 | |
public void setRaw(Persistent g, Object raw) |
270 | |
throws AccessPoemException { |
271 | 0 | ((Product)g).setPublisherTroid((Integer)raw); |
272 | 0 | } |
273 | |
}); |
274 | |
|
275 | 2 | defineColumn(col_download = |
276 | |
new Column<Integer>(this, "download", |
277 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
278 | |
getDownloadTable(), true), |
279 | 2 | DefinitionSource.dsd) { |
280 | |
public Object getCooked(Persistent g) |
281 | |
throws AccessPoemException, PoemException { |
282 | 0 | return ((Product)g).getDownload(); |
283 | |
} |
284 | |
|
285 | |
public void setCooked(Persistent g, Object cooked) |
286 | |
throws AccessPoemException, ValidationPoemException { |
287 | 0 | ((Product)g).setDownload((Download)cooked); |
288 | 0 | } |
289 | |
|
290 | |
public Field<Integer> asField(Persistent g) { |
291 | 0 | return ((Product)g).getDownloadField(); |
292 | |
} |
293 | |
|
294 | |
public DisplayLevel defaultDisplayLevel() { |
295 | 0 | return DisplayLevel.record; |
296 | |
} |
297 | |
|
298 | |
public Searchability defaultSearchability() { |
299 | 0 | return Searchability.yes; |
300 | |
} |
301 | |
|
302 | |
public int defaultDisplayOrder() { |
303 | 0 | return 3; |
304 | |
} |
305 | |
|
306 | |
public String defaultDescription() { |
307 | 0 | return "The download object for this product (if any)"; |
308 | |
} |
309 | |
|
310 | |
public Object getRaw_unsafe(Persistent g) |
311 | |
throws AccessPoemException { |
312 | 0 | return ((Product)g).getDownload_unsafe(); |
313 | |
} |
314 | |
|
315 | |
public void setRaw_unsafe(Persistent g, Object raw) |
316 | |
throws AccessPoemException { |
317 | 0 | ((Product)g).setDownload_unsafe((Integer)raw); |
318 | 0 | } |
319 | |
|
320 | |
public Object getRaw(Persistent g) |
321 | |
throws AccessPoemException { |
322 | 0 | return ((Product)g).getDownloadTroid(); |
323 | |
} |
324 | |
|
325 | |
public void setRaw(Persistent g, Object raw) |
326 | |
throws AccessPoemException { |
327 | 0 | ((Product)g).setDownloadTroid((Integer)raw); |
328 | 0 | } |
329 | |
}); |
330 | |
|
331 | 2 | defineColumn(col_name = |
332 | |
new Column<String>(this, "name", |
333 | |
new StringPoemType(true, -1), |
334 | 2 | DefinitionSource.dsd) { |
335 | |
public Object getCooked(Persistent g) |
336 | |
throws AccessPoemException, PoemException { |
337 | 0 | return ((Product)g).getName(); |
338 | |
} |
339 | |
|
340 | |
public void setCooked(Persistent g, Object cooked) |
341 | |
throws AccessPoemException, ValidationPoemException { |
342 | 0 | ((Product)g).setName((String)cooked); |
343 | 0 | } |
344 | |
|
345 | |
public Field<String> asField(Persistent g) { |
346 | 0 | return ((Product)g).getNameField(); |
347 | |
} |
348 | |
|
349 | |
public DisplayLevel defaultDisplayLevel() { |
350 | 0 | return DisplayLevel.summary; |
351 | |
} |
352 | |
|
353 | |
public Searchability defaultSearchability() { |
354 | 0 | return Searchability.yes; |
355 | |
} |
356 | |
|
357 | |
public String defaultDisplayName() { |
358 | 0 | return "Product Name"; |
359 | |
} |
360 | |
|
361 | |
public int defaultDisplayOrder() { |
362 | 0 | return 4; |
363 | |
} |
364 | |
|
365 | |
public String defaultDescription() { |
366 | 0 | return "A name for this product if different to the Book title"; |
367 | |
} |
368 | |
|
369 | |
public int defaultWidth() { |
370 | 0 | return 20; |
371 | |
} |
372 | |
|
373 | |
public Object getRaw_unsafe(Persistent g) |
374 | |
throws AccessPoemException { |
375 | 0 | return ((Product)g).getName_unsafe(); |
376 | |
} |
377 | |
|
378 | |
public void setRaw_unsafe(Persistent g, Object raw) |
379 | |
throws AccessPoemException { |
380 | 0 | ((Product)g).setName_unsafe((String)raw); |
381 | 0 | } |
382 | |
|
383 | |
public Object getRaw(Persistent g) |
384 | |
throws AccessPoemException { |
385 | 0 | return ((Product)g).getName(); |
386 | |
} |
387 | |
|
388 | |
public void setRaw(Persistent g, Object raw) |
389 | |
throws AccessPoemException { |
390 | 0 | ((Product)g).setName((String)raw); |
391 | 0 | } |
392 | |
}); |
393 | |
|
394 | 2 | defineColumn(col_description = |
395 | |
new Column<String>(this, "description", |
396 | |
new StringPoemType(true, -1), |
397 | 2 | DefinitionSource.dsd) { |
398 | |
public Object getCooked(Persistent g) |
399 | |
throws AccessPoemException, PoemException { |
400 | 0 | return ((Product)g).getDescription(); |
401 | |
} |
402 | |
|
403 | |
public void setCooked(Persistent g, Object cooked) |
404 | |
throws AccessPoemException, ValidationPoemException { |
405 | 0 | ((Product)g).setDescription((String)cooked); |
406 | 0 | } |
407 | |
|
408 | |
public Field<String> asField(Persistent g) { |
409 | 0 | return ((Product)g).getDescriptionField(); |
410 | |
} |
411 | |
|
412 | |
public DisplayLevel defaultDisplayLevel() { |
413 | 0 | return DisplayLevel.record; |
414 | |
} |
415 | |
|
416 | |
public Searchability defaultSearchability() { |
417 | 0 | return Searchability.yes; |
418 | |
} |
419 | |
|
420 | |
public String defaultDisplayName() { |
421 | 0 | return "Description"; |
422 | |
} |
423 | |
|
424 | |
public int defaultDisplayOrder() { |
425 | 0 | return 5; |
426 | |
} |
427 | |
|
428 | |
public String defaultDescription() { |
429 | 0 | return "Additional blurb about the product "; |
430 | |
} |
431 | |
|
432 | |
public int defaultWidth() { |
433 | 0 | return 40; |
434 | |
} |
435 | |
|
436 | |
public int defaultHeight() { |
437 | 0 | return 8; |
438 | |
} |
439 | |
|
440 | |
public Object getRaw_unsafe(Persistent g) |
441 | |
throws AccessPoemException { |
442 | 0 | return ((Product)g).getDescription_unsafe(); |
443 | |
} |
444 | |
|
445 | |
public void setRaw_unsafe(Persistent g, Object raw) |
446 | |
throws AccessPoemException { |
447 | 0 | ((Product)g).setDescription_unsafe((String)raw); |
448 | 0 | } |
449 | |
|
450 | |
public Object getRaw(Persistent g) |
451 | |
throws AccessPoemException { |
452 | 0 | return ((Product)g).getDescription(); |
453 | |
} |
454 | |
|
455 | |
public void setRaw(Persistent g, Object raw) |
456 | |
throws AccessPoemException { |
457 | 0 | ((Product)g).setDescription((String)raw); |
458 | 0 | } |
459 | |
}); |
460 | |
|
461 | 2 | defineColumn(col_price = |
462 | |
new Column<Double>(this, "price", |
463 | |
new DoublePoemType(false), |
464 | 2 | DefinitionSource.dsd) { |
465 | |
public Object getCooked(Persistent g) |
466 | |
throws AccessPoemException, PoemException { |
467 | 0 | return ((Product)g).getPrice(); |
468 | |
} |
469 | |
|
470 | |
public void setCooked(Persistent g, Object cooked) |
471 | |
throws AccessPoemException, ValidationPoemException { |
472 | 0 | ((Product)g).setPrice((Double)cooked); |
473 | 0 | } |
474 | |
|
475 | |
public Field<Double> asField(Persistent g) { |
476 | 0 | return ((Product)g).getPriceField(); |
477 | |
} |
478 | |
|
479 | |
public DisplayLevel defaultDisplayLevel() { |
480 | 0 | return DisplayLevel.record; |
481 | |
} |
482 | |
|
483 | |
public Searchability defaultSearchability() { |
484 | 0 | return Searchability.no; |
485 | |
} |
486 | |
|
487 | |
public String defaultDisplayName() { |
488 | 0 | return "Retail Price"; |
489 | |
} |
490 | |
|
491 | |
public int defaultDisplayOrder() { |
492 | 0 | return 6; |
493 | |
} |
494 | |
|
495 | |
public String defaultDescription() { |
496 | 0 | return "Price payable by the customer, including discounts, excluding delivery"; |
497 | |
} |
498 | |
|
499 | |
public Object getRaw_unsafe(Persistent g) |
500 | |
throws AccessPoemException { |
501 | 0 | return ((Product)g).getPrice_unsafe(); |
502 | |
} |
503 | |
|
504 | |
public void setRaw_unsafe(Persistent g, Object raw) |
505 | |
throws AccessPoemException { |
506 | 0 | ((Product)g).setPrice_unsafe((Double)raw); |
507 | 0 | } |
508 | |
|
509 | |
public Object getRaw(Persistent g) |
510 | |
throws AccessPoemException { |
511 | 0 | return ((Product)g).getPrice(); |
512 | |
} |
513 | |
|
514 | |
public void setRaw(Persistent g, Object raw) |
515 | |
throws AccessPoemException { |
516 | 0 | ((Product)g).setPrice((Double)raw); |
517 | 0 | } |
518 | |
}); |
519 | |
|
520 | 2 | defineColumn(col_listprice = |
521 | |
new Column<Double>(this, "listprice", |
522 | |
new DoublePoemType(true), |
523 | 2 | DefinitionSource.dsd) { |
524 | |
public Object getCooked(Persistent g) |
525 | |
throws AccessPoemException, PoemException { |
526 | 0 | return ((Product)g).getListprice(); |
527 | |
} |
528 | |
|
529 | |
public void setCooked(Persistent g, Object cooked) |
530 | |
throws AccessPoemException, ValidationPoemException { |
531 | 0 | ((Product)g).setListprice((Double)cooked); |
532 | 0 | } |
533 | |
|
534 | |
public Field<Double> asField(Persistent g) { |
535 | 0 | return ((Product)g).getListpriceField(); |
536 | |
} |
537 | |
|
538 | |
public DisplayLevel defaultDisplayLevel() { |
539 | 0 | return DisplayLevel.record; |
540 | |
} |
541 | |
|
542 | |
public Searchability defaultSearchability() { |
543 | 0 | return Searchability.no; |
544 | |
} |
545 | |
|
546 | |
public String defaultDisplayName() { |
547 | 0 | return "List Price"; |
548 | |
} |
549 | |
|
550 | |
public int defaultDisplayOrder() { |
551 | 0 | return 7; |
552 | |
} |
553 | |
|
554 | |
public String defaultDescription() { |
555 | 0 | return "The normal selling price of the product, not including delivery"; |
556 | |
} |
557 | |
|
558 | |
public Object getRaw_unsafe(Persistent g) |
559 | |
throws AccessPoemException { |
560 | 0 | return ((Product)g).getListprice_unsafe(); |
561 | |
} |
562 | |
|
563 | |
public void setRaw_unsafe(Persistent g, Object raw) |
564 | |
throws AccessPoemException { |
565 | 0 | ((Product)g).setListprice_unsafe((Double)raw); |
566 | 0 | } |
567 | |
|
568 | |
public Object getRaw(Persistent g) |
569 | |
throws AccessPoemException { |
570 | 0 | return ((Product)g).getListprice(); |
571 | |
} |
572 | |
|
573 | |
public void setRaw(Persistent g, Object raw) |
574 | |
throws AccessPoemException { |
575 | 0 | ((Product)g).setListprice((Double)raw); |
576 | 0 | } |
577 | |
}); |
578 | |
|
579 | 2 | defineColumn(col_ISBN = |
580 | |
new Column<String>(this, "ISBN", |
581 | |
new StringPoemType(true, -1), |
582 | 2 | DefinitionSource.dsd) { |
583 | |
public Object getCooked(Persistent g) |
584 | |
throws AccessPoemException, PoemException { |
585 | 0 | return ((Product)g).getISBN(); |
586 | |
} |
587 | |
|
588 | |
public void setCooked(Persistent g, Object cooked) |
589 | |
throws AccessPoemException, ValidationPoemException { |
590 | 0 | ((Product)g).setISBN((String)cooked); |
591 | 0 | } |
592 | |
|
593 | |
public Field<String> asField(Persistent g) { |
594 | 0 | return ((Product)g).getISBNField(); |
595 | |
} |
596 | |
|
597 | |
public DisplayLevel defaultDisplayLevel() { |
598 | 0 | return DisplayLevel.record; |
599 | |
} |
600 | |
|
601 | |
public Searchability defaultSearchability() { |
602 | 0 | return Searchability.yes; |
603 | |
} |
604 | |
|
605 | |
public String defaultDisplayName() { |
606 | 0 | return "ISBN"; |
607 | |
} |
608 | |
|
609 | |
public int defaultDisplayOrder() { |
610 | 0 | return 8; |
611 | |
} |
612 | |
|
613 | |
public String defaultDescription() { |
614 | 0 | return "The ISBN number of this product (if any)"; |
615 | |
} |
616 | |
|
617 | |
public int defaultWidth() { |
618 | 0 | return 40; |
619 | |
} |
620 | |
|
621 | |
public Object getRaw_unsafe(Persistent g) |
622 | |
throws AccessPoemException { |
623 | 0 | return ((Product)g).getISBN_unsafe(); |
624 | |
} |
625 | |
|
626 | |
public void setRaw_unsafe(Persistent g, Object raw) |
627 | |
throws AccessPoemException { |
628 | 0 | ((Product)g).setISBN_unsafe((String)raw); |
629 | 0 | } |
630 | |
|
631 | |
public Object getRaw(Persistent g) |
632 | |
throws AccessPoemException { |
633 | 0 | return ((Product)g).getISBN(); |
634 | |
} |
635 | |
|
636 | |
public void setRaw(Persistent g, Object raw) |
637 | |
throws AccessPoemException { |
638 | 0 | ((Product)g).setISBN((String)raw); |
639 | 0 | } |
640 | |
}); |
641 | |
|
642 | 2 | defineColumn(col_picture = |
643 | |
new Column<String>(this, "picture", |
644 | |
new StringPoemType(true, -1), |
645 | 2 | DefinitionSource.dsd) { |
646 | |
public Object getCooked(Persistent g) |
647 | |
throws AccessPoemException, PoemException { |
648 | 0 | return ((Product)g).getPicture(); |
649 | |
} |
650 | |
|
651 | |
public void setCooked(Persistent g, Object cooked) |
652 | |
throws AccessPoemException, ValidationPoemException { |
653 | 0 | ((Product)g).setPicture((String)cooked); |
654 | 0 | } |
655 | |
|
656 | |
public Field<String> asField(Persistent g) { |
657 | 0 | return ((Product)g).getPictureField(); |
658 | |
} |
659 | |
|
660 | |
public DisplayLevel defaultDisplayLevel() { |
661 | 0 | return DisplayLevel.record; |
662 | |
} |
663 | |
|
664 | |
public Searchability defaultSearchability() { |
665 | 0 | return Searchability.no; |
666 | |
} |
667 | |
|
668 | |
public String defaultDisplayName() { |
669 | 0 | return "Picture"; |
670 | |
} |
671 | |
|
672 | |
public int defaultDisplayOrder() { |
673 | 0 | return 9; |
674 | |
} |
675 | |
|
676 | |
public String defaultDescription() { |
677 | 0 | return "A jacket cover image or similar"; |
678 | |
} |
679 | |
|
680 | |
public int defaultWidth() { |
681 | 0 | return 20; |
682 | |
} |
683 | |
|
684 | |
public String defaultRenderinfo() { |
685 | 0 | return "Upload"; |
686 | |
} |
687 | |
|
688 | |
public Object getRaw_unsafe(Persistent g) |
689 | |
throws AccessPoemException { |
690 | 0 | return ((Product)g).getPicture_unsafe(); |
691 | |
} |
692 | |
|
693 | |
public void setRaw_unsafe(Persistent g, Object raw) |
694 | |
throws AccessPoemException { |
695 | 0 | ((Product)g).setPicture_unsafe((String)raw); |
696 | 0 | } |
697 | |
|
698 | |
public Object getRaw(Persistent g) |
699 | |
throws AccessPoemException { |
700 | 0 | return ((Product)g).getPicture(); |
701 | |
} |
702 | |
|
703 | |
public void setRaw(Persistent g, Object raw) |
704 | |
throws AccessPoemException { |
705 | 0 | ((Product)g).setPicture((String)raw); |
706 | 0 | } |
707 | |
}); |
708 | |
|
709 | 2 | defineColumn(col_deleted = |
710 | |
new Column<Boolean>(this, "deleted", |
711 | |
new DeletedPoemType(), |
712 | 2 | DefinitionSource.dsd) { |
713 | |
public Object getCooked(Persistent g) |
714 | |
throws AccessPoemException, PoemException { |
715 | 0 | return ((Product)g).getDeleted(); |
716 | |
} |
717 | |
|
718 | |
public void setCooked(Persistent g, Object cooked) |
719 | |
throws AccessPoemException, ValidationPoemException { |
720 | 0 | ((Product)g).setDeleted((Boolean)cooked); |
721 | 0 | } |
722 | |
|
723 | |
public Field<Boolean> asField(Persistent g) { |
724 | 0 | return ((Product)g).getDeletedField(); |
725 | |
} |
726 | |
|
727 | |
public DisplayLevel defaultDisplayLevel() { |
728 | 0 | return DisplayLevel.record; |
729 | |
} |
730 | |
|
731 | |
public Searchability defaultSearchability() { |
732 | 0 | return Searchability.no; |
733 | |
} |
734 | |
|
735 | |
public String defaultDisplayName() { |
736 | 0 | return "Deleted?"; |
737 | |
} |
738 | |
|
739 | |
public int defaultDisplayOrder() { |
740 | 0 | return 10; |
741 | |
} |
742 | |
|
743 | |
public Object getRaw_unsafe(Persistent g) |
744 | |
throws AccessPoemException { |
745 | 0 | return ((Product)g).getDeleted_unsafe(); |
746 | |
} |
747 | |
|
748 | |
public void setRaw_unsafe(Persistent g, Object raw) |
749 | |
throws AccessPoemException { |
750 | 0 | ((Product)g).setDeleted_unsafe((Boolean)raw); |
751 | 0 | } |
752 | |
|
753 | |
public Object getRaw(Persistent g) |
754 | |
throws AccessPoemException { |
755 | 0 | return ((Product)g).getDeleted(); |
756 | |
} |
757 | |
|
758 | |
public void setRaw(Persistent g, Object raw) |
759 | |
throws AccessPoemException { |
760 | 0 | ((Product)g).setDeleted((Boolean)raw); |
761 | 0 | } |
762 | |
}); |
763 | |
|
764 | 2 | defineColumn(col_format = |
765 | |
new Column<Integer>(this, "format", |
766 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
767 | |
getBookFormatTable(), true), |
768 | 2 | DefinitionSource.dsd) { |
769 | |
public Object getCooked(Persistent g) |
770 | |
throws AccessPoemException, PoemException { |
771 | 0 | return ((Product)g).getFormat(); |
772 | |
} |
773 | |
|
774 | |
public void setCooked(Persistent g, Object cooked) |
775 | |
throws AccessPoemException, ValidationPoemException { |
776 | 0 | ((Product)g).setFormat((BookFormat)cooked); |
777 | 0 | } |
778 | |
|
779 | |
public Field<Integer> asField(Persistent g) { |
780 | 0 | return ((Product)g).getFormatField(); |
781 | |
} |
782 | |
|
783 | |
public DisplayLevel defaultDisplayLevel() { |
784 | 0 | return DisplayLevel.record; |
785 | |
} |
786 | |
|
787 | |
public Searchability defaultSearchability() { |
788 | 0 | return Searchability.yes; |
789 | |
} |
790 | |
|
791 | |
public int defaultDisplayOrder() { |
792 | 0 | return 11; |
793 | |
} |
794 | |
|
795 | |
public String defaultDescription() { |
796 | 0 | return "The type of the product"; |
797 | |
} |
798 | |
|
799 | |
public Object getRaw_unsafe(Persistent g) |
800 | |
throws AccessPoemException { |
801 | 0 | return ((Product)g).getFormat_unsafe(); |
802 | |
} |
803 | |
|
804 | |
public void setRaw_unsafe(Persistent g, Object raw) |
805 | |
throws AccessPoemException { |
806 | 0 | ((Product)g).setFormat_unsafe((Integer)raw); |
807 | 0 | } |
808 | |
|
809 | |
public Object getRaw(Persistent g) |
810 | |
throws AccessPoemException { |
811 | 0 | return ((Product)g).getFormatTroid(); |
812 | |
} |
813 | |
|
814 | |
public void setRaw(Persistent g, Object raw) |
815 | |
throws AccessPoemException { |
816 | 0 | ((Product)g).setFormatTroid((Integer)raw); |
817 | 0 | } |
818 | |
}); |
819 | 2 | } |
820 | |
|
821 | |
|
822 | |
|
823 | |
|
824 | |
|
825 | |
|
826 | |
|
827 | |
|
828 | |
|
829 | |
public final Column<Integer> getIdColumn() { |
830 | 0 | return col_id; |
831 | |
} |
832 | |
|
833 | |
|
834 | |
|
835 | |
|
836 | |
|
837 | |
|
838 | |
|
839 | |
|
840 | |
|
841 | |
public final Column<Integer> getBookColumn() { |
842 | 3 | return col_book; |
843 | |
} |
844 | |
|
845 | |
|
846 | |
|
847 | |
|
848 | |
|
849 | |
|
850 | |
|
851 | |
|
852 | |
|
853 | |
public final Column<Integer> getPublisherColumn() { |
854 | 0 | return col_publisher; |
855 | |
} |
856 | |
|
857 | |
|
858 | |
|
859 | |
|
860 | |
|
861 | |
|
862 | |
|
863 | |
|
864 | |
|
865 | |
public final Column<Integer> getDownloadColumn() { |
866 | 0 | return col_download; |
867 | |
} |
868 | |
|
869 | |
|
870 | |
|
871 | |
|
872 | |
|
873 | |
|
874 | |
|
875 | |
|
876 | |
|
877 | |
public final Column<String> getNameColumn() { |
878 | 0 | return col_name; |
879 | |
} |
880 | |
|
881 | |
|
882 | |
|
883 | |
|
884 | |
|
885 | |
|
886 | |
|
887 | |
|
888 | |
|
889 | |
public final Column<String> getDescriptionColumn() { |
890 | 0 | return col_description; |
891 | |
} |
892 | |
|
893 | |
|
894 | |
|
895 | |
|
896 | |
|
897 | |
|
898 | |
|
899 | |
|
900 | |
|
901 | |
public final Column<Double> getPriceColumn() { |
902 | 0 | return col_price; |
903 | |
} |
904 | |
|
905 | |
|
906 | |
|
907 | |
|
908 | |
|
909 | |
|
910 | |
|
911 | |
|
912 | |
|
913 | |
public final Column<Double> getListpriceColumn() { |
914 | 0 | return col_listprice; |
915 | |
} |
916 | |
|
917 | |
|
918 | |
|
919 | |
|
920 | |
|
921 | |
|
922 | |
|
923 | |
|
924 | |
|
925 | |
public final Column<String> getISBNColumn() { |
926 | 0 | return col_ISBN; |
927 | |
} |
928 | |
|
929 | |
|
930 | |
|
931 | |
|
932 | |
|
933 | |
|
934 | |
|
935 | |
|
936 | |
|
937 | |
public final Column<String> getPictureColumn() { |
938 | 0 | return col_picture; |
939 | |
} |
940 | |
|
941 | |
|
942 | |
|
943 | |
|
944 | |
|
945 | |
|
946 | |
|
947 | |
|
948 | |
|
949 | |
public final Column<Boolean> getDeletedColumn() { |
950 | 0 | return col_deleted; |
951 | |
} |
952 | |
|
953 | |
|
954 | |
|
955 | |
|
956 | |
|
957 | |
|
958 | |
|
959 | |
|
960 | |
|
961 | |
public final Column<Integer> getFormatColumn() { |
962 | 0 | return col_format; |
963 | |
} |
964 | |
|
965 | |
|
966 | |
|
967 | |
|
968 | |
|
969 | |
|
970 | |
|
971 | |
|
972 | |
|
973 | |
public Product getProductObject(Integer troid) { |
974 | 0 | return (Product)getObject(troid); |
975 | |
} |
976 | |
|
977 | |
|
978 | |
|
979 | |
|
980 | |
|
981 | |
|
982 | |
|
983 | |
|
984 | |
|
985 | |
public Product getProductObject(int troid) { |
986 | 0 | return (Product)getObject(troid); |
987 | |
} |
988 | |
|
989 | |
protected JdbcPersistent _newPersistent() { |
990 | 0 | return new Product(); |
991 | |
} |
992 | |
public String defaultDisplayName() { |
993 | 0 | return "Product"; |
994 | |
} |
995 | |
|
996 | |
public String defaultDescription() { |
997 | 0 | return "A Bibliomania Product"; |
998 | |
} |
999 | |
|
1000 | |
public boolean defaultRememberAllTroids() { |
1001 | 0 | return true; |
1002 | |
} |
1003 | |
|
1004 | |
public Integer defaultCacheLimit() { |
1005 | 0 | return new Integer(999999999); |
1006 | |
} |
1007 | |
|
1008 | |
public String defaultCategory() { |
1009 | 0 | return "Shop"; |
1010 | |
} |
1011 | |
|
1012 | |
public int defaultDisplayOrder() { |
1013 | 0 | return 1201; |
1014 | |
} |
1015 | |
} |
1016 | |
|