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