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.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.StandardIntegrityFix; |
19 | |
import org.melati.poem.StringPoemType; |
20 | |
import org.melati.poem.TroidPoemType; |
21 | |
import org.melati.poem.ValidationPoemException; |
22 | |
import org.paneris.bibliomania.Author; |
23 | |
import org.paneris.bibliomania.AuthorWebSite; |
24 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
25 | |
import org.paneris.bibliomania.BibliomaniaTable; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
public class AuthorWebSiteTableBase<T extends AuthorWebSite> extends BibliomaniaTable<T> { |
35 | |
|
36 | 2 | private Column<Integer> col_id = null; |
37 | 2 | private Column<Integer> col_author = null; |
38 | 2 | private Column<String> col_url = null; |
39 | 2 | private Column<String> col_displayname = null; |
40 | 2 | private Column<Integer> col_displayorder = null; |
41 | 2 | private Column<String> col_description = null; |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
public AuthorWebSiteTableBase( |
54 | |
Database database, String name, |
55 | |
DefinitionSource definitionSource) throws PoemException { |
56 | 2 | super(database, name, definitionSource); |
57 | 2 | } |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
67 | 2 | return (BibliomaniaDatabaseTables)getDatabase(); |
68 | |
} |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
public void init() throws PoemException { |
77 | 2 | super.init(); |
78 | 2 | defineColumn(col_id = |
79 | |
new Column<Integer>(this, "id", |
80 | |
new TroidPoemType(), |
81 | 2 | DefinitionSource.dsd) { |
82 | |
public Object getCooked(Persistent g) |
83 | |
throws AccessPoemException, PoemException { |
84 | 0 | return ((AuthorWebSite)g).getId(); |
85 | |
} |
86 | |
|
87 | |
public void setCooked(Persistent g, Object cooked) |
88 | |
throws AccessPoemException, ValidationPoemException { |
89 | 0 | ((AuthorWebSite)g).setId((Integer)cooked); |
90 | 0 | } |
91 | |
|
92 | |
public Field<Integer> asField(Persistent g) { |
93 | 0 | return ((AuthorWebSite)g).getIdField(); |
94 | |
} |
95 | |
|
96 | |
public boolean defaultUserEditable() { |
97 | 0 | return false; |
98 | |
} |
99 | |
|
100 | |
public boolean defaultUserCreateable() { |
101 | 0 | return false; |
102 | |
} |
103 | |
|
104 | |
public DisplayLevel defaultDisplayLevel() { |
105 | 0 | return DisplayLevel.record; |
106 | |
} |
107 | |
|
108 | |
public int defaultDisplayOrder() { |
109 | 0 | return 0; |
110 | |
} |
111 | |
|
112 | |
public Object getRaw_unsafe(Persistent g) |
113 | |
throws AccessPoemException { |
114 | 2 | return ((AuthorWebSite)g).getId_unsafe(); |
115 | |
} |
116 | |
|
117 | |
public void setRaw_unsafe(Persistent g, Object raw) |
118 | |
throws AccessPoemException { |
119 | 36 | ((AuthorWebSite)g).setId_unsafe((Integer)raw); |
120 | 36 | } |
121 | |
|
122 | |
public Object getRaw(Persistent g) |
123 | |
throws AccessPoemException { |
124 | 0 | return ((AuthorWebSite)g).getId(); |
125 | |
} |
126 | |
|
127 | |
public void setRaw(Persistent g, Object raw) |
128 | |
throws AccessPoemException { |
129 | 0 | ((AuthorWebSite)g).setId((Integer)raw); |
130 | 0 | } |
131 | |
}); |
132 | |
|
133 | 2 | defineColumn(col_author = |
134 | |
new Column<Integer>(this, "author", |
135 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
136 | |
getAuthorTable(), false), |
137 | 2 | DefinitionSource.dsd) { |
138 | |
public Object getCooked(Persistent g) |
139 | |
throws AccessPoemException, PoemException { |
140 | 0 | return ((AuthorWebSite)g).getAuthor(); |
141 | |
} |
142 | |
|
143 | |
public void setCooked(Persistent g, Object cooked) |
144 | |
throws AccessPoemException, ValidationPoemException { |
145 | 0 | ((AuthorWebSite)g).setAuthor((Author)cooked); |
146 | 0 | } |
147 | |
|
148 | |
public Field<Integer> asField(Persistent g) { |
149 | 0 | return ((AuthorWebSite)g).getAuthorField(); |
150 | |
} |
151 | |
|
152 | |
public Searchability defaultSearchability() { |
153 | 0 | return Searchability.primary; |
154 | |
} |
155 | |
|
156 | |
public Integer defaultDisplayOrderPriority() { |
157 | 0 | return new Integer(1); |
158 | |
} |
159 | |
|
160 | |
public int defaultDisplayOrder() { |
161 | 0 | return 1; |
162 | |
} |
163 | |
|
164 | |
public String defaultDescription() { |
165 | 0 | return "The author to whom the site is dedicated"; |
166 | |
} |
167 | |
|
168 | |
public boolean defaultIndexed() { |
169 | 0 | return true; |
170 | |
} |
171 | |
|
172 | |
public String defaultRenderinfo() { |
173 | 0 | return "SelectionWindow"; |
174 | |
} |
175 | |
|
176 | |
public Object getRaw_unsafe(Persistent g) |
177 | |
throws AccessPoemException { |
178 | 2 | return ((AuthorWebSite)g).getAuthor_unsafe(); |
179 | |
} |
180 | |
|
181 | |
public void setRaw_unsafe(Persistent g, Object raw) |
182 | |
throws AccessPoemException { |
183 | 18 | ((AuthorWebSite)g).setAuthor_unsafe((Integer)raw); |
184 | 18 | } |
185 | |
|
186 | |
public Object getRaw(Persistent g) |
187 | |
throws AccessPoemException { |
188 | 0 | return ((AuthorWebSite)g).getAuthorTroid(); |
189 | |
} |
190 | |
|
191 | |
public void setRaw(Persistent g, Object raw) |
192 | |
throws AccessPoemException { |
193 | 0 | ((AuthorWebSite)g).setAuthorTroid((Integer)raw); |
194 | 0 | } |
195 | |
|
196 | |
public StandardIntegrityFix defaultIntegrityFix() { |
197 | 0 | return StandardIntegrityFix.delete; |
198 | |
} |
199 | |
}); |
200 | |
|
201 | 2 | defineColumn(col_url = |
202 | |
new Column<String>(this, "url", |
203 | |
new StringPoemType(false, -1), |
204 | 2 | DefinitionSource.dsd) { |
205 | |
public Object getCooked(Persistent g) |
206 | |
throws AccessPoemException, PoemException { |
207 | 0 | return ((AuthorWebSite)g).getUrl(); |
208 | |
} |
209 | |
|
210 | |
public void setCooked(Persistent g, Object cooked) |
211 | |
throws AccessPoemException, ValidationPoemException { |
212 | 0 | ((AuthorWebSite)g).setUrl((String)cooked); |
213 | 0 | } |
214 | |
|
215 | |
public Field<String> asField(Persistent g) { |
216 | 0 | return ((AuthorWebSite)g).getUrlField(); |
217 | |
} |
218 | |
|
219 | |
public String defaultDisplayName() { |
220 | 0 | return "URL"; |
221 | |
} |
222 | |
|
223 | |
public int defaultDisplayOrder() { |
224 | 0 | return 2; |
225 | |
} |
226 | |
|
227 | |
public String defaultDescription() { |
228 | 0 | return "The full URL for the site's front page"; |
229 | |
} |
230 | |
|
231 | |
public Object getRaw_unsafe(Persistent g) |
232 | |
throws AccessPoemException { |
233 | 2 | return ((AuthorWebSite)g).getUrl_unsafe(); |
234 | |
} |
235 | |
|
236 | |
public void setRaw_unsafe(Persistent g, Object raw) |
237 | |
throws AccessPoemException { |
238 | 18 | ((AuthorWebSite)g).setUrl_unsafe((String)raw); |
239 | 18 | } |
240 | |
|
241 | |
public Object getRaw(Persistent g) |
242 | |
throws AccessPoemException { |
243 | 0 | return ((AuthorWebSite)g).getUrl(); |
244 | |
} |
245 | |
|
246 | |
public void setRaw(Persistent g, Object raw) |
247 | |
throws AccessPoemException { |
248 | 0 | ((AuthorWebSite)g).setUrl((String)raw); |
249 | 0 | } |
250 | |
}); |
251 | |
|
252 | 2 | defineColumn(col_displayname = |
253 | |
new Column<String>(this, "displayname", |
254 | |
new StringPoemType(false, -1), |
255 | 2 | DefinitionSource.dsd) { |
256 | |
public Object getCooked(Persistent g) |
257 | |
throws AccessPoemException, PoemException { |
258 | 0 | return ((AuthorWebSite)g).getDisplayname(); |
259 | |
} |
260 | |
|
261 | |
public void setCooked(Persistent g, Object cooked) |
262 | |
throws AccessPoemException, ValidationPoemException { |
263 | 0 | ((AuthorWebSite)g).setDisplayname((String)cooked); |
264 | 0 | } |
265 | |
|
266 | |
public Field<String> asField(Persistent g) { |
267 | 0 | return ((AuthorWebSite)g).getDisplaynameField(); |
268 | |
} |
269 | |
|
270 | |
public DisplayLevel defaultDisplayLevel() { |
271 | 0 | return DisplayLevel.primary; |
272 | |
} |
273 | |
|
274 | |
public String defaultDisplayName() { |
275 | 0 | return "Display name"; |
276 | |
} |
277 | |
|
278 | |
public int defaultDisplayOrder() { |
279 | 0 | return 3; |
280 | |
} |
281 | |
|
282 | |
public String defaultDescription() { |
283 | 0 | return "The site's name"; |
284 | |
} |
285 | |
|
286 | |
public Object getRaw_unsafe(Persistent g) |
287 | |
throws AccessPoemException { |
288 | 2 | return ((AuthorWebSite)g).getDisplayname_unsafe(); |
289 | |
} |
290 | |
|
291 | |
public void setRaw_unsafe(Persistent g, Object raw) |
292 | |
throws AccessPoemException { |
293 | 18 | ((AuthorWebSite)g).setDisplayname_unsafe((String)raw); |
294 | 18 | } |
295 | |
|
296 | |
public Object getRaw(Persistent g) |
297 | |
throws AccessPoemException { |
298 | 0 | return ((AuthorWebSite)g).getDisplayname(); |
299 | |
} |
300 | |
|
301 | |
public void setRaw(Persistent g, Object raw) |
302 | |
throws AccessPoemException { |
303 | 0 | ((AuthorWebSite)g).setDisplayname((String)raw); |
304 | 0 | } |
305 | |
}); |
306 | |
|
307 | 2 | defineColumn(col_displayorder = |
308 | |
new Column<Integer>(this, "displayorder", |
309 | |
new IntegerPoemType(false), |
310 | 2 | DefinitionSource.dsd) { |
311 | |
public Object getCooked(Persistent g) |
312 | |
throws AccessPoemException, PoemException { |
313 | 0 | return ((AuthorWebSite)g).getDisplayorder(); |
314 | |
} |
315 | |
|
316 | |
public void setCooked(Persistent g, Object cooked) |
317 | |
throws AccessPoemException, ValidationPoemException { |
318 | 0 | ((AuthorWebSite)g).setDisplayorder((Integer)cooked); |
319 | 0 | } |
320 | |
|
321 | |
public Field<Integer> asField(Persistent g) { |
322 | 0 | return ((AuthorWebSite)g).getDisplayorderField(); |
323 | |
} |
324 | |
|
325 | |
public Integer defaultDisplayOrderPriority() { |
326 | 0 | return new Integer(0); |
327 | |
} |
328 | |
|
329 | |
public int defaultDisplayOrder() { |
330 | 0 | return 4; |
331 | |
} |
332 | |
|
333 | |
public Object getRaw_unsafe(Persistent g) |
334 | |
throws AccessPoemException { |
335 | 2 | return ((AuthorWebSite)g).getDisplayorder_unsafe(); |
336 | |
} |
337 | |
|
338 | |
public void setRaw_unsafe(Persistent g, Object raw) |
339 | |
throws AccessPoemException { |
340 | 18 | ((AuthorWebSite)g).setDisplayorder_unsafe((Integer)raw); |
341 | 18 | } |
342 | |
|
343 | |
public Object getRaw(Persistent g) |
344 | |
throws AccessPoemException { |
345 | 0 | return ((AuthorWebSite)g).getDisplayorder(); |
346 | |
} |
347 | |
|
348 | |
public void setRaw(Persistent g, Object raw) |
349 | |
throws AccessPoemException { |
350 | 0 | ((AuthorWebSite)g).setDisplayorder((Integer)raw); |
351 | 0 | } |
352 | |
}); |
353 | |
|
354 | 2 | defineColumn(col_description = |
355 | |
new Column<String>(this, "description", |
356 | |
new StringPoemType(true, 5000), |
357 | 2 | DefinitionSource.dsd) { |
358 | |
public Object getCooked(Persistent g) |
359 | |
throws AccessPoemException, PoemException { |
360 | 0 | return ((AuthorWebSite)g).getDescription(); |
361 | |
} |
362 | |
|
363 | |
public void setCooked(Persistent g, Object cooked) |
364 | |
throws AccessPoemException, ValidationPoemException { |
365 | 0 | ((AuthorWebSite)g).setDescription((String)cooked); |
366 | 0 | } |
367 | |
|
368 | |
public Field<String> asField(Persistent g) { |
369 | 0 | return ((AuthorWebSite)g).getDescriptionField(); |
370 | |
} |
371 | |
|
372 | |
public DisplayLevel defaultDisplayLevel() { |
373 | 0 | return DisplayLevel.summary; |
374 | |
} |
375 | |
|
376 | |
public Searchability defaultSearchability() { |
377 | 0 | return Searchability.yes; |
378 | |
} |
379 | |
|
380 | |
public String defaultDisplayName() { |
381 | 0 | return "Description"; |
382 | |
} |
383 | |
|
384 | |
public int defaultDisplayOrder() { |
385 | 0 | return 100; |
386 | |
} |
387 | |
|
388 | |
public int defaultWidth() { |
389 | 0 | return 20; |
390 | |
} |
391 | |
|
392 | |
public int defaultHeight() { |
393 | 0 | return 1; |
394 | |
} |
395 | |
|
396 | |
public Object getRaw_unsafe(Persistent g) |
397 | |
throws AccessPoemException { |
398 | 2 | return ((AuthorWebSite)g).getDescription_unsafe(); |
399 | |
} |
400 | |
|
401 | |
public void setRaw_unsafe(Persistent g, Object raw) |
402 | |
throws AccessPoemException { |
403 | 18 | ((AuthorWebSite)g).setDescription_unsafe((String)raw); |
404 | 18 | } |
405 | |
|
406 | |
public Object getRaw(Persistent g) |
407 | |
throws AccessPoemException { |
408 | 0 | return ((AuthorWebSite)g).getDescription(); |
409 | |
} |
410 | |
|
411 | |
public void setRaw(Persistent g, Object raw) |
412 | |
throws AccessPoemException { |
413 | 0 | ((AuthorWebSite)g).setDescription((String)raw); |
414 | 0 | } |
415 | |
}); |
416 | 2 | } |
417 | |
|
418 | |
|
419 | |
|
420 | |
|
421 | |
|
422 | |
|
423 | |
|
424 | |
|
425 | |
|
426 | |
public final Column<Integer> getIdColumn() { |
427 | 0 | return col_id; |
428 | |
} |
429 | |
|
430 | |
|
431 | |
|
432 | |
|
433 | |
|
434 | |
|
435 | |
|
436 | |
|
437 | |
|
438 | |
public final Column<Integer> getAuthorColumn() { |
439 | 1 | return col_author; |
440 | |
} |
441 | |
|
442 | |
|
443 | |
|
444 | |
|
445 | |
|
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
public final Column<String> getUrlColumn() { |
451 | 1 | return col_url; |
452 | |
} |
453 | |
|
454 | |
|
455 | |
|
456 | |
|
457 | |
|
458 | |
|
459 | |
|
460 | |
|
461 | |
|
462 | |
public final Column<String> getDisplaynameColumn() { |
463 | 1 | return col_displayname; |
464 | |
} |
465 | |
|
466 | |
|
467 | |
|
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
|
474 | |
public final Column<Integer> getDisplayorderColumn() { |
475 | 0 | return col_displayorder; |
476 | |
} |
477 | |
|
478 | |
|
479 | |
|
480 | |
|
481 | |
|
482 | |
|
483 | |
|
484 | |
|
485 | |
|
486 | |
public final Column<String> getDescriptionColumn() { |
487 | 1 | return col_description; |
488 | |
} |
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
|
497 | |
|
498 | |
public AuthorWebSite getAuthorWebSiteObject(Integer troid) { |
499 | 0 | return (AuthorWebSite)getObject(troid); |
500 | |
} |
501 | |
|
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
|
507 | |
|
508 | |
|
509 | |
|
510 | |
public AuthorWebSite getAuthorWebSiteObject(int troid) { |
511 | 0 | return (AuthorWebSite)getObject(troid); |
512 | |
} |
513 | |
|
514 | |
protected JdbcPersistent _newPersistent() { |
515 | 19 | return new AuthorWebSite(); |
516 | |
} |
517 | |
public String defaultDisplayName() { |
518 | 0 | return "Author web site"; |
519 | |
} |
520 | |
|
521 | |
public String defaultDescription() { |
522 | 0 | return "A web site devoted to an author"; |
523 | |
} |
524 | |
|
525 | |
public int defaultDisplayOrder() { |
526 | 0 | return 350; |
527 | |
} |
528 | |
} |
529 | |
|