1
2
3 package org.paneris.melati.site.model.generated;
4
5 import java.sql.Date;
6 import org.melati.poem.AccessPoemException;
7 import org.melati.poem.BooleanPoemType;
8 import org.melati.poem.Column;
9 import org.melati.poem.Database;
10 import org.melati.poem.DatePoemType;
11 import org.melati.poem.DefinitionSource;
12 import org.melati.poem.DisplayLevel;
13 import org.melati.poem.Field;
14 import org.melati.poem.IntegerPoemType;
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.User;
22 import org.melati.poem.ValidationPoemException;
23 import org.paneris.melati.site.model.SiteDatabaseTables;
24 import org.paneris.melati.site.model.SiteTable;
25 import org.paneris.melati.site.model.UploadedFile;
26 import org.paneris.melati.site.model.UploadedFileType;
27
28
29
30
31
32
33
34
35
36 public class UploadedFileTableBase extends SiteTable {
37
38 private Column col_type = null;
39 private Column col_description = null;
40 private Column col_size = null;
41 private Column col_when = null;
42 private Column col_uploadedby = null;
43 private Column col_deleted = null;
44 private Column col_displayname = null;
45
46
47
48
49
50
51
52
53
54
55
56 public UploadedFileTableBase(
57 Database database, String name,
58 DefinitionSource definitionSource) throws PoemException {
59 super(database, name, definitionSource);
60 }
61
62
63
64
65
66
67
68
69 public SiteDatabaseTables getSiteDatabaseTables() {
70 return (SiteDatabaseTables)getDatabase();
71 }
72
73 public void init() throws PoemException {
74 super.init();
75 defineColumn(col_type =
76 new Column(this, "type",
77 new ReferencePoemType(getSiteDatabaseTables().
78 getUploadedFileTypeTable(), false),
79 DefinitionSource.dsd) {
80 public Object getCooked(Persistent g)
81 throws AccessPoemException, PoemException {
82 return ((UploadedFile)g).getType();
83 }
84
85 public void setCooked(Persistent g, Object cooked)
86 throws AccessPoemException, ValidationPoemException {
87 ((UploadedFile)g).setType((UploadedFileType)cooked);
88 }
89
90 public Field asField(Persistent g) {
91 return ((UploadedFile)g).getTypeField();
92 }
93
94 protected Searchability defaultSearchability() {
95 return Searchability.primary;
96 }
97
98 protected int defaultDisplayOrder() {
99 return 0;
100 }
101
102 protected String defaultDescription() {
103 return "The type of this file";
104 }
105
106 public Object getRaw_unsafe(Persistent g)
107 throws AccessPoemException {
108 return ((UploadedFile)g).getType_unsafe();
109 }
110
111 public void setRaw_unsafe(Persistent g, Object raw)
112 throws AccessPoemException {
113 ((UploadedFile)g).setType_unsafe((Integer)raw);
114 }
115
116 public Object getRaw(Persistent g)
117 throws AccessPoemException {
118 return ((UploadedFile)g).getTypeTroid();
119 }
120
121 public void setRaw(Persistent g, Object raw)
122 throws AccessPoemException {
123 ((UploadedFile)g).setTypeTroid((Integer)raw);
124 }
125
126 public StandardIntegrityFix defaultIntegrityFix() {
127 return StandardIntegrityFix.prevent;
128 }
129 });
130
131 defineColumn(col_description =
132 new Column(this, "description",
133 new StringPoemType(false, -1),
134 DefinitionSource.dsd) {
135 public Object getCooked(Persistent g)
136 throws AccessPoemException, PoemException {
137 return ((UploadedFile)g).getDescription();
138 }
139
140 public void setCooked(Persistent g, Object cooked)
141 throws AccessPoemException, ValidationPoemException {
142 ((UploadedFile)g).setDescription((String)cooked);
143 }
144
145 public Field asField(Persistent g) {
146 return ((UploadedFile)g).getDescriptionField();
147 }
148
149 protected DisplayLevel defaultDisplayLevel() {
150 return DisplayLevel.record;
151 }
152
153 protected Searchability defaultSearchability() {
154 return Searchability.yes;
155 }
156
157 protected int defaultDisplayOrder() {
158 return 1;
159 }
160
161 protected String defaultDescription() {
162 return "A description of the file";
163 }
164
165 protected int defaultWidth() {
166 return 60;
167 }
168
169 protected int defaultHeight() {
170 return 5;
171 }
172
173 public Object getRaw_unsafe(Persistent g)
174 throws AccessPoemException {
175 return ((UploadedFile)g).getDescription_unsafe();
176 }
177
178 public void setRaw_unsafe(Persistent g, Object raw)
179 throws AccessPoemException {
180 ((UploadedFile)g).setDescription_unsafe((String)raw);
181 }
182
183 public Object getRaw(Persistent g)
184 throws AccessPoemException {
185 return ((UploadedFile)g).getDescription();
186 }
187
188 public void setRaw(Persistent g, Object raw)
189 throws AccessPoemException {
190 ((UploadedFile)g).setDescription((String)raw);
191 }
192 });
193
194 defineColumn(col_size =
195 new Column(this, "size",
196 new IntegerPoemType(true),
197 DefinitionSource.dsd) {
198 public Object getCooked(Persistent g)
199 throws AccessPoemException, PoemException {
200 return ((UploadedFile)g).getSize();
201 }
202
203 public void setCooked(Persistent g, Object cooked)
204 throws AccessPoemException, ValidationPoemException {
205 ((UploadedFile)g).setSize((Integer)cooked);
206 }
207
208 public Field asField(Persistent g) {
209 return ((UploadedFile)g).getSizeField();
210 }
211
212 protected DisplayLevel defaultDisplayLevel() {
213 return DisplayLevel.record;
214 }
215
216 protected Searchability defaultSearchability() {
217 return Searchability.no;
218 }
219
220 protected int defaultDisplayOrder() {
221 return 2;
222 }
223
224 protected String defaultDescription() {
225 return "The size of this file";
226 }
227
228 public Object getRaw_unsafe(Persistent g)
229 throws AccessPoemException {
230 return ((UploadedFile)g).getSize_unsafe();
231 }
232
233 public void setRaw_unsafe(Persistent g, Object raw)
234 throws AccessPoemException {
235 ((UploadedFile)g).setSize_unsafe((Integer)raw);
236 }
237
238 public Object getRaw(Persistent g)
239 throws AccessPoemException {
240 return ((UploadedFile)g).getSize();
241 }
242
243 public void setRaw(Persistent g, Object raw)
244 throws AccessPoemException {
245 ((UploadedFile)g).setSize((Integer)raw);
246 }
247 });
248
249 defineColumn(col_when =
250 new Column(this, "when",
251 new DatePoemType(false),
252 DefinitionSource.dsd) {
253 public Object getCooked(Persistent g)
254 throws AccessPoemException, PoemException {
255 return ((UploadedFile)g).getWhen();
256 }
257
258 public void setCooked(Persistent g, Object cooked)
259 throws AccessPoemException, ValidationPoemException {
260 ((UploadedFile)g).setWhen((Date)cooked);
261 }
262
263 public Field asField(Persistent g) {
264 return ((UploadedFile)g).getWhenField();
265 }
266
267 protected boolean defaultUserEditable() {
268 return false;
269 }
270
271 protected boolean defaultUserCreateable() {
272 return false;
273 }
274
275 protected DisplayLevel defaultDisplayLevel() {
276 return DisplayLevel.summary;
277 }
278
279 protected Searchability defaultSearchability() {
280 return Searchability.no;
281 }
282
283 protected int defaultDisplayOrder() {
284 return 3;
285 }
286
287 protected String defaultDescription() {
288 return "The date on which this file was uploaded";
289 }
290
291 public Object getRaw_unsafe(Persistent g)
292 throws AccessPoemException {
293 return ((UploadedFile)g).getWhen_unsafe();
294 }
295
296 public void setRaw_unsafe(Persistent g, Object raw)
297 throws AccessPoemException {
298 ((UploadedFile)g).setWhen_unsafe((Date)raw);
299 }
300
301 public Object getRaw(Persistent g)
302 throws AccessPoemException {
303 return ((UploadedFile)g).getWhen();
304 }
305
306 public void setRaw(Persistent g, Object raw)
307 throws AccessPoemException {
308 ((UploadedFile)g).setWhen((Date)raw);
309 }
310 });
311
312 defineColumn(col_uploadedby =
313 new Column(this, "uploadedby",
314 new ReferencePoemType(getSiteDatabaseTables().
315 getUserTable(), false),
316 DefinitionSource.dsd) {
317 public Object getCooked(Persistent g)
318 throws AccessPoemException, PoemException {
319 return ((UploadedFile)g).getUploadedby();
320 }
321
322 public void setCooked(Persistent g, Object cooked)
323 throws AccessPoemException, ValidationPoemException {
324 ((UploadedFile)g).setUploadedby((User)cooked);
325 }
326
327 public Field asField(Persistent g) {
328 return ((UploadedFile)g).getUploadedbyField();
329 }
330
331 protected boolean defaultUserEditable() {
332 return false;
333 }
334
335 protected boolean defaultUserCreateable() {
336 return false;
337 }
338
339 protected DisplayLevel defaultDisplayLevel() {
340 return DisplayLevel.summary;
341 }
342
343 protected Searchability defaultSearchability() {
344 return Searchability.yes;
345 }
346
347 protected String defaultDisplayName() {
348 return "Uploaded By";
349 }
350
351 protected int defaultDisplayOrder() {
352 return 4;
353 }
354
355 protected String defaultDescription() {
356 return "The user who uploaded this file";
357 }
358
359 public Object getRaw_unsafe(Persistent g)
360 throws AccessPoemException {
361 return ((UploadedFile)g).getUploadedby_unsafe();
362 }
363
364 public void setRaw_unsafe(Persistent g, Object raw)
365 throws AccessPoemException {
366 ((UploadedFile)g).setUploadedby_unsafe((Integer)raw);
367 }
368
369 public Object getRaw(Persistent g)
370 throws AccessPoemException {
371 return ((UploadedFile)g).getUploadedbyTroid();
372 }
373
374 public void setRaw(Persistent g, Object raw)
375 throws AccessPoemException {
376 ((UploadedFile)g).setUploadedbyTroid((Integer)raw);
377 }
378 });
379
380 defineColumn(col_deleted =
381 new Column(this, "deleted",
382 new BooleanPoemType(false),
383 DefinitionSource.dsd) {
384 public Object getCooked(Persistent g)
385 throws AccessPoemException, PoemException {
386 return ((UploadedFile)g).getDeleted();
387 }
388
389 public void setCooked(Persistent g, Object cooked)
390 throws AccessPoemException, ValidationPoemException {
391 ((UploadedFile)g).setDeleted((Boolean)cooked);
392 }
393
394 public Field asField(Persistent g) {
395 return ((UploadedFile)g).getDeletedField();
396 }
397
398 protected boolean defaultUserEditable() {
399 return false;
400 }
401
402 protected boolean defaultUserCreateable() {
403 return false;
404 }
405
406 protected DisplayLevel defaultDisplayLevel() {
407 return DisplayLevel.summary;
408 }
409
410 protected Searchability defaultSearchability() {
411 return Searchability.yes;
412 }
413
414 protected int defaultDisplayOrder() {
415 return 5;
416 }
417
418 protected String defaultDescription() {
419 return "Whether this file been deleted or not";
420 }
421
422 public Object getRaw_unsafe(Persistent g)
423 throws AccessPoemException {
424 return ((UploadedFile)g).getDeleted_unsafe();
425 }
426
427 public void setRaw_unsafe(Persistent g, Object raw)
428 throws AccessPoemException {
429 ((UploadedFile)g).setDeleted_unsafe((Boolean)raw);
430 }
431
432 public Object getRaw(Persistent g)
433 throws AccessPoemException {
434 return ((UploadedFile)g).getDeleted();
435 }
436
437 public void setRaw(Persistent g, Object raw)
438 throws AccessPoemException {
439 ((UploadedFile)g).setDeleted((Boolean)raw);
440 }
441 });
442
443 defineColumn(col_displayname =
444 new Column(this, "displayname",
445 new StringPoemType(false, -1),
446 DefinitionSource.dsd) {
447 public Object getCooked(Persistent g)
448 throws AccessPoemException, PoemException {
449 return ((UploadedFile)g).getDisplayname();
450 }
451
452 public void setCooked(Persistent g, Object cooked)
453 throws AccessPoemException, ValidationPoemException {
454 ((UploadedFile)g).setDisplayname((String)cooked);
455 }
456
457 public Field asField(Persistent g) {
458 return ((UploadedFile)g).getDisplaynameField();
459 }
460
461 protected DisplayLevel defaultDisplayLevel() {
462 return DisplayLevel.primary;
463 }
464
465 protected Searchability defaultSearchability() {
466 return Searchability.primary;
467 }
468
469 protected String defaultDisplayName() {
470 return "Display name";
471 }
472
473 protected int defaultDisplayOrder() {
474 return 6;
475 }
476
477 protected String defaultDescription() {
478 return "The layout's name";
479 }
480
481 public Object getRaw_unsafe(Persistent g)
482 throws AccessPoemException {
483 return ((UploadedFile)g).getDisplayname_unsafe();
484 }
485
486 public void setRaw_unsafe(Persistent g, Object raw)
487 throws AccessPoemException {
488 ((UploadedFile)g).setDisplayname_unsafe((String)raw);
489 }
490
491 public Object getRaw(Persistent g)
492 throws AccessPoemException {
493 return ((UploadedFile)g).getDisplayname();
494 }
495
496 public void setRaw(Persistent g, Object raw)
497 throws AccessPoemException {
498 ((UploadedFile)g).setDisplayname((String)raw);
499 }
500 });
501 }
502
503
504
505
506
507
508
509
510
511 public final Column getTypeColumn() {
512 return col_type;
513 }
514
515
516
517
518
519
520
521
522
523 public final Column getDescriptionColumn() {
524 return col_description;
525 }
526
527
528
529
530
531
532
533
534
535 public final Column getSizeColumn() {
536 return col_size;
537 }
538
539
540
541
542
543
544
545
546
547 public final Column getWhenColumn() {
548 return col_when;
549 }
550
551
552
553
554
555
556
557
558
559 public final Column getUploadedbyColumn() {
560 return col_uploadedby;
561 }
562
563
564
565
566
567
568
569
570
571 public final Column getDeletedColumn() {
572 return col_deleted;
573 }
574
575
576
577
578
579
580
581
582
583 public final Column getDisplaynameColumn() {
584 return col_displayname;
585 }
586
587
588
589
590
591
592
593
594
595 public UploadedFile getUploadedFileObject(Integer troid) {
596 return (UploadedFile)getObject(troid);
597 }
598
599
600
601
602
603
604
605
606
607 public UploadedFile getUploadedFileObject(int troid) {
608 return (UploadedFile)getObject(troid);
609 }
610 protected boolean defaultRememberAllTroids() {
611 return true;
612 }
613
614 protected Integer defaultCacheLimit() {
615 return new Integer(999999999);
616 }
617
618 protected String defaultCategory() {
619 return "Data";
620 }
621
622 protected int defaultDisplayOrder() {
623 return 2;
624 }
625 }
626