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.JdbcPersistent;
12  import org.melati.poem.Persistent;
13  import org.melati.poem.PoemException;
14  import org.melati.poem.Searchability;
15  import org.melati.poem.StringPoemType;
16  import org.melati.poem.TroidPoemType;
17  import org.melati.poem.ValidationPoemException;
18  import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
19  import org.paneris.jammyjoes.model.JammyjoesTable;
20  import org.paneris.jammyjoes.model.Type;
21  
22  
23  /**
24   * Melati POEM generated base class for 
25  <code>Table</code> <code>Type</code>.
26   *
27   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
28   */
29  
30  public class TypeTableBase extends JammyjoesTable {
31  
32    private Column col_id = null;
33    private Column col_type = null;
34    private Column col_ecentives = null;
35  
36   /**
37    * Constructor. 
38    * 
39    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
40    * @param database          the POEM database we are using
41    * @param name              the name of this <code>Table</code>
42    * @param definitionSource  which definition is being used
43    * @throws PoemException    if anything goes wrong
44    */
45  
46    public TypeTableBase(
47        Database database, String name,
48        DefinitionSource definitionSource) throws PoemException {
49      super(database, name, definitionSource);
50    }
51  
52  
53   /**
54    * Get the database tables.
55    *
56    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
57    * @return the database tables
58    */
59    public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
60      return (JammyjoesDatabaseTables)getDatabase();
61    }
62  
63    public void init() throws PoemException {
64      super.init();
65      defineColumn(col_id =
66          new Column(this, "id",
67                     new TroidPoemType(),
68                     DefinitionSource.dsd) { 
69            public Object getCooked(Persistent g)
70                throws AccessPoemException, PoemException {
71              return ((Type)g).getId();
72            }
73  
74            public void setCooked(Persistent g, Object cooked)
75                throws AccessPoemException, ValidationPoemException {
76              ((Type)g).setId((Integer)cooked);
77            }
78  
79            public Field asField(Persistent g) {
80              return ((Type)g).getIdField();
81            }
82  
83            protected boolean defaultUserEditable() {
84              return false;
85            }
86  
87            protected boolean defaultUserCreateable() {
88              return false;
89            }
90  
91            protected DisplayLevel defaultDisplayLevel() {
92              return DisplayLevel.record;
93            }
94  
95            protected Searchability defaultSearchability() {
96              return Searchability.no;
97            }
98  
99            protected int defaultDisplayOrder() {
100             return 0;
101           }
102 
103           public Object getRaw_unsafe(Persistent g)
104               throws AccessPoemException {
105             return ((Type)g).getId_unsafe();
106           }
107 
108           public void setRaw_unsafe(Persistent g, Object raw)
109               throws AccessPoemException {
110             ((Type)g).setId_unsafe((Integer)raw);
111           }
112 
113           public Object getRaw(Persistent g)
114               throws AccessPoemException {
115             return ((Type)g).getId();
116           }
117 
118           public void setRaw(Persistent g, Object raw)
119               throws AccessPoemException {
120             ((Type)g).setId((Integer)raw);
121           }
122         });
123 
124     defineColumn(col_type =
125         new Column(this, "type",
126                    new StringPoemType(false, -1),
127                    DefinitionSource.dsd) { 
128           public Object getCooked(Persistent g)
129               throws AccessPoemException, PoemException {
130             return ((Type)g).getType();
131           }
132 
133           public void setCooked(Persistent g, Object cooked)
134               throws AccessPoemException, ValidationPoemException {
135             ((Type)g).setType((String)cooked);
136           }
137 
138           public Field asField(Persistent g) {
139             return ((Type)g).getTypeField();
140           }
141 
142           protected DisplayLevel defaultDisplayLevel() {
143             return DisplayLevel.primary;
144           }
145 
146           protected Searchability defaultSearchability() {
147             return Searchability.yes;
148           }
149 
150           protected String defaultDisplayName() {
151             return "Type";
152           }
153 
154           protected int defaultDisplayOrder() {
155             return 1;
156           }
157 
158           protected boolean defaultUnique() {
159             return true;
160           }
161 
162           protected int defaultWidth() {
163             return 20;
164           }
165 
166           public Object getRaw_unsafe(Persistent g)
167               throws AccessPoemException {
168             return ((Type)g).getType_unsafe();
169           }
170 
171           public void setRaw_unsafe(Persistent g, Object raw)
172               throws AccessPoemException {
173             ((Type)g).setType_unsafe((String)raw);
174           }
175 
176           public Object getRaw(Persistent g)
177               throws AccessPoemException {
178             return ((Type)g).getType();
179           }
180 
181           public void setRaw(Persistent g, Object raw)
182               throws AccessPoemException {
183             ((Type)g).setType((String)raw);
184           }
185         });
186 
187     defineColumn(col_ecentives =
188         new Column(this, "ecentives",
189                    new StringPoemType(true, -1),
190                    DefinitionSource.dsd) { 
191           public Object getCooked(Persistent g)
192               throws AccessPoemException, PoemException {
193             return ((Type)g).getEcentives();
194           }
195 
196           public void setCooked(Persistent g, Object cooked)
197               throws AccessPoemException, ValidationPoemException {
198             ((Type)g).setEcentives((String)cooked);
199           }
200 
201           public Field asField(Persistent g) {
202             return ((Type)g).getEcentivesField();
203           }
204 
205           protected DisplayLevel defaultDisplayLevel() {
206             return DisplayLevel.record;
207           }
208 
209           protected Searchability defaultSearchability() {
210             return Searchability.yes;
211           }
212 
213           protected String defaultDisplayName() {
214             return "Ecentives Category";
215           }
216 
217           protected int defaultDisplayOrder() {
218             return 2;
219           }
220 
221           protected int defaultWidth() {
222             return 40;
223           }
224 
225           public Object getRaw_unsafe(Persistent g)
226               throws AccessPoemException {
227             return ((Type)g).getEcentives_unsafe();
228           }
229 
230           public void setRaw_unsafe(Persistent g, Object raw)
231               throws AccessPoemException {
232             ((Type)g).setEcentives_unsafe((String)raw);
233           }
234 
235           public Object getRaw(Persistent g)
236               throws AccessPoemException {
237             return ((Type)g).getEcentives();
238           }
239 
240           public void setRaw(Persistent g, Object raw)
241               throws AccessPoemException {
242             ((Type)g).setEcentives((String)raw);
243           }
244         });
245   }
246 
247 
248  /**
249   * Retrieves the <code>Id</code> <code>Column</code> for this 
250   * <code>Type</code> <code>Table</code>.
251   * 
252   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
253   * @return the id <code>Column</code>
254   */
255   public final Column getIdColumn() {
256     return col_id;
257   }
258 
259 
260  /**
261   * Retrieves the <code>Type</code> <code>Column</code> for this 
262   * <code>Type</code> <code>Table</code>.
263   * 
264   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
265   * @return the type <code>Column</code>
266   */
267   public final Column getTypeColumn() {
268     return col_type;
269   }
270 
271 
272  /**
273   * Retrieves the <code>Ecentives</code> <code>Column</code> for this 
274   * <code>Type</code> <code>Table</code>.
275   * 
276   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
277   * @return the ecentives <code>Column</code>
278   */
279   public final Column getEcentivesColumn() {
280     return col_ecentives;
281   }
282 
283 
284  /**
285   * Retrieve the <code>Type</code> as a <code>Type</code>.
286   *
287   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
288   * @param troid a Table Row Oject ID
289   * @return the <code>Persistent</code> identified by the <code>troid</code>
290   */
291   public Type getTypeObject(Integer troid) {
292     return (Type)getObject(troid);
293   }
294 
295 
296  /**
297   * Retrieve the <code>Type</code> 
298   * as a <code>Type</code>.
299   *
300   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
301   * @param troid a Table Row Object ID
302   * @return the <code>Persistent</code> identified   */
303   public Type getTypeObject(int troid) {
304     return (Type)getObject(troid);
305   }
306 
307   protected JdbcPersistent _newPersistent() {
308     return new Type();
309   }
310   protected String defaultDisplayName() {
311     return "Type";
312   }
313 
314   protected String defaultDescription() {
315     return "Type";
316   }
317 
318   protected boolean defaultRememberAllTroids() {
319     return true;
320   }
321 
322   protected String defaultCategory() {
323     return "Codes";
324   }
325 
326   protected int defaultDisplayOrder() {
327     return 1000;
328   }
329 }
330