1 // Do not edit this file! It was generated by Melati POEM's DSD preprocessor.
2
3 package org.paneris.melati.site.model.generated;
4
5
6 import org.melati.poem.AccessPoemException;
7 import org.melati.poem.Column;
8 import org.melati.poem.Field;
9 import org.melati.poem.JdbcPersistent;
10 import org.melati.poem.NoSuchRowPoemException;
11 import org.melati.poem.ValidationPoemException;
12 import org.paneris.melati.site.model.DivTable;
13 import org.paneris.melati.site.model.Page;
14 import org.paneris.melati.site.model.SiteDatabaseTables;
15 import org.paneris.melati.site.model.Style;
16 import org.paneris.melati.site.model.UploadedImage;
17
18
19 /**
20 * Melati POEM generated abstract base class for a <code>Persistent</code>
21 * <code>Div</code> Object.
22 *
23 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
24 */
25 public abstract class DivBase extends JdbcPersistent {
26
27
28 /**
29 * Retrieves the Database object.
30 *
31 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
32 * @return the database
33 */
34 public SiteDatabaseTables getSiteDatabaseTables() {
35 return (SiteDatabaseTables)getDatabase();
36 }
37
38
39 /**
40 * Retrieves the <code>DivTable</code> table
41 * which this <code>Persistent</code> is from.
42 *
43 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
44 * @return the DivTable
45 */
46 public DivTable getDivTable() {
47 return (DivTable)getTable();
48 }
49
50 private DivTable _getDivTable() {
51 return (DivTable)getTable();
52 }
53
54 // Fields in this table
55 /**
56 * id
57 */
58 protected Integer id;
59 /**
60 * page - The Page to which this fragment belongs
61 */
62 protected Integer page;
63 /**
64 * Display order - A rank determining where the div appears in a page
65 */
66 protected Integer displayorder;
67 /**
68 * style - The name of the CSS class for this DIV
69 */
70 protected Integer style;
71 /**
72 * title - The HTML title
73 */
74 protected String title;
75 /**
76 * content - The HTML content
77 */
78 protected String content;
79 /**
80 * Image - Image associated with this div
81 */
82 protected Integer image;
83
84
85 /**
86 * Retrieves the <code>Id</code> value, without locking,
87 * for this <code>Div</code> <code>Persistent</code>.
88 *
89 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
90 * @return the Integer id
91 */
92 public Integer getId_unsafe() {
93 return id;
94 }
95
96
97 /**
98 * Sets the <code>Id</code> value directly, without checking,
99 * for this Div <code>Persistent</code>.
100 *
101 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
102 * @param cooked the pre-validated value to set
103 */
104 public void setId_unsafe(Integer cooked) {
105 id = cooked;
106 }
107
108 /**
109 * Retrieves the Id value, with locking, for this
110 * <code>Div</code> <code>Persistent</code>.
111 *
112 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
113 * @throws AccessPoemException
114 * if the current <code>AccessToken</code>
115 * does not confer write access rights
116 * @return the value of the field <code>Id</code> for this
117 * <code>Div</code> <code>Persistent</code>
118 */
119
120 public Integer getId()
121 throws AccessPoemException {
122 readLock();
123 return getId_unsafe();
124 }
125
126
127 /**
128 * Sets the <code>Id</code> value, with checking, for this
129 * <code>Div</code> <code>Persistent</code>.
130 *
131 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
132 * @param cooked a validated <code>int</code>
133 * @throws AccessPoemException
134 * if the current <code>AccessToken</code>
135 * does not confer write access rights
136 * @throws ValidationPoemException
137 * if the value is not valid
138 */
139 public void setId(Integer cooked)
140 throws AccessPoemException, ValidationPoemException {
141 _getDivTable().getIdColumn().
142 getType().assertValidCooked(cooked);
143 writeLock();
144 setId_unsafe(cooked);
145 }
146
147 /**
148 * Sets the <code>Id</code> value, with checking, for this
149 * <code>Div</code> <code>Persistent</code>.
150 *
151 * @generator org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
152 * @param cooked a validated <code>int</code>
153 * @throws AccessPoemException
154 * if the current <code>AccessToken</code>
155 * does not confer write access rights
156 * @throws ValidationPoemException
157 * if the value is not valid
158 */
159
160 public final void setId(int cooked)
161 throws AccessPoemException, ValidationPoemException {
162 setId(new Integer(cooked));
163 }
164
165
166 /**
167 * Retrieves the <code>Id</code> value as a <code>Field</code>
168 * from this <code>Div</code> <code>Persistent</code>.
169 *
170 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
171 * @throws AccessPoemException
172 * if the current <code>AccessToken</code>
173 * does not confer write access rights
174 * @return the Integer id
175 */
176 public Field getIdField() throws AccessPoemException {
177 Column c = _getDivTable().getIdColumn();
178 return new Field(c.getRaw(this), c);
179 }
180
181
182 /**
183 * Retrieves the <code>Page</code> value, without locking,
184 * for this <code>Div</code> <code>Persistent</code>.
185 *
186 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
187 * @return the Integer page
188 */
189 public Integer getPage_unsafe() {
190 return page;
191 }
192
193
194 /**
195 * Sets the <code>Page</code> value directly, without checking,
196 * for this Div <code>Persistent</code>.
197 *
198 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
199 * @param cooked the pre-validated value to set
200 */
201 public void setPage_unsafe(Integer cooked) {
202 page = cooked;
203 }
204
205 /**
206 * Retrieves the Table Row Object ID.
207 *
208 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
209 * @throws AccessPoemException
210 * if the current <code>AccessToken</code>
211 * does not confer read access rights
212 * @return the TROID as an <code>Integer</code>
213 */
214
215 public Integer getPageTroid()
216 throws AccessPoemException {
217 readLock();
218 return getPage_unsafe();
219 }
220
221
222 /**
223 * Sets the Table Row Object ID.
224 *
225 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
226 * @param raw a Table Row Object Id
227 * @throws AccessPoemException
228 * if the current <code>AccessToken</code>
229 * does not confer write access rights
230 */
231 public void setPageTroid(Integer raw)
232 throws AccessPoemException {
233 setPage(raw == null ? null :
234 getSiteDatabaseTables().getPageTable().getPageObject(raw));
235 }
236
237
238 /**
239 * Retrieves the <code>Page</code> object referred to.
240 *
241 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
242 * @throws AccessPoemException
243 * if the current <code>AccessToken</code>
244 * does not confer read access rights
245 * @throws NoSuchRowPoemException
246 * if the <code>Persistent</code> has yet to be allocated a TROID
247 * @return the <code>Page</code> as a <code>Page</code>
248 */
249 public Page getPage()
250 throws AccessPoemException, NoSuchRowPoemException {
251 Integer troid = getPageTroid();
252 return troid == null ? null :
253 getSiteDatabaseTables().getPageTable().getPageObject(troid);
254 }
255
256
257 /**
258 * Set the Page.
259 *
260 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
261 * @param cooked a validated <code>Page</code>
262 * @throws AccessPoemException
263 * if the current <code>AccessToken</code>
264 * does not confer write access rights
265 */
266 public void setPage(Page cooked)
267 throws AccessPoemException {
268 _getDivTable().
269 getPageColumn().
270 getType().assertValidCooked(cooked);
271 writeLock();
272 if (cooked == null)
273 setPage_unsafe(null);
274 else {
275 cooked.existenceLock();
276 setPage_unsafe(cooked.troid());
277 }
278 }
279
280
281 /**
282 * Retrieves the <code>Page</code> value as a <code>Field</code>
283 * from this <code>Div</code> <code>Persistent</code>.
284 *
285 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
286 * @throws AccessPoemException
287 * if the current <code>AccessToken</code>
288 * does not confer write access rights
289 * @return the Integer page
290 */
291 public Field getPageField() throws AccessPoemException {
292 Column c = _getDivTable().getPageColumn();
293 return new Field(c.getRaw(this), c);
294 }
295
296
297 /**
298 * Retrieves the <code>Displayorder</code> value, without locking,
299 * for this <code>Div</code> <code>Persistent</code>.
300 *
301 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
302 * @return the Integer displayorder
303 */
304 public Integer getDisplayorder_unsafe() {
305 return displayorder;
306 }
307
308
309 /**
310 * Sets the <code>Displayorder</code> value directly, without checking,
311 * for this Div <code>Persistent</code>.
312 *
313 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
314 * @param cooked the pre-validated value to set
315 */
316 public void setDisplayorder_unsafe(Integer cooked) {
317 displayorder = cooked;
318 }
319
320 /**
321 * Retrieves the Displayorder value, with locking, for this
322 * <code>Div</code> <code>Persistent</code>.
323 * Field description:
324 * A rank determining where the div appears in a page
325 *
326 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
327 * @throws AccessPoemException
328 * if the current <code>AccessToken</code>
329 * does not confer write access rights
330 * @return the value of the field <code>Displayorder</code> for this
331 * <code>Div</code> <code>Persistent</code>
332 */
333
334 public Integer getDisplayorder()
335 throws AccessPoemException {
336 readLock();
337 return getDisplayorder_unsafe();
338 }
339
340
341 /**
342 * Sets the <code>Displayorder</code> value, with checking, for this
343 * <code>Div</code> <code>Persistent</code>.
344 * Field description:
345 * A rank determining where the div appears in a page
346 *
347 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
348 * @param cooked a validated <code>int</code>
349 * @throws AccessPoemException
350 * if the current <code>AccessToken</code>
351 * does not confer write access rights
352 * @throws ValidationPoemException
353 * if the value is not valid
354 */
355 public void setDisplayorder(Integer cooked)
356 throws AccessPoemException, ValidationPoemException {
357 _getDivTable().getDisplayorderColumn().
358 getType().assertValidCooked(cooked);
359 writeLock();
360 setDisplayorder_unsafe(cooked);
361 }
362
363 /**
364 * Sets the <code>Displayorder</code> value, with checking, for this
365 * <code>Div</code> <code>Persistent</code>.
366 * Field description:
367 * A rank determining where the div appears in a page
368 *
369 *
370 * @generator org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
371 * @param cooked a validated <code>int</code>
372 * @throws AccessPoemException
373 * if the current <code>AccessToken</code>
374 * does not confer write access rights
375 * @throws ValidationPoemException
376 * if the value is not valid
377 */
378
379 public final void setDisplayorder(int cooked)
380 throws AccessPoemException, ValidationPoemException {
381 setDisplayorder(new Integer(cooked));
382 }
383
384
385 /**
386 * Retrieves the <code>Displayorder</code> value as a <code>Field</code>
387 * from this <code>Div</code> <code>Persistent</code>.
388 *
389 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
390 * @throws AccessPoemException
391 * if the current <code>AccessToken</code>
392 * does not confer write access rights
393 * @return the Integer displayorder
394 */
395 public Field getDisplayorderField() throws AccessPoemException {
396 Column c = _getDivTable().getDisplayorderColumn();
397 return new Field(c.getRaw(this), c);
398 }
399
400
401 /**
402 * Retrieves the <code>Style</code> value, without locking,
403 * for this <code>Div</code> <code>Persistent</code>.
404 *
405 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
406 * @return the Integer style
407 */
408 public Integer getStyle_unsafe() {
409 return style;
410 }
411
412
413 /**
414 * Sets the <code>Style</code> value directly, without checking,
415 * for this Div <code>Persistent</code>.
416 *
417 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
418 * @param cooked the pre-validated value to set
419 */
420 public void setStyle_unsafe(Integer cooked) {
421 style = cooked;
422 }
423
424 /**
425 * Retrieves the Table Row Object ID.
426 *
427 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
428 * @throws AccessPoemException
429 * if the current <code>AccessToken</code>
430 * does not confer read access rights
431 * @return the TROID as an <code>Integer</code>
432 */
433
434 public Integer getStyleTroid()
435 throws AccessPoemException {
436 readLock();
437 return getStyle_unsafe();
438 }
439
440
441 /**
442 * Sets the Table Row Object ID.
443 *
444 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
445 * @param raw a Table Row Object Id
446 * @throws AccessPoemException
447 * if the current <code>AccessToken</code>
448 * does not confer write access rights
449 */
450 public void setStyleTroid(Integer raw)
451 throws AccessPoemException {
452 setStyle(raw == null ? null :
453 getSiteDatabaseTables().getStyleTable().getStyleObject(raw));
454 }
455
456
457 /**
458 * Retrieves the <code>Style</code> object referred to.
459 *
460 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
461 * @throws AccessPoemException
462 * if the current <code>AccessToken</code>
463 * does not confer read access rights
464 * @throws NoSuchRowPoemException
465 * if the <code>Persistent</code> has yet to be allocated a TROID
466 * @return the <code>Style</code> as a <code>Style</code>
467 */
468 public Style getStyle()
469 throws AccessPoemException, NoSuchRowPoemException {
470 Integer troid = getStyleTroid();
471 return troid == null ? null :
472 getSiteDatabaseTables().getStyleTable().getStyleObject(troid);
473 }
474
475
476 /**
477 * Set the Style.
478 *
479 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
480 * @param cooked a validated <code>Style</code>
481 * @throws AccessPoemException
482 * if the current <code>AccessToken</code>
483 * does not confer write access rights
484 */
485 public void setStyle(Style cooked)
486 throws AccessPoemException {
487 _getDivTable().
488 getStyleColumn().
489 getType().assertValidCooked(cooked);
490 writeLock();
491 if (cooked == null)
492 setStyle_unsafe(null);
493 else {
494 cooked.existenceLock();
495 setStyle_unsafe(cooked.troid());
496 }
497 }
498
499
500 /**
501 * Retrieves the <code>Style</code> value as a <code>Field</code>
502 * from this <code>Div</code> <code>Persistent</code>.
503 *
504 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
505 * @throws AccessPoemException
506 * if the current <code>AccessToken</code>
507 * does not confer write access rights
508 * @return the Integer style
509 */
510 public Field getStyleField() throws AccessPoemException {
511 Column c = _getDivTable().getStyleColumn();
512 return new Field(c.getRaw(this), c);
513 }
514
515
516 /**
517 * Retrieves the <code>Title</code> value, without locking,
518 * for this <code>Div</code> <code>Persistent</code>.
519 *
520 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
521 * @return the String title
522 */
523 public String getTitle_unsafe() {
524 return title;
525 }
526
527
528 /**
529 * Sets the <code>Title</code> value directly, without checking,
530 * for this Div <code>Persistent</code>.
531 *
532 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
533 * @param cooked the pre-validated value to set
534 */
535 public void setTitle_unsafe(String cooked) {
536 title = cooked;
537 }
538
539 /**
540 * Retrieves the Title value, with locking, for this
541 * <code>Div</code> <code>Persistent</code>.
542 * Field description:
543 * The HTML title
544 *
545 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
546 * @throws AccessPoemException
547 * if the current <code>AccessToken</code>
548 * does not confer write access rights
549 * @return the value of the field <code>Title</code> for this
550 * <code>Div</code> <code>Persistent</code>
551 */
552
553 public String getTitle()
554 throws AccessPoemException {
555 readLock();
556 return getTitle_unsafe();
557 }
558
559
560 /**
561 * Sets the <code>Title</code> value, with checking, for this
562 * <code>Div</code> <code>Persistent</code>.
563 * Field description:
564 * The HTML title
565 *
566 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
567 * @param cooked a validated <code>int</code>
568 * @throws AccessPoemException
569 * if the current <code>AccessToken</code>
570 * does not confer write access rights
571 * @throws ValidationPoemException
572 * if the value is not valid
573 */
574 public void setTitle(String cooked)
575 throws AccessPoemException, ValidationPoemException {
576 _getDivTable().getTitleColumn().
577 getType().assertValidCooked(cooked);
578 writeLock();
579 setTitle_unsafe(cooked);
580 }
581
582
583 /**
584 * Retrieves the <code>Title</code> value as a <code>Field</code>
585 * from this <code>Div</code> <code>Persistent</code>.
586 *
587 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
588 * @throws AccessPoemException
589 * if the current <code>AccessToken</code>
590 * does not confer write access rights
591 * @return the String title
592 */
593 public Field getTitleField() throws AccessPoemException {
594 Column c = _getDivTable().getTitleColumn();
595 return new Field(c.getRaw(this), c);
596 }
597
598
599 /**
600 * Retrieves the <code>Content</code> value, without locking,
601 * for this <code>Div</code> <code>Persistent</code>.
602 *
603 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
604 * @return the String content
605 */
606 public String getContent_unsafe() {
607 return content;
608 }
609
610
611 /**
612 * Sets the <code>Content</code> value directly, without checking,
613 * for this Div <code>Persistent</code>.
614 *
615 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
616 * @param cooked the pre-validated value to set
617 */
618 public void setContent_unsafe(String cooked) {
619 content = cooked;
620 }
621
622 /**
623 * Retrieves the Content value, with locking, for this
624 * <code>Div</code> <code>Persistent</code>.
625 * Field description:
626 * The HTML content
627 *
628 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
629 * @throws AccessPoemException
630 * if the current <code>AccessToken</code>
631 * does not confer write access rights
632 * @return the value of the field <code>Content</code> for this
633 * <code>Div</code> <code>Persistent</code>
634 */
635
636 public String getContent()
637 throws AccessPoemException {
638 readLock();
639 return getContent_unsafe();
640 }
641
642
643 /**
644 * Sets the <code>Content</code> value, with checking, for this
645 * <code>Div</code> <code>Persistent</code>.
646 * Field description:
647 * The HTML content
648 *
649 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
650 * @param cooked a validated <code>int</code>
651 * @throws AccessPoemException
652 * if the current <code>AccessToken</code>
653 * does not confer write access rights
654 * @throws ValidationPoemException
655 * if the value is not valid
656 */
657 public void setContent(String cooked)
658 throws AccessPoemException, ValidationPoemException {
659 _getDivTable().getContentColumn().
660 getType().assertValidCooked(cooked);
661 writeLock();
662 setContent_unsafe(cooked);
663 }
664
665
666 /**
667 * Retrieves the <code>Content</code> value as a <code>Field</code>
668 * from this <code>Div</code> <code>Persistent</code>.
669 *
670 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
671 * @throws AccessPoemException
672 * if the current <code>AccessToken</code>
673 * does not confer write access rights
674 * @return the String content
675 */
676 public Field getContentField() throws AccessPoemException {
677 Column c = _getDivTable().getContentColumn();
678 return new Field(c.getRaw(this), c);
679 }
680
681
682 /**
683 * Retrieves the <code>Image</code> value, without locking,
684 * for this <code>Div</code> <code>Persistent</code>.
685 *
686 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
687 * @return the Integer image
688 */
689 public Integer getImage_unsafe() {
690 return image;
691 }
692
693
694 /**
695 * Sets the <code>Image</code> value directly, without checking,
696 * for this Div <code>Persistent</code>.
697 *
698 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
699 * @param cooked the pre-validated value to set
700 */
701 public void setImage_unsafe(Integer cooked) {
702 image = cooked;
703 }
704
705 /**
706 * Retrieves the Table Row Object ID.
707 *
708 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
709 * @throws AccessPoemException
710 * if the current <code>AccessToken</code>
711 * does not confer read access rights
712 * @return the TROID as an <code>Integer</code>
713 */
714
715 public Integer getImageTroid()
716 throws AccessPoemException {
717 readLock();
718 return getImage_unsafe();
719 }
720
721
722 /**
723 * Sets the Table Row Object ID.
724 *
725 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
726 * @param raw a Table Row Object Id
727 * @throws AccessPoemException
728 * if the current <code>AccessToken</code>
729 * does not confer write access rights
730 */
731 public void setImageTroid(Integer raw)
732 throws AccessPoemException {
733 setImage(raw == null ? null :
734 (UploadedImage)getSiteDatabaseTables().getUploadedImageTable().getUploadedImageObject(raw));
735 }
736
737
738 /**
739 * Retrieves the <code>Image</code> object referred to.
740 *
741 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
742 * @throws AccessPoemException
743 * if the current <code>AccessToken</code>
744 * does not confer read access rights
745 * @throws NoSuchRowPoemException
746 * if the <code>Persistent</code> has yet to be allocated a TROID
747 * @return the <code>Image</code> as a <code>UploadedImage</code>
748 */
749 public UploadedImage getImage()
750 throws AccessPoemException, NoSuchRowPoemException {
751 Integer troid = getImageTroid();
752 return troid == null ? null :
753 (UploadedImage)getSiteDatabaseTables().getUploadedImageTable().getUploadedImageObject(troid);
754 }
755
756
757 /**
758 * Set the Image.
759 *
760 * @generator org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods
761 * @param cooked a validated <code>UploadedImage</code>
762 * @throws AccessPoemException
763 * if the current <code>AccessToken</code>
764 * does not confer write access rights
765 */
766 public void setImage(UploadedImage cooked)
767 throws AccessPoemException {
768 _getDivTable().
769 getImageColumn().
770 getType().assertValidCooked(cooked);
771 writeLock();
772 if (cooked == null)
773 setImage_unsafe(null);
774 else {
775 cooked.existenceLock();
776 setImage_unsafe(cooked.troid());
777 }
778 }
779
780
781 /**
782 * Retrieves the <code>Image</code> value as a <code>Field</code>
783 * from this <code>Div</code> <code>Persistent</code>.
784 *
785 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
786 * @throws AccessPoemException
787 * if the current <code>AccessToken</code>
788 * does not confer write access rights
789 * @return the Integer image
790 */
791 public Field getImageField() throws AccessPoemException {
792 Column c = _getDivTable().getImageColumn();
793 return new Field(c.getRaw(this), c);
794 }
795 }
796