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