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