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