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