View Javadoc

1   // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
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.Field;
9   import org.melati.poem.JdbcPersistent;
10  import org.melati.poem.NoSuchRowPoemException;
11  import org.melati.poem.ValidationPoemException;
12  import org.paneris.bibliomania.Author;
13  import org.paneris.bibliomania.AuthorWebSite;
14  import org.paneris.bibliomania.AuthorWebSiteTable;
15  import org.paneris.bibliomania.BibliomaniaDatabaseTables;
16  
17  
18  /**
19   * Melati POEM generated abstract base class for a <code>Persistent</code> 
20   * <code>AuthorWebSite</code> Object.
21   *
22   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
23   */
24  public abstract class AuthorWebSiteBase extends JdbcPersistent {
25  
26  
27   /**
28    * Retrieves the Database object.
29    * 
30    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
31    * @return the database
32    */
33    public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
34      return (BibliomaniaDatabaseTables)getDatabase();
35    }
36  
37  
38   /**
39    * Retrieves the  <code>AuthorWebSiteTable</code> table 
40    * which this <code>Persistent</code> is from.
41    * 
42    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
43    * @return the AuthorWebSiteTable
44    */
45    @SuppressWarnings("unchecked")
46    public AuthorWebSiteTable<AuthorWebSite> getAuthorWebSiteTable() {
47      return (AuthorWebSiteTable<AuthorWebSite>)getTable();
48    }
49  
50    @SuppressWarnings("unchecked")
51    private AuthorWebSiteTable<AuthorWebSite> _getAuthorWebSiteTable() {
52      return (AuthorWebSiteTable<AuthorWebSite>)getTable();
53    }
54  
55    // Fields in this table 
56   /**
57    * id 
58    */
59    protected Integer id;
60   /**
61    * author - The author to whom the site is dedicated 
62    */
63    protected Integer author;
64   /**
65    * URL - The full URL for the site's front page 
66    */
67    protected String url;
68   /**
69    * Display name - The site's name 
70    */
71    protected String displayname;
72   /**
73    * displayorder 
74    */
75    protected Integer displayorder;
76   /**
77    * Description 
78    */
79    protected String description;
80  
81  
82   /**
83    * Retrieves the <code>Id</code> value, without locking, 
84    * for this <code>AuthorWebSite</code> <code>Persistent</code>.
85    *
86    * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
87    * @return the Integer id
88    */
89    public Integer getId_unsafe() {
90      return id;
91    }
92  
93  
94   /**
95    * Sets the <code>Id</code> value directly, without checking, 
96    * for this AuthorWebSite <code>Persistent</code>.
97    * 
98    * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
99    * @param cooked  the pre-validated value to set
100   */
101   public void setId_unsafe(Integer cooked) {
102     id = cooked;
103   }
104 
105  /**
106   * Retrieves the Id value, with locking, for this 
107   * <code>AuthorWebSite</code> <code>Persistent</code>.
108   * 
109   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
110   * @throws AccessPoemException 
111   *         if the current <code>AccessToken</code> 
112   *         does not confer write access rights 
113   * @return the value of the field <code>Id</code> for this 
114   *         <code>AuthorWebSite</code> <code>Persistent</code>  
115   */
116 
117   public Integer getId()
118       throws AccessPoemException {
119     readLock();
120     return getId_unsafe();
121   }
122 
123 
124  /**
125   * Sets the <code>Id</code> value, with checking, for this 
126   * <code>AuthorWebSite</code> <code>Persistent</code>.
127   * 
128   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
129   * @param cooked  a validated <code>int</code> 
130   * @throws AccessPoemException 
131   *         if the current <code>AccessToken</code> 
132   *         does not confer write access rights
133   * @throws ValidationPoemException 
134   *         if the value is not valid
135   */
136   public void setId(Integer cooked)
137       throws AccessPoemException, ValidationPoemException {
138     _getAuthorWebSiteTable().getIdColumn().
139       getType().assertValidCooked(cooked);
140     writeLock();
141     setId_unsafe(cooked);
142   }
143 
144  /**
145   * Sets the <code>Id</code> value, with checking, for this 
146   * <code>AuthorWebSite</code> <code>Persistent</code>.
147   * 
148   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
149   * @param cooked  a validated <code>int</code>
150   * @throws AccessPoemException 
151   *         if the current <code>AccessToken</code> 
152   *         does not confer write access rights
153   * @throws ValidationPoemException 
154   *         if the value is not valid
155   */
156 
157   public final void setId(int cooked)
158       throws AccessPoemException, ValidationPoemException {
159     setId(new Integer(cooked));
160   }
161 
162 
163  /**
164   * Retrieves the <code>Id</code> value as a <code>Field</code>
165   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
166   * 
167   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
168   * @throws AccessPoemException 
169   *         if the current <code>AccessToken</code> 
170   *         does not confer write access rights
171   * @return the Integer id
172   */
173   public Field<Integer> getIdField() throws AccessPoemException {
174     Column<Integer> c = _getAuthorWebSiteTable().getIdColumn();
175     return new Field<Integer>((Integer)c.getRaw(this), c);
176   }
177 
178 
179  /**
180   * Retrieves the <code>Author</code> value, without locking, 
181   * for this <code>AuthorWebSite</code> <code>Persistent</code>.
182   *
183   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
184   * @return the Integer author
185   */
186   public Integer getAuthor_unsafe() {
187     return author;
188   }
189 
190 
191  /**
192   * Sets the <code>Author</code> value directly, without checking, 
193   * for this AuthorWebSite <code>Persistent</code>.
194   * 
195   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
196   * @param cooked  the pre-validated value to set
197   */
198   public void setAuthor_unsafe(Integer cooked) {
199     author = cooked;
200   }
201 
202  /**
203   * Retrieves the Table Row Object ID. 
204   *
205   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
206   * @throws AccessPoemException  
207   *         if the current <code>AccessToken</code> 
208   *         does not confer read access rights 
209   * @return the TROID as an <code>Integer</code> 
210   */
211 
212   public Integer getAuthorTroid()
213       throws AccessPoemException {
214     readLock();
215     return getAuthor_unsafe();
216   }
217 
218 
219  /**
220   * Sets the Table Row Object ID. 
221   * 
222   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
223   * @param raw  a Table Row Object Id 
224   * @throws AccessPoemException  
225   *         if the current <code>AccessToken</code> 
226   *         does not confer write access rights
227   */
228   public void setAuthorTroid(Integer raw)
229       throws AccessPoemException {
230     setAuthor(raw == null ? null : 
231         (Author)getBibliomaniaDatabaseTables().getAuthorTable().getAuthorObject(raw));
232   }
233 
234 
235  /**
236   * Retrieves the <code>Author</code> object referred to.
237   *  
238   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
239   * @throws AccessPoemException  
240   *         if the current <code>AccessToken</code> 
241   *         does not confer read access rights 
242   * @throws NoSuchRowPoemException  
243   *         if the <code>Persistent</code> has yet to be allocated a TROID 
244   * @return the <code>Author</code> as a <code>Author</code> 
245   */
246   public Author getAuthor()
247       throws AccessPoemException, NoSuchRowPoemException {
248     Integer troid = getAuthorTroid();
249     return troid == null ? null :
250         (Author)getBibliomaniaDatabaseTables().getAuthorTable().getAuthorObject(troid);
251   }
252 
253 
254  /**
255   * Set the Author.
256   * 
257   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
258   * @param cooked  a validated <code>Author</code>
259   * @throws AccessPoemException  
260   *         if the current <code>AccessToken</code> 
261   *         does not confer write access rights 
262   */
263   public void setAuthor(Author cooked)
264       throws AccessPoemException {
265     _getAuthorWebSiteTable().
266       getAuthorColumn().
267         getType().assertValidCooked(cooked);
268     writeLock();
269     if (cooked == null)
270       setAuthor_unsafe(null);
271     else {
272       cooked.existenceLock();
273       setAuthor_unsafe(cooked.troid());
274     }
275   }
276 
277 
278  /**
279   * Retrieves the <code>Author</code> value as a <code>Field</code>
280   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
281   * 
282   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
283   * @throws AccessPoemException 
284   *         if the current <code>AccessToken</code> 
285   *         does not confer write access rights
286   * @return the Integer author
287   */
288   public Field<Integer> getAuthorField() throws AccessPoemException {
289     Column<Integer> c = _getAuthorWebSiteTable().getAuthorColumn();
290     return new Field<Integer>((Integer)c.getRaw(this), c);
291   }
292 
293 
294  /**
295   * Retrieves the <code>Url</code> value, without locking, 
296   * for this <code>AuthorWebSite</code> <code>Persistent</code>.
297   *
298   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
299   * @return the String url
300   */
301   public String getUrl_unsafe() {
302     return url;
303   }
304 
305 
306  /**
307   * Sets the <code>Url</code> value directly, without checking, 
308   * for this AuthorWebSite <code>Persistent</code>.
309   * 
310   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
311   * @param cooked  the pre-validated value to set
312   */
313   public void setUrl_unsafe(String cooked) {
314     url = cooked;
315   }
316 
317  /**
318   * Retrieves the Url value, with locking, for this 
319   * <code>AuthorWebSite</code> <code>Persistent</code>.
320   * Field description: 
321   *   The full URL for the site's front page 
322   * 
323   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
324   * @throws AccessPoemException 
325   *         if the current <code>AccessToken</code> 
326   *         does not confer write access rights 
327   * @return the value of the field <code>Url</code> for this 
328   *         <code>AuthorWebSite</code> <code>Persistent</code>  
329   */
330 
331   public String getUrl()
332       throws AccessPoemException {
333     readLock();
334     return getUrl_unsafe();
335   }
336 
337 
338  /**
339   * Sets the <code>Url</code> value, with checking, for this 
340   * <code>AuthorWebSite</code> <code>Persistent</code>.
341   * Field description: 
342   *   The full URL for the site's front page 
343   * 
344   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
345   * @param cooked  a validated <code>int</code> 
346   * @throws AccessPoemException 
347   *         if the current <code>AccessToken</code> 
348   *         does not confer write access rights
349   * @throws ValidationPoemException 
350   *         if the value is not valid
351   */
352   public void setUrl(String cooked)
353       throws AccessPoemException, ValidationPoemException {
354     _getAuthorWebSiteTable().getUrlColumn().
355       getType().assertValidCooked(cooked);
356     writeLock();
357     setUrl_unsafe(cooked);
358   }
359 
360 
361  /**
362   * Retrieves the <code>Url</code> value as a <code>Field</code>
363   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
364   * 
365   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
366   * @throws AccessPoemException 
367   *         if the current <code>AccessToken</code> 
368   *         does not confer write access rights
369   * @return the String url
370   */
371   public Field<String> getUrlField() throws AccessPoemException {
372     Column<String> c = _getAuthorWebSiteTable().getUrlColumn();
373     return new Field<String>((String)c.getRaw(this), c);
374   }
375 
376 
377  /**
378   * Retrieves the <code>Displayname</code> value, without locking, 
379   * for this <code>AuthorWebSite</code> <code>Persistent</code>.
380   *
381   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
382   * @return the String displayname
383   */
384   public String getDisplayname_unsafe() {
385     return displayname;
386   }
387 
388 
389  /**
390   * Sets the <code>Displayname</code> value directly, without checking, 
391   * for this AuthorWebSite <code>Persistent</code>.
392   * 
393   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
394   * @param cooked  the pre-validated value to set
395   */
396   public void setDisplayname_unsafe(String cooked) {
397     displayname = cooked;
398   }
399 
400  /**
401   * Retrieves the Displayname value, with locking, for this 
402   * <code>AuthorWebSite</code> <code>Persistent</code>.
403   * Field description: 
404   *   The site's name 
405   * 
406   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
407   * @throws AccessPoemException 
408   *         if the current <code>AccessToken</code> 
409   *         does not confer write access rights 
410   * @return the value of the field <code>Displayname</code> for this 
411   *         <code>AuthorWebSite</code> <code>Persistent</code>  
412   */
413 
414   public String getDisplayname()
415       throws AccessPoemException {
416     readLock();
417     return getDisplayname_unsafe();
418   }
419 
420 
421  /**
422   * Sets the <code>Displayname</code> value, with checking, for this 
423   * <code>AuthorWebSite</code> <code>Persistent</code>.
424   * Field description: 
425   *   The site's name 
426   * 
427   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
428   * @param cooked  a validated <code>int</code> 
429   * @throws AccessPoemException 
430   *         if the current <code>AccessToken</code> 
431   *         does not confer write access rights
432   * @throws ValidationPoemException 
433   *         if the value is not valid
434   */
435   public void setDisplayname(String cooked)
436       throws AccessPoemException, ValidationPoemException {
437     _getAuthorWebSiteTable().getDisplaynameColumn().
438       getType().assertValidCooked(cooked);
439     writeLock();
440     setDisplayname_unsafe(cooked);
441   }
442 
443 
444  /**
445   * Retrieves the <code>Displayname</code> value as a <code>Field</code>
446   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
447   * 
448   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
449   * @throws AccessPoemException 
450   *         if the current <code>AccessToken</code> 
451   *         does not confer write access rights
452   * @return the String displayname
453   */
454   public Field<String> getDisplaynameField() throws AccessPoemException {
455     Column<String> c = _getAuthorWebSiteTable().getDisplaynameColumn();
456     return new Field<String>((String)c.getRaw(this), c);
457   }
458 
459 
460  /**
461   * Retrieves the <code>Displayorder</code> value, without locking, 
462   * for this <code>AuthorWebSite</code> <code>Persistent</code>.
463   *
464   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
465   * @return the Integer displayorder
466   */
467   public Integer getDisplayorder_unsafe() {
468     return displayorder;
469   }
470 
471 
472  /**
473   * Sets the <code>Displayorder</code> value directly, without checking, 
474   * for this AuthorWebSite <code>Persistent</code>.
475   * 
476   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
477   * @param cooked  the pre-validated value to set
478   */
479   public void setDisplayorder_unsafe(Integer cooked) {
480     displayorder = cooked;
481   }
482 
483  /**
484   * Retrieves the Displayorder value, with locking, for this 
485   * <code>AuthorWebSite</code> <code>Persistent</code>.
486   * 
487   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
488   * @throws AccessPoemException 
489   *         if the current <code>AccessToken</code> 
490   *         does not confer write access rights 
491   * @return the value of the field <code>Displayorder</code> for this 
492   *         <code>AuthorWebSite</code> <code>Persistent</code>  
493   */
494 
495   public Integer getDisplayorder()
496       throws AccessPoemException {
497     readLock();
498     return getDisplayorder_unsafe();
499   }
500 
501 
502  /**
503   * Sets the <code>Displayorder</code> value, with checking, for this 
504   * <code>AuthorWebSite</code> <code>Persistent</code>.
505   * 
506   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
507   * @param cooked  a validated <code>int</code> 
508   * @throws AccessPoemException 
509   *         if the current <code>AccessToken</code> 
510   *         does not confer write access rights
511   * @throws ValidationPoemException 
512   *         if the value is not valid
513   */
514   public void setDisplayorder(Integer cooked)
515       throws AccessPoemException, ValidationPoemException {
516     _getAuthorWebSiteTable().getDisplayorderColumn().
517       getType().assertValidCooked(cooked);
518     writeLock();
519     setDisplayorder_unsafe(cooked);
520   }
521 
522  /**
523   * Sets the <code>Displayorder</code> value, with checking, for this 
524   * <code>AuthorWebSite</code> <code>Persistent</code>.
525   * 
526   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
527   * @param cooked  a validated <code>int</code>
528   * @throws AccessPoemException 
529   *         if the current <code>AccessToken</code> 
530   *         does not confer write access rights
531   * @throws ValidationPoemException 
532   *         if the value is not valid
533   */
534 
535   public final void setDisplayorder(int cooked)
536       throws AccessPoemException, ValidationPoemException {
537     setDisplayorder(new Integer(cooked));
538   }
539 
540 
541  /**
542   * Retrieves the <code>Displayorder</code> value as a <code>Field</code>
543   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
544   * 
545   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
546   * @throws AccessPoemException 
547   *         if the current <code>AccessToken</code> 
548   *         does not confer write access rights
549   * @return the Integer displayorder
550   */
551   public Field<Integer> getDisplayorderField() throws AccessPoemException {
552     Column<Integer> c = _getAuthorWebSiteTable().getDisplayorderColumn();
553     return new Field<Integer>((Integer)c.getRaw(this), c);
554   }
555 
556 
557  /**
558   * Retrieves the <code>Description</code> value, without locking, 
559   * for this <code>AuthorWebSite</code> <code>Persistent</code>.
560   *
561   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
562   * @return the String description
563   */
564   public String getDescription_unsafe() {
565     return description;
566   }
567 
568 
569  /**
570   * Sets the <code>Description</code> value directly, without checking, 
571   * for this AuthorWebSite <code>Persistent</code>.
572   * 
573   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
574   * @param cooked  the pre-validated value to set
575   */
576   public void setDescription_unsafe(String cooked) {
577     description = cooked;
578   }
579 
580  /**
581   * Retrieves the Description value, with locking, for this 
582   * <code>AuthorWebSite</code> <code>Persistent</code>.
583   * 
584   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
585   * @throws AccessPoemException 
586   *         if the current <code>AccessToken</code> 
587   *         does not confer write access rights 
588   * @return the value of the field <code>Description</code> for this 
589   *         <code>AuthorWebSite</code> <code>Persistent</code>  
590   */
591 
592   public String getDescription()
593       throws AccessPoemException {
594     readLock();
595     return getDescription_unsafe();
596   }
597 
598 
599  /**
600   * Sets the <code>Description</code> value, with checking, for this 
601   * <code>AuthorWebSite</code> <code>Persistent</code>.
602   * 
603   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
604   * @param cooked  a validated <code>int</code> 
605   * @throws AccessPoemException 
606   *         if the current <code>AccessToken</code> 
607   *         does not confer write access rights
608   * @throws ValidationPoemException 
609   *         if the value is not valid
610   */
611   public void setDescription(String cooked)
612       throws AccessPoemException, ValidationPoemException {
613     _getAuthorWebSiteTable().getDescriptionColumn().
614       getType().assertValidCooked(cooked);
615     writeLock();
616     setDescription_unsafe(cooked);
617   }
618 
619 
620  /**
621   * Retrieves the <code>Description</code> value as a <code>Field</code>
622   * from this <code>AuthorWebSite</code> <code>Persistent</code>.
623   * 
624   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
625   * @throws AccessPoemException 
626   *         if the current <code>AccessToken</code> 
627   *         does not confer write access rights
628   * @return the String description
629   */
630   public Field<String> getDescriptionField() throws AccessPoemException {
631     Column<String> c = _getAuthorWebSiteTable().getDescriptionColumn();
632     return new Field<String>((String)c.getRaw(this), c);
633   }
634 
635 }
636