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.DoublePoemType;
11  import org.melati.poem.Field;
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.JammyjoesDatabaseTables;
20  import org.paneris.jammyjoes.model.JammyjoesTable;
21  import org.paneris.jammyjoes.model.ShopCurrency;
22  
23  
24  /**
25   * Melati POEM generated base class for 
26  <code>Table</code> <code>ShopCurrency</code>.
27   *
28   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
29   */
30  
31  public class ShopCurrencyTableBase extends JammyjoesTable {
32  
33    private Column col_id = null;
34    private Column col_name = null;
35    private Column col_conversionrate = null;
36    private Column col_locale = null;
37  
38   /**
39    * Constructor. 
40    * 
41    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
42    * @param database          the POEM database we are using
43    * @param name              the name of this <code>Table</code>
44    * @param definitionSource  which definition is being used
45    * @throws PoemException    if anything goes wrong
46    */
47  
48    public ShopCurrencyTableBase(
49        Database database, String name,
50        DefinitionSource definitionSource) throws PoemException {
51      super(database, name, definitionSource);
52    }
53  
54  
55   /**
56    * Get the database tables.
57    *
58    * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
59    * @return the database tables
60    */
61    public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
62      return (JammyjoesDatabaseTables)getDatabase();
63    }
64  
65    public void init() throws PoemException {
66      super.init();
67      defineColumn(col_id =
68          new Column(this, "id",
69                     new TroidPoemType(),
70                     DefinitionSource.dsd) { 
71            public Object getCooked(Persistent g)
72                throws AccessPoemException, PoemException {
73              return ((ShopCurrency)g).getId();
74            }
75  
76            public void setCooked(Persistent g, Object cooked)
77                throws AccessPoemException, ValidationPoemException {
78              ((ShopCurrency)g).setId((Integer)cooked);
79            }
80  
81            public Field asField(Persistent g) {
82              return ((ShopCurrency)g).getIdField();
83            }
84  
85            protected boolean defaultUserEditable() {
86              return false;
87            }
88  
89            protected boolean defaultUserCreateable() {
90              return false;
91            }
92  
93            protected DisplayLevel defaultDisplayLevel() {
94              return DisplayLevel.record;
95            }
96  
97            protected int defaultDisplayOrder() {
98              return 0;
99            }
100 
101           public Object getRaw_unsafe(Persistent g)
102               throws AccessPoemException {
103             return ((ShopCurrency)g).getId_unsafe();
104           }
105 
106           public void setRaw_unsafe(Persistent g, Object raw)
107               throws AccessPoemException {
108             ((ShopCurrency)g).setId_unsafe((Integer)raw);
109           }
110 
111           public Object getRaw(Persistent g)
112               throws AccessPoemException {
113             return ((ShopCurrency)g).getId();
114           }
115 
116           public void setRaw(Persistent g, Object raw)
117               throws AccessPoemException {
118             ((ShopCurrency)g).setId((Integer)raw);
119           }
120         });
121 
122     defineColumn(col_name =
123         new Column(this, "name",
124                    new StringPoemType(false, -1),
125                    DefinitionSource.dsd) { 
126           public Object getCooked(Persistent g)
127               throws AccessPoemException, PoemException {
128             return ((ShopCurrency)g).getName();
129           }
130 
131           public void setCooked(Persistent g, Object cooked)
132               throws AccessPoemException, ValidationPoemException {
133             ((ShopCurrency)g).setName((String)cooked);
134           }
135 
136           public Field asField(Persistent g) {
137             return ((ShopCurrency)g).getNameField();
138           }
139 
140           protected DisplayLevel defaultDisplayLevel() {
141             return DisplayLevel.primary;
142           }
143 
144           protected Searchability defaultSearchability() {
145             return Searchability.primary;
146           }
147 
148           protected String defaultDisplayName() {
149             return "Currency name";
150           }
151 
152           protected int defaultDisplayOrder() {
153             return 1;
154           }
155 
156           protected String defaultDescription() {
157             return "The name of the currency";
158           }
159 
160           public Object getRaw_unsafe(Persistent g)
161               throws AccessPoemException {
162             return ((ShopCurrency)g).getName_unsafe();
163           }
164 
165           public void setRaw_unsafe(Persistent g, Object raw)
166               throws AccessPoemException {
167             ((ShopCurrency)g).setName_unsafe((String)raw);
168           }
169 
170           public Object getRaw(Persistent g)
171               throws AccessPoemException {
172             return ((ShopCurrency)g).getName();
173           }
174 
175           public void setRaw(Persistent g, Object raw)
176               throws AccessPoemException {
177             ((ShopCurrency)g).setName((String)raw);
178           }
179         });
180 
181     defineColumn(col_conversionrate =
182         new Column(this, "conversionrate",
183                    new DoublePoemType(false),
184                    DefinitionSource.dsd) { 
185           public Object getCooked(Persistent g)
186               throws AccessPoemException, PoemException {
187             return ((ShopCurrency)g).getConversionrate();
188           }
189 
190           public void setCooked(Persistent g, Object cooked)
191               throws AccessPoemException, ValidationPoemException {
192             ((ShopCurrency)g).setConversionrate((Double)cooked);
193           }
194 
195           public Field asField(Persistent g) {
196             return ((ShopCurrency)g).getConversionrateField();
197           }
198 
199           protected DisplayLevel defaultDisplayLevel() {
200             return DisplayLevel.summary;
201           }
202 
203           protected Searchability defaultSearchability() {
204             return Searchability.no;
205           }
206 
207           protected String defaultDisplayName() {
208             return "Conversion Rate";
209           }
210 
211           protected int defaultDisplayOrder() {
212             return 2;
213           }
214 
215           protected String defaultDescription() {
216             return "The rate at which UK Pounds Sterling are converted into this currency";
217           }
218 
219           public Object getRaw_unsafe(Persistent g)
220               throws AccessPoemException {
221             return ((ShopCurrency)g).getConversionrate_unsafe();
222           }
223 
224           public void setRaw_unsafe(Persistent g, Object raw)
225               throws AccessPoemException {
226             ((ShopCurrency)g).setConversionrate_unsafe((Double)raw);
227           }
228 
229           public Object getRaw(Persistent g)
230               throws AccessPoemException {
231             return ((ShopCurrency)g).getConversionrate();
232           }
233 
234           public void setRaw(Persistent g, Object raw)
235               throws AccessPoemException {
236             ((ShopCurrency)g).setConversionrate((Double)raw);
237           }
238         });
239 
240     defineColumn(col_locale =
241         new Column(this, "locale",
242                    new StringPoemType(false, -1),
243                    DefinitionSource.dsd) { 
244           public Object getCooked(Persistent g)
245               throws AccessPoemException, PoemException {
246             return ((ShopCurrency)g).getLocale();
247           }
248 
249           public void setCooked(Persistent g, Object cooked)
250               throws AccessPoemException, ValidationPoemException {
251             ((ShopCurrency)g).setLocale((String)cooked);
252           }
253 
254           public Field asField(Persistent g) {
255             return ((ShopCurrency)g).getLocaleField();
256           }
257 
258           protected DisplayLevel defaultDisplayLevel() {
259             return DisplayLevel.summary;
260           }
261 
262           protected Searchability defaultSearchability() {
263             return Searchability.no;
264           }
265 
266           protected String defaultDisplayName() {
267             return "Currency locale";
268           }
269 
270           protected int defaultDisplayOrder() {
271             return 3;
272           }
273 
274           protected String defaultDescription() {
275             return "The locale of the currency for formatting";
276           }
277 
278           public Object getRaw_unsafe(Persistent g)
279               throws AccessPoemException {
280             return ((ShopCurrency)g).getLocale_unsafe();
281           }
282 
283           public void setRaw_unsafe(Persistent g, Object raw)
284               throws AccessPoemException {
285             ((ShopCurrency)g).setLocale_unsafe((String)raw);
286           }
287 
288           public Object getRaw(Persistent g)
289               throws AccessPoemException {
290             return ((ShopCurrency)g).getLocale();
291           }
292 
293           public void setRaw(Persistent g, Object raw)
294               throws AccessPoemException {
295             ((ShopCurrency)g).setLocale((String)raw);
296           }
297         });
298   }
299 
300 
301  /**
302   * Retrieves the <code>Id</code> <code>Column</code> for this 
303   * <code>ShopCurrency</code> <code>Table</code>.
304   * 
305   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
306   * @return the id <code>Column</code>
307   */
308   public final Column getIdColumn() {
309     return col_id;
310   }
311 
312 
313  /**
314   * Retrieves the <code>Name</code> <code>Column</code> for this 
315   * <code>ShopCurrency</code> <code>Table</code>.
316   * 
317   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
318   * @return the name <code>Column</code>
319   */
320   public final Column getNameColumn() {
321     return col_name;
322   }
323 
324 
325  /**
326   * Retrieves the <code>Conversionrate</code> <code>Column</code> for this 
327   * <code>ShopCurrency</code> <code>Table</code>.
328   * 
329   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
330   * @return the conversionrate <code>Column</code>
331   */
332   public final Column getConversionrateColumn() {
333     return col_conversionrate;
334   }
335 
336 
337  /**
338   * Retrieves the <code>Locale</code> <code>Column</code> for this 
339   * <code>ShopCurrency</code> <code>Table</code>.
340   * 
341   * @generator org.melati.poem.prepro.FieldDef#generateColAccessor 
342   * @return the locale <code>Column</code>
343   */
344   public final Column getLocaleColumn() {
345     return col_locale;
346   }
347 
348 
349  /**
350   * Retrieve the <code>ShopCurrency</code> as a <code>ShopCurrency</code>.
351   *
352   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
353   * @param troid a Table Row Oject ID
354   * @return the <code>Persistent</code> identified by the <code>troid</code>
355   */
356   public ShopCurrency getShopCurrencyObject(Integer troid) {
357     return (ShopCurrency)getObject(troid);
358   }
359 
360 
361  /**
362   * Retrieve the <code>ShopCurrency</code> 
363   * as a <code>ShopCurrency</code>.
364   *
365   * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava 
366   * @param troid a Table Row Object ID
367   * @return the <code>Persistent</code> identified   */
368   public ShopCurrency getShopCurrencyObject(int troid) {
369     return (ShopCurrency)getObject(troid);
370   }
371 
372   protected JdbcPersistent _newPersistent() {
373     return new ShopCurrency();
374   }
375   protected String defaultDisplayName() {
376     return "Currency";
377   }
378 
379   protected String defaultDescription() {
380     return "A currency used for shopping";
381   }
382 
383   protected boolean defaultRememberAllTroids() {
384     return true;
385   }
386 
387   protected Integer defaultCacheLimit() {
388     return new Integer(999999999);
389   }
390 
391   protected String defaultCategory() {
392     return "Codes";
393   }
394 
395   protected int defaultDisplayOrder() {
396     return 1230;
397   }
398 }
399