1
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.Award;
19 import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
20 import org.paneris.jammyjoes.model.JammyjoesTable;
21
22
23 /**
24 * Melati POEM generated base class for
25 <code>Table</code> <code>Award</code>.
26 *
27 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
28 */
29
30 public class AwardTableBase extends JammyjoesTable {
31
32 private Column col_id = null;
33 private Column col_title = null;
34 private Column col_picture = null;
35 private Column col_description = 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 AwardTableBase(
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 ((Award)g).getId();
73 }
74
75 public void setCooked(Persistent g, Object cooked)
76 throws AccessPoemException, ValidationPoemException {
77 ((Award)g).setId((Integer)cooked);
78 }
79
80 public Field asField(Persistent g) {
81 return ((Award)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 ((Award)g).getId_unsafe();
107 }
108
109 public void setRaw_unsafe(Persistent g, Object raw)
110 throws AccessPoemException {
111 ((Award)g).setId_unsafe((Integer)raw);
112 }
113
114 public Object getRaw(Persistent g)
115 throws AccessPoemException {
116 return ((Award)g).getId();
117 }
118
119 public void setRaw(Persistent g, Object raw)
120 throws AccessPoemException {
121 ((Award)g).setId((Integer)raw);
122 }
123 });
124
125 defineColumn(col_title =
126 new Column(this, "title",
127 new StringPoemType(false, -1),
128 DefinitionSource.dsd) {
129 public Object getCooked(Persistent g)
130 throws AccessPoemException, PoemException {
131 return ((Award)g).getTitle();
132 }
133
134 public void setCooked(Persistent g, Object cooked)
135 throws AccessPoemException, ValidationPoemException {
136 ((Award)g).setTitle((String)cooked);
137 }
138
139 public Field asField(Persistent g) {
140 return ((Award)g).getTitleField();
141 }
142
143 protected DisplayLevel defaultDisplayLevel() {
144 return DisplayLevel.primary;
145 }
146
147 protected Searchability defaultSearchability() {
148 return Searchability.yes;
149 }
150
151 protected String defaultDisplayName() {
152 return "Title";
153 }
154
155 protected int defaultDisplayOrder() {
156 return 1;
157 }
158
159 protected boolean defaultUnique() {
160 return true;
161 }
162
163 protected int defaultWidth() {
164 return 20;
165 }
166
167 public Object getRaw_unsafe(Persistent g)
168 throws AccessPoemException {
169 return ((Award)g).getTitle_unsafe();
170 }
171
172 public void setRaw_unsafe(Persistent g, Object raw)
173 throws AccessPoemException {
174 ((Award)g).setTitle_unsafe((String)raw);
175 }
176
177 public Object getRaw(Persistent g)
178 throws AccessPoemException {
179 return ((Award)g).getTitle();
180 }
181
182 public void setRaw(Persistent g, Object raw)
183 throws AccessPoemException {
184 ((Award)g).setTitle((String)raw);
185 }
186 });
187
188 defineColumn(col_picture =
189 new Column(this, "picture",
190 new StringPoemType(true, -1),
191 DefinitionSource.dsd) {
192 public Object getCooked(Persistent g)
193 throws AccessPoemException, PoemException {
194 return ((Award)g).getPicture();
195 }
196
197 public void setCooked(Persistent g, Object cooked)
198 throws AccessPoemException, ValidationPoemException {
199 ((Award)g).setPicture((String)cooked);
200 }
201
202 public Field asField(Persistent g) {
203 return ((Award)g).getPictureField();
204 }
205
206 protected DisplayLevel defaultDisplayLevel() {
207 return DisplayLevel.record;
208 }
209
210 protected Searchability defaultSearchability() {
211 return Searchability.no;
212 }
213
214 protected String defaultDisplayName() {
215 return "Picture";
216 }
217
218 protected int defaultDisplayOrder() {
219 return 2;
220 }
221
222 protected int defaultWidth() {
223 return 20;
224 }
225
226 protected String defaultRenderinfo() {
227 return "Upload";
228 }
229
230 public Object getRaw_unsafe(Persistent g)
231 throws AccessPoemException {
232 return ((Award)g).getPicture_unsafe();
233 }
234
235 public void setRaw_unsafe(Persistent g, Object raw)
236 throws AccessPoemException {
237 ((Award)g).setPicture_unsafe((String)raw);
238 }
239
240 public Object getRaw(Persistent g)
241 throws AccessPoemException {
242 return ((Award)g).getPicture();
243 }
244
245 public void setRaw(Persistent g, Object raw)
246 throws AccessPoemException {
247 ((Award)g).setPicture((String)raw);
248 }
249 });
250
251 defineColumn(col_description =
252 new Column(this, "description",
253 new StringPoemType(true, -1),
254 DefinitionSource.dsd) {
255 public Object getCooked(Persistent g)
256 throws AccessPoemException, PoemException {
257 return ((Award)g).getDescription();
258 }
259
260 public void setCooked(Persistent g, Object cooked)
261 throws AccessPoemException, ValidationPoemException {
262 ((Award)g).setDescription((String)cooked);
263 }
264
265 public Field asField(Persistent g) {
266 return ((Award)g).getDescriptionField();
267 }
268
269 protected DisplayLevel defaultDisplayLevel() {
270 return DisplayLevel.record;
271 }
272
273 protected Searchability defaultSearchability() {
274 return Searchability.yes;
275 }
276
277 protected String defaultDisplayName() {
278 return "Description";
279 }
280
281 protected int defaultDisplayOrder() {
282 return 3;
283 }
284
285 protected int defaultWidth() {
286 return 20;
287 }
288
289 protected int defaultHeight() {
290 return 5;
291 }
292
293 public Object getRaw_unsafe(Persistent g)
294 throws AccessPoemException {
295 return ((Award)g).getDescription_unsafe();
296 }
297
298 public void setRaw_unsafe(Persistent g, Object raw)
299 throws AccessPoemException {
300 ((Award)g).setDescription_unsafe((String)raw);
301 }
302
303 public Object getRaw(Persistent g)
304 throws AccessPoemException {
305 return ((Award)g).getDescription();
306 }
307
308 public void setRaw(Persistent g, Object raw)
309 throws AccessPoemException {
310 ((Award)g).setDescription((String)raw);
311 }
312 });
313 }
314
315
316 /**
317 * Retrieves the <code>Id</code> <code>Column</code> for this
318 * <code>Award</code> <code>Table</code>.
319 *
320 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
321 * @return the id <code>Column</code>
322 */
323 public final Column getIdColumn() {
324 return col_id;
325 }
326
327
328 /**
329 * Retrieves the <code>Title</code> <code>Column</code> for this
330 * <code>Award</code> <code>Table</code>.
331 *
332 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
333 * @return the title <code>Column</code>
334 */
335 public final Column getTitleColumn() {
336 return col_title;
337 }
338
339
340 /**
341 * Retrieves the <code>Picture</code> <code>Column</code> for this
342 * <code>Award</code> <code>Table</code>.
343 *
344 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
345 * @return the picture <code>Column</code>
346 */
347 public final Column getPictureColumn() {
348 return col_picture;
349 }
350
351
352 /**
353 * Retrieves the <code>Description</code> <code>Column</code> for this
354 * <code>Award</code> <code>Table</code>.
355 *
356 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
357 * @return the description <code>Column</code>
358 */
359 public final Column getDescriptionColumn() {
360 return col_description;
361 }
362
363
364 /**
365 * Retrieve the <code>Award</code> as a <code>Award</code>.
366 *
367 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
368 * @param troid a Table Row Oject ID
369 * @return the <code>Persistent</code> identified by the <code>troid</code>
370 */
371 public Award getAwardObject(Integer troid) {
372 return (Award)getObject(troid);
373 }
374
375
376 /**
377 * Retrieve the <code>Award</code>
378 * as a <code>Award</code>.
379 *
380 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
381 * @param troid a Table Row Object ID
382 * @return the <code>Persistent</code> identified */
383 public Award getAwardObject(int troid) {
384 return (Award)getObject(troid);
385 }
386
387 protected JdbcPersistent _newPersistent() {
388 return new Award();
389 }
390 protected String defaultDisplayName() {
391 return "Award";
392 }
393
394 protected String defaultDescription() {
395 return "Award";
396 }
397
398 protected boolean defaultRememberAllTroids() {
399 return true;
400 }
401
402 protected String defaultCategory() {
403 return "Data";
404 }
405
406 protected int defaultDisplayOrder() {
407 return 50;
408 }
409 }
410