View Javadoc

1   // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
2   
3   package org.paneris.jammyjoes.model.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.Searchability;
16  import org.melati.poem.StringPoemType;
17  import org.melati.poem.TroidPoemType;
18  import org.melati.poem.ValidationPoemException;
19  import org.paneris.jammyjoes.model.Age;
20  import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
21  import org.paneris.jammyjoes.model.JammyjoesTable;
22  
23  
24  /**
25   * Melati POEM generated base class for 
26  <code>Table</code> <code>Age</code>.
27   *
28   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
29   */
30  
31  public class AgeTableBase extends JammyjoesTable {
32  
33    private Column col_id = null;
34    private Column col_name = null;
35    private Column col_pluralName = null;
36    private Column col_minage = null;
37    private Column col_maxage = null;
38  
39   /**
40    * Constructor. 
41    * 
42    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
43    * @param database          the POEM database we are using
44    * @param name              the name of this <code>Table</code>
45    * @param definitionSource  which definition is being used
46    * @throws PoemException    if anything goes wrong
47    */
48  
49    public AgeTableBase(
50        Database database, String name,
51        DefinitionSource definitionSource) throws PoemException {
52      super(database, name, definitionSource);
53    }
54  
55  
56   /**
57    * Get the database tables.
58    *
59    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
60    * @return the database tables
61    */
62    public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
63      return (JammyjoesDatabaseTables)getDatabase();
64    }
65  
66    public void init() throws PoemException {
67      super.init();
68      defineColumn(col_id =
69          new Column(this, "id",
70                     new TroidPoemType(),
71                     DefinitionSource.dsd) { 
72            public Object getCooked(Persistent g)
73                throws AccessPoemException, PoemException {
74              return ((Age)g).getId();
75            }
76  
77            public void setCooked(Persistent g, Object cooked)
78                throws AccessPoemException, ValidationPoemException {
79              ((Age)g).setId((Integer)cooked);
80            }
81  
82            public Field asField(Persistent g) {
83              return ((Age)g).getIdField();
84            }
85  
86            protected boolean defaultUserEditable() {
87              return false;
88            }
89  
90            protected boolean defaultUserCreateable() {
91              return false;
92            }
93  
94            protected DisplayLevel defaultDisplayLevel() {
95              return DisplayLevel.record;
96            }
97  
98            protected int defaultDisplayOrder() {
99              return 0;
100           }
101 
102           public Object getRaw_unsafe(Persistent g)
103               throws AccessPoemException {
104             return ((Age)g).getId_unsafe();
105           }
106 
107           public void setRaw_unsafe(Persistent g, Object raw)
108               throws AccessPoemException {
109             ((Age)g).setId_unsafe((Integer)raw);
110           }
111 
112           public Object getRaw(Persistent g)
113               throws AccessPoemException {
114             return ((Age)g).getId();
115           }
116 
117           public void setRaw(Persistent g, Object raw)
118               throws AccessPoemException {
119             ((Age)g).setId((Integer)raw);
120           }
121         });
122 
123     defineColumn(col_name =
124         new Column(this, "name",
125                    new StringPoemType(false, -1),
126                    DefinitionSource.dsd) { 
127           public Object getCooked(Persistent g)
128               throws AccessPoemException, PoemException {
129             return ((Age)g).getName();
130           }
131 
132           public void setCooked(Persistent g, Object cooked)
133               throws AccessPoemException, ValidationPoemException {
134             ((Age)g).setName((String)cooked);
135           }
136 
137           public Field asField(Persistent g) {
138             return ((Age)g).getNameField();
139           }
140 
141           protected DisplayLevel defaultDisplayLevel() {
142             return DisplayLevel.primary;
143           }
144 
145           protected Searchability defaultSearchability() {
146             return Searchability.primary;
147           }
148 
149           protected String defaultDisplayName() {
150             return "Age name (singular)";
151           }
152 
153           protected int defaultDisplayOrder() {
154             return 1;
155           }
156 
157           protected String defaultDescription() {
158             return "Age name (singular)";
159           }
160 
161           public Object getRaw_unsafe(Persistent g)
162               throws AccessPoemException {
163             return ((Age)g).getName_unsafe();
164           }
165 
166           public void setRaw_unsafe(Persistent g, Object raw)
167               throws AccessPoemException {
168             ((Age)g).setName_unsafe((String)raw);
169           }
170 
171           public Object getRaw(Persistent g)
172               throws AccessPoemException {
173             return ((Age)g).getName();
174           }
175 
176           public void setRaw(Persistent g, Object raw)
177               throws AccessPoemException {
178             ((Age)g).setName((String)raw);
179           }
180         });
181 
182     defineColumn(col_pluralName =
183         new Column(this, "pluralName",
184                    new StringPoemType(true, -1),
185                    DefinitionSource.dsd) { 
186           public Object getCooked(Persistent g)
187               throws AccessPoemException, PoemException {
188             return ((Age)g).getPluralName();
189           }
190 
191           public void setCooked(Persistent g, Object cooked)
192               throws AccessPoemException, ValidationPoemException {
193             ((Age)g).setPluralName((String)cooked);
194           }
195 
196           public Field asField(Persistent g) {
197             return ((Age)g).getPluralNameField();
198           }
199 
200           protected String defaultDisplayName() {
201             return "Age name (plural)";
202           }
203 
204           protected int defaultDisplayOrder() {
205             return 2;
206           }
207 
208           protected String defaultDescription() {
209             return "Age name (plural)";
210           }
211 
212           public Object getRaw_unsafe(Persistent g)
213               throws AccessPoemException {
214             return ((Age)g).getPluralName_unsafe();
215           }
216 
217           public void setRaw_unsafe(Persistent g, Object raw)
218               throws AccessPoemException {
219             ((Age)g).setPluralName_unsafe((String)raw);
220           }
221 
222           public Object getRaw(Persistent g)
223               throws AccessPoemException {
224             return ((Age)g).getPluralName();
225           }
226 
227           public void setRaw(Persistent g, Object raw)
228               throws AccessPoemException {
229             ((Age)g).setPluralName((String)raw);
230           }
231         });
232 
233     defineColumn(col_minage =
234         new Column(this, "minage",
235                    new IntegerPoemType(false),
236                    DefinitionSource.dsd) { 
237           public Object getCooked(Persistent g)
238               throws AccessPoemException, PoemException {
239             return ((Age)g).getMinage();
240           }
241 
242           public void setCooked(Persistent g, Object cooked)
243               throws AccessPoemException, ValidationPoemException {
244             ((Age)g).setMinage((Integer)cooked);
245           }
246 
247           public Field asField(Persistent g) {
248             return ((Age)g).getMinageField();
249           }
250 
251           protected DisplayLevel defaultDisplayLevel() {
252             return DisplayLevel.summary;
253           }
254 
255           protected Searchability defaultSearchability() {
256             return Searchability.no;
257           }
258 
259           protected Integer defaultDisplayOrderPriority() {
260             return new Integer(0);
261           }
262 
263           protected String defaultDisplayName() {
264             return "Minimum Age";
265           }
266 
267           protected int defaultDisplayOrder() {
268             return 3;
269           }
270 
271           public Object getRaw_unsafe(Persistent g)
272               throws AccessPoemException {
273             return ((Age)g).getMinage_unsafe();
274           }
275 
276           public void setRaw_unsafe(Persistent g, Object raw)
277               throws AccessPoemException {
278             ((Age)g).setMinage_unsafe((Integer)raw);
279           }
280 
281           public Object getRaw(Persistent g)
282               throws AccessPoemException {
283             return ((Age)g).getMinage();
284           }
285 
286           public void setRaw(Persistent g, Object raw)
287               throws AccessPoemException {
288             ((Age)g).setMinage((Integer)raw);
289           }
290         });
291 
292     defineColumn(col_maxage =
293         new Column(this, "maxage",
294                    new IntegerPoemType(false),
295                    DefinitionSource.dsd) { 
296           public Object getCooked(Persistent g)
297               throws AccessPoemException, PoemException {
298             return ((Age)g).getMaxage();
299           }
300 
301           public void setCooked(Persistent g, Object cooked)
302               throws AccessPoemException, ValidationPoemException {
303             ((Age)g).setMaxage((Integer)cooked);
304           }
305 
306           public Field asField(Persistent g) {
307             return ((Age)g).getMaxageField();
308           }
309 
310           protected DisplayLevel defaultDisplayLevel() {
311             return DisplayLevel.summary;
312           }
313 
314           protected Searchability defaultSearchability() {
315             return Searchability.no;
316           }
317 
318           protected String defaultDisplayName() {
319             return "Maximum Age";
320           }
321 
322           protected int defaultDisplayOrder() {
323             return 4;
324           }
325 
326           public Object getRaw_unsafe(Persistent g)
327               throws AccessPoemException {
328             return ((Age)g).getMaxage_unsafe();
329           }
330 
331           public void setRaw_unsafe(Persistent g, Object raw)
332               throws AccessPoemException {
333             ((Age)g).setMaxage_unsafe((Integer)raw);
334           }
335 
336           public Object getRaw(Persistent g)
337               throws AccessPoemException {
338             return ((Age)g).getMaxage();
339           }
340 
341           public void setRaw(Persistent g, Object raw)
342               throws AccessPoemException {
343             ((Age)g).setMaxage((Integer)raw);
344           }
345         });
346   }
347 
348 
349  /**
350   * Retrieves the <code>Id</code> <code>Column</code> for this 
351   * <code>Age</code> <code>Table</code>.
352   * 
353   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
354   * @return the id <code>Column</code>
355   */
356   public final Column getIdColumn() {
357     return col_id;
358   }
359 
360 
361  /**
362   * Retrieves the <code>Name</code> <code>Column</code> for this 
363   * <code>Age</code> <code>Table</code>.
364   * 
365   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
366   * @return the name <code>Column</code>
367   */
368   public final Column getNameColumn() {
369     return col_name;
370   }
371 
372 
373  /**
374   * Retrieves the <code>PluralName</code> <code>Column</code> for this 
375   * <code>Age</code> <code>Table</code>.
376   * 
377   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
378   * @return the pluralName <code>Column</code>
379   */
380   public final Column getPluralNameColumn() {
381     return col_pluralName;
382   }
383 
384 
385  /**
386   * Retrieves the <code>Minage</code> <code>Column</code> for this 
387   * <code>Age</code> <code>Table</code>.
388   * 
389   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
390   * @return the minage <code>Column</code>
391   */
392   public final Column getMinageColumn() {
393     return col_minage;
394   }
395 
396 
397  /**
398   * Retrieves the <code>Maxage</code> <code>Column</code> for this 
399   * <code>Age</code> <code>Table</code>.
400   * 
401   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
402   * @return the maxage <code>Column</code>
403   */
404   public final Column getMaxageColumn() {
405     return col_maxage;
406   }
407 
408 
409  /**
410   * Retrieve the <code>Age</code> as a <code>Age</code>.
411   *
412   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
413   * @param troid a Table Row Oject ID
414   * @return the <code>Persistent</code> identified by the <code>troid</code>
415   */
416   public Age getAgeObject(Integer troid) {
417     return (Age)getObject(troid);
418   }
419 
420 
421  /**
422   * Retrieve the <code>Age</code> 
423   * as a <code>Age</code>.
424   *
425   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
426   * @param troid a Table Row Object ID
427   * @return the <code>Persistent</code> identified   */
428   public Age getAgeObject(int troid) {
429     return (Age)getObject(troid);
430   }
431 
432   protected JdbcPersistent _newPersistent() {
433     return new Age();
434   }
435   protected String defaultDisplayName() {
436     return "Ages";
437   }
438 
439   protected String defaultDescription() {
440     return "The Age Categories for Toys";
441   }
442 
443   protected boolean defaultRememberAllTroids() {
444     return true;
445   }
446 
447   protected Integer defaultCacheLimit() {
448     return new Integer(999999999);
449   }
450 
451   protected String defaultCategory() {
452     return "Codes";
453   }
454 
455   protected int defaultDisplayOrder() {
456     return 1240;
457   }
458 }
459