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 java.sql.Timestamp;
7   import org.melati.poem.AccessPoemException;
8   import org.melati.poem.Column;
9   import org.melati.poem.Database;
10  import org.melati.poem.DefinitionSource;
11  import org.melati.poem.DisplayLevel;
12  import org.melati.poem.Field;
13  import org.melati.poem.JdbcPersistent;
14  import org.melati.poem.Persistent;
15  import org.melati.poem.PoemException;
16  import org.melati.poem.StringPoemType;
17  import org.melati.poem.TimestampPoemType;
18  import org.melati.poem.TroidPoemType;
19  import org.melati.poem.ValidationPoemException;
20  import org.paneris.bibliomania.BibliomaniaDatabaseTables;
21  import org.paneris.bibliomania.BibliomaniaTable;
22  import org.paneris.bibliomania.StockingsSearch;
23  
24  
25  /**
26   * Melati POEM generated base class for <code>Table</code> <code>StockingsSearch</code>.
27   *
28   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
29   */
30  
31  public class StockingsSearchTableBase<T extends StockingsSearch> extends BibliomaniaTable<T> {
32  
33    private Column<Integer> col_id = null;
34    private Column<String> col_authorterm = null;
35    private Column<String> col_titleterm = null;
36    private Column<Timestamp> col_lastperformed = null;
37    private Column<Timestamp> col_lastaccessed = null;
38  
39   /**
40    * Constructor. 
41    * 
42    * see 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 StockingsSearchTableBase(
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    * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
60    * @return the database tables
61    */
62    public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
63      return (BibliomaniaDatabaseTables)getDatabase();
64    }
65  
66  
67   /**
68    * Initialise this table by defining its columns.
69    *
70    * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
71    */
72    public void init() throws PoemException {
73      super.init();
74      defineColumn(col_id =
75          new Column<Integer>(this, "id",
76                     new TroidPoemType(),
77                     DefinitionSource.dsd) { 
78            public Object getCooked(Persistent g)
79                throws AccessPoemException, PoemException {
80              return ((StockingsSearch)g).getId();
81            }
82  
83            public void setCooked(Persistent g, Object cooked)
84                throws AccessPoemException, ValidationPoemException {
85              ((StockingsSearch)g).setId((Integer)cooked);
86            }
87  
88            public Field<Integer> asField(Persistent g) {
89              return ((StockingsSearch)g).getIdField();
90            }
91  
92            public boolean defaultUserEditable() {
93              return false;
94            }
95  
96            public boolean defaultUserCreateable() {
97              return false;
98            }
99  
100           public DisplayLevel defaultDisplayLevel() {
101             return DisplayLevel.record;
102           }
103 
104           public int defaultDisplayOrder() {
105             return 0;
106           }
107 
108           public Object getRaw_unsafe(Persistent g)
109               throws AccessPoemException {
110             return ((StockingsSearch)g).getId_unsafe();
111           }
112 
113           public void setRaw_unsafe(Persistent g, Object raw)
114               throws AccessPoemException {
115             ((StockingsSearch)g).setId_unsafe((Integer)raw);
116           }
117 
118           public Object getRaw(Persistent g)
119               throws AccessPoemException {
120             return ((StockingsSearch)g).getId();
121           }
122 
123           public void setRaw(Persistent g, Object raw)
124               throws AccessPoemException {
125             ((StockingsSearch)g).setId((Integer)raw);
126           }
127         });
128 
129     defineColumn(col_authorterm =
130         new Column<String>(this, "authorterm",
131                    new StringPoemType(false, -1),
132                    DefinitionSource.dsd) { 
133           public Object getCooked(Persistent g)
134               throws AccessPoemException, PoemException {
135             return ((StockingsSearch)g).getAuthorterm();
136           }
137 
138           public void setCooked(Persistent g, Object cooked)
139               throws AccessPoemException, ValidationPoemException {
140             ((StockingsSearch)g).setAuthorterm((String)cooked);
141           }
142 
143           public Field<String> asField(Persistent g) {
144             return ((StockingsSearch)g).getAuthortermField();
145           }
146 
147           public int defaultDisplayOrder() {
148             return 1;
149           }
150 
151           public boolean defaultIndexed() {
152             return true;
153           }
154 
155           public Object getRaw_unsafe(Persistent g)
156               throws AccessPoemException {
157             return ((StockingsSearch)g).getAuthorterm_unsafe();
158           }
159 
160           public void setRaw_unsafe(Persistent g, Object raw)
161               throws AccessPoemException {
162             ((StockingsSearch)g).setAuthorterm_unsafe((String)raw);
163           }
164 
165           public Object getRaw(Persistent g)
166               throws AccessPoemException {
167             return ((StockingsSearch)g).getAuthorterm();
168           }
169 
170           public void setRaw(Persistent g, Object raw)
171               throws AccessPoemException {
172             ((StockingsSearch)g).setAuthorterm((String)raw);
173           }
174         });
175 
176     defineColumn(col_titleterm =
177         new Column<String>(this, "titleterm",
178                    new StringPoemType(false, -1),
179                    DefinitionSource.dsd) { 
180           public Object getCooked(Persistent g)
181               throws AccessPoemException, PoemException {
182             return ((StockingsSearch)g).getTitleterm();
183           }
184 
185           public void setCooked(Persistent g, Object cooked)
186               throws AccessPoemException, ValidationPoemException {
187             ((StockingsSearch)g).setTitleterm((String)cooked);
188           }
189 
190           public Field<String> asField(Persistent g) {
191             return ((StockingsSearch)g).getTitletermField();
192           }
193 
194           public int defaultDisplayOrder() {
195             return 2;
196           }
197 
198           public boolean defaultIndexed() {
199             return true;
200           }
201 
202           public Object getRaw_unsafe(Persistent g)
203               throws AccessPoemException {
204             return ((StockingsSearch)g).getTitleterm_unsafe();
205           }
206 
207           public void setRaw_unsafe(Persistent g, Object raw)
208               throws AccessPoemException {
209             ((StockingsSearch)g).setTitleterm_unsafe((String)raw);
210           }
211 
212           public Object getRaw(Persistent g)
213               throws AccessPoemException {
214             return ((StockingsSearch)g).getTitleterm();
215           }
216 
217           public void setRaw(Persistent g, Object raw)
218               throws AccessPoemException {
219             ((StockingsSearch)g).setTitleterm((String)raw);
220           }
221         });
222 
223     defineColumn(col_lastperformed =
224         new Column<Timestamp>(this, "lastperformed",
225                    new TimestampPoemType(true),
226                    DefinitionSource.dsd) { 
227           public Object getCooked(Persistent g)
228               throws AccessPoemException, PoemException {
229             return ((StockingsSearch)g).getLastperformed();
230           }
231 
232           public void setCooked(Persistent g, Object cooked)
233               throws AccessPoemException, ValidationPoemException {
234             ((StockingsSearch)g).setLastperformed((Timestamp)cooked);
235           }
236 
237           public Field<Timestamp> asField(Persistent g) {
238             return ((StockingsSearch)g).getLastperformedField();
239           }
240 
241           public int defaultDisplayOrder() {
242             return 3;
243           }
244 
245           public Object getRaw_unsafe(Persistent g)
246               throws AccessPoemException {
247             return ((StockingsSearch)g).getLastperformed_unsafe();
248           }
249 
250           public void setRaw_unsafe(Persistent g, Object raw)
251               throws AccessPoemException {
252             ((StockingsSearch)g).setLastperformed_unsafe((Timestamp)raw);
253           }
254 
255           public Object getRaw(Persistent g)
256               throws AccessPoemException {
257             return ((StockingsSearch)g).getLastperformed();
258           }
259 
260           public void setRaw(Persistent g, Object raw)
261               throws AccessPoemException {
262             ((StockingsSearch)g).setLastperformed((Timestamp)raw);
263           }
264         });
265 
266     defineColumn(col_lastaccessed =
267         new Column<Timestamp>(this, "lastaccessed",
268                    new TimestampPoemType(true),
269                    DefinitionSource.dsd) { 
270           public Object getCooked(Persistent g)
271               throws AccessPoemException, PoemException {
272             return ((StockingsSearch)g).getLastaccessed();
273           }
274 
275           public void setCooked(Persistent g, Object cooked)
276               throws AccessPoemException, ValidationPoemException {
277             ((StockingsSearch)g).setLastaccessed((Timestamp)cooked);
278           }
279 
280           public Field<Timestamp> asField(Persistent g) {
281             return ((StockingsSearch)g).getLastaccessedField();
282           }
283 
284           public int defaultDisplayOrder() {
285             return 4;
286           }
287 
288           public boolean defaultIndexed() {
289             return true;
290           }
291 
292           public Object getRaw_unsafe(Persistent g)
293               throws AccessPoemException {
294             return ((StockingsSearch)g).getLastaccessed_unsafe();
295           }
296 
297           public void setRaw_unsafe(Persistent g, Object raw)
298               throws AccessPoemException {
299             ((StockingsSearch)g).setLastaccessed_unsafe((Timestamp)raw);
300           }
301 
302           public Object getRaw(Persistent g)
303               throws AccessPoemException {
304             return ((StockingsSearch)g).getLastaccessed();
305           }
306 
307           public void setRaw(Persistent g, Object raw)
308               throws AccessPoemException {
309             ((StockingsSearch)g).setLastaccessed((Timestamp)raw);
310           }
311         });
312   }
313 
314 
315  /**
316   * Retrieves the <code>Id</code> <code>Column</code> for this 
317   * <code>StockingsSearch</code> <code>Table</code>.
318   * 
319   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
320   * @return the id <code>Column</code>
321   */
322   public final Column<Integer> getIdColumn() {
323     return col_id;
324   }
325 
326 
327  /**
328   * Retrieves the <code>Authorterm</code> <code>Column</code> for this 
329   * <code>StockingsSearch</code> <code>Table</code>.
330   * 
331   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
332   * @return the authorterm <code>Column</code>
333   */
334   public final Column<String> getAuthortermColumn() {
335     return col_authorterm;
336   }
337 
338 
339  /**
340   * Retrieves the <code>Titleterm</code> <code>Column</code> for this 
341   * <code>StockingsSearch</code> <code>Table</code>.
342   * 
343   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
344   * @return the titleterm <code>Column</code>
345   */
346   public final Column<String> getTitletermColumn() {
347     return col_titleterm;
348   }
349 
350 
351  /**
352   * Retrieves the <code>Lastperformed</code> <code>Column</code> for this 
353   * <code>StockingsSearch</code> <code>Table</code>.
354   * 
355   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
356   * @return the lastperformed <code>Column</code>
357   */
358   public final Column<Timestamp> getLastperformedColumn() {
359     return col_lastperformed;
360   }
361 
362 
363  /**
364   * Retrieves the <code>Lastaccessed</code> <code>Column</code> for this 
365   * <code>StockingsSearch</code> <code>Table</code>.
366   * 
367   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
368   * @return the lastaccessed <code>Column</code>
369   */
370   public final Column<Timestamp> getLastaccessedColumn() {
371     return col_lastaccessed;
372   }
373 
374 
375  /**
376   * Retrieve the <code>StockingsSearch</code> as a <code>StockingsSearch</code>.
377   *
378   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
379   * @param troid a Table Row Oject ID
380   * @return the <code>Persistent</code> identified by the <code>troid</code>
381   */
382   public StockingsSearch getStockingsSearchObject(Integer troid) {
383     return (StockingsSearch)getObject(troid);
384   }
385 
386 
387  /**
388   * Retrieve the <code>StockingsSearch</code> 
389   * as a <code>StockingsSearch</code>.
390   *
391   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
392   * @param troid a Table Row Object ID
393   * @return the <code>Persistent</code> identified   */
394   public StockingsSearch getStockingsSearchObject(int troid) {
395     return (StockingsSearch)getObject(troid);
396   }
397 
398   protected JdbcPersistent _newPersistent() {
399     return new StockingsSearch();
400   }
401   public String defaultDescription() {
402     return "A record of an online bookshop search";
403   }
404 
405   public String defaultCategory() {
406     return "Comparison Shopper";
407   }
408 
409   public int defaultDisplayOrder() {
410     return 1330;
411   }
412 }
413