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