1 | |
|
2 | |
|
3 | |
package org.paneris.jammyjoes.model.generated; |
4 | |
|
5 | |
import java.sql.Timestamp; |
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.IntegerPoemType; |
14 | |
import org.melati.poem.JdbcPersistent; |
15 | |
import org.melati.poem.Persistent; |
16 | |
import org.melati.poem.PoemException; |
17 | |
import org.melati.poem.Searchability; |
18 | |
import org.melati.poem.StringPoemType; |
19 | |
import org.melati.poem.TimestampPoemType; |
20 | |
import org.melati.poem.TroidPoemType; |
21 | |
import org.melati.poem.ValidationPoemException; |
22 | |
import org.paneris.jammyjoes.model.Affiliate; |
23 | |
import org.paneris.jammyjoes.model.JammyjoesDatabaseTables; |
24 | |
import org.paneris.jammyjoes.model.JammyjoesTable; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
public class AffiliateTableBase extends JammyjoesTable { |
35 | |
|
36 | 0 | private Column col_id = null; |
37 | 0 | private Column col_company = null; |
38 | 0 | private Column col_payee = null; |
39 | 0 | private Column col_percentage = null; |
40 | 0 | private Column col_cookiedays = null; |
41 | 0 | private Column col_registration = null; |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
public AffiliateTableBase( |
54 | |
Database database, String name, |
55 | |
DefinitionSource definitionSource) throws PoemException { |
56 | 0 | super(database, name, definitionSource); |
57 | 0 | } |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
public JammyjoesDatabaseTables getJammyjoesDatabaseTables() { |
67 | 0 | return (JammyjoesDatabaseTables)getDatabase(); |
68 | |
} |
69 | |
|
70 | |
public void init() throws PoemException { |
71 | 0 | super.init(); |
72 | 0 | defineColumn(col_id = |
73 | |
new Column(this, "id", |
74 | |
new TroidPoemType(), |
75 | |
DefinitionSource.dsd) { |
76 | |
public Object getCooked(Persistent g) |
77 | |
throws AccessPoemException, PoemException { |
78 | 0 | return ((Affiliate)g).getId(); |
79 | |
} |
80 | |
|
81 | |
public void setCooked(Persistent g, Object cooked) |
82 | |
throws AccessPoemException, ValidationPoemException { |
83 | 0 | ((Affiliate)g).setId((Integer)cooked); |
84 | 0 | } |
85 | |
|
86 | |
public Field asField(Persistent g) { |
87 | 0 | return ((Affiliate)g).getIdField(); |
88 | |
} |
89 | |
|
90 | |
protected boolean defaultUserEditable() { |
91 | 0 | return false; |
92 | |
} |
93 | |
|
94 | |
protected boolean defaultUserCreateable() { |
95 | 0 | return false; |
96 | |
} |
97 | |
|
98 | |
protected DisplayLevel defaultDisplayLevel() { |
99 | 0 | return DisplayLevel.record; |
100 | |
} |
101 | |
|
102 | |
protected Searchability defaultSearchability() { |
103 | 0 | return Searchability.no; |
104 | |
} |
105 | |
|
106 | |
protected int defaultDisplayOrder() { |
107 | 0 | return 0; |
108 | |
} |
109 | |
|
110 | |
public Object getRaw_unsafe(Persistent g) |
111 | |
throws AccessPoemException { |
112 | 0 | return ((Affiliate)g).getId_unsafe(); |
113 | |
} |
114 | |
|
115 | |
public void setRaw_unsafe(Persistent g, Object raw) |
116 | |
throws AccessPoemException { |
117 | 0 | ((Affiliate)g).setId_unsafe((Integer)raw); |
118 | 0 | } |
119 | |
|
120 | |
public Object getRaw(Persistent g) |
121 | |
throws AccessPoemException { |
122 | 0 | return ((Affiliate)g).getId(); |
123 | |
} |
124 | |
|
125 | 0 | public void setRaw(Persistent g, Object raw) |
126 | |
throws AccessPoemException { |
127 | 0 | ((Affiliate)g).setId((Integer)raw); |
128 | 0 | } |
129 | |
}); |
130 | |
|
131 | 0 | defineColumn(col_company = |
132 | |
new Column(this, "company", |
133 | |
new StringPoemType(false, -1), |
134 | |
DefinitionSource.dsd) { |
135 | |
public Object getCooked(Persistent g) |
136 | |
throws AccessPoemException, PoemException { |
137 | 0 | return ((Affiliate)g).getCompany(); |
138 | |
} |
139 | |
|
140 | |
public void setCooked(Persistent g, Object cooked) |
141 | |
throws AccessPoemException, ValidationPoemException { |
142 | 0 | ((Affiliate)g).setCompany((String)cooked); |
143 | 0 | } |
144 | |
|
145 | |
public Field asField(Persistent g) { |
146 | 0 | return ((Affiliate)g).getCompanyField(); |
147 | |
} |
148 | |
|
149 | |
protected DisplayLevel defaultDisplayLevel() { |
150 | 0 | return DisplayLevel.primary; |
151 | |
} |
152 | |
|
153 | |
protected Searchability defaultSearchability() { |
154 | 0 | return Searchability.yes; |
155 | |
} |
156 | |
|
157 | |
protected String defaultDisplayName() { |
158 | 0 | return "Company"; |
159 | |
} |
160 | |
|
161 | |
protected int defaultDisplayOrder() { |
162 | 0 | return 1; |
163 | |
} |
164 | |
|
165 | |
protected String defaultDescription() { |
166 | 0 | return "The Affiliate's Company Name"; |
167 | |
} |
168 | |
|
169 | |
protected boolean defaultUnique() { |
170 | 0 | return true; |
171 | |
} |
172 | |
|
173 | |
protected int defaultWidth() { |
174 | 0 | return 40; |
175 | |
} |
176 | |
|
177 | |
public Object getRaw_unsafe(Persistent g) |
178 | |
throws AccessPoemException { |
179 | 0 | return ((Affiliate)g).getCompany_unsafe(); |
180 | |
} |
181 | |
|
182 | |
public void setRaw_unsafe(Persistent g, Object raw) |
183 | |
throws AccessPoemException { |
184 | 0 | ((Affiliate)g).setCompany_unsafe((String)raw); |
185 | 0 | } |
186 | |
|
187 | |
public Object getRaw(Persistent g) |
188 | |
throws AccessPoemException { |
189 | 0 | return ((Affiliate)g).getCompany(); |
190 | |
} |
191 | |
|
192 | 0 | public void setRaw(Persistent g, Object raw) |
193 | |
throws AccessPoemException { |
194 | 0 | ((Affiliate)g).setCompany((String)raw); |
195 | 0 | } |
196 | |
}); |
197 | |
|
198 | 0 | defineColumn(col_payee = |
199 | |
new Column(this, "payee", |
200 | |
new StringPoemType(false, -1), |
201 | |
DefinitionSource.dsd) { |
202 | |
public Object getCooked(Persistent g) |
203 | |
throws AccessPoemException, PoemException { |
204 | 0 | return ((Affiliate)g).getPayee(); |
205 | |
} |
206 | |
|
207 | |
public void setCooked(Persistent g, Object cooked) |
208 | |
throws AccessPoemException, ValidationPoemException { |
209 | 0 | ((Affiliate)g).setPayee((String)cooked); |
210 | 0 | } |
211 | |
|
212 | |
public Field asField(Persistent g) { |
213 | 0 | return ((Affiliate)g).getPayeeField(); |
214 | |
} |
215 | |
|
216 | |
protected Searchability defaultSearchability() { |
217 | 0 | return Searchability.yes; |
218 | |
} |
219 | |
|
220 | |
protected String defaultDisplayName() { |
221 | 0 | return "Payee"; |
222 | |
} |
223 | |
|
224 | |
protected int defaultDisplayOrder() { |
225 | 0 | return 2; |
226 | |
} |
227 | |
|
228 | |
protected String defaultDescription() { |
229 | 0 | return "The Payee (for cheques)"; |
230 | |
} |
231 | |
|
232 | |
protected int defaultWidth() { |
233 | 0 | return 40; |
234 | |
} |
235 | |
|
236 | |
public Object getRaw_unsafe(Persistent g) |
237 | |
throws AccessPoemException { |
238 | 0 | return ((Affiliate)g).getPayee_unsafe(); |
239 | |
} |
240 | |
|
241 | |
public void setRaw_unsafe(Persistent g, Object raw) |
242 | |
throws AccessPoemException { |
243 | 0 | ((Affiliate)g).setPayee_unsafe((String)raw); |
244 | 0 | } |
245 | |
|
246 | |
public Object getRaw(Persistent g) |
247 | |
throws AccessPoemException { |
248 | 0 | return ((Affiliate)g).getPayee(); |
249 | |
} |
250 | |
|
251 | 0 | public void setRaw(Persistent g, Object raw) |
252 | |
throws AccessPoemException { |
253 | 0 | ((Affiliate)g).setPayee((String)raw); |
254 | 0 | } |
255 | |
}); |
256 | |
|
257 | 0 | defineColumn(col_percentage = |
258 | |
new Column(this, "percentage", |
259 | |
new DoublePoemType(false), |
260 | |
DefinitionSource.dsd) { |
261 | |
public Object getCooked(Persistent g) |
262 | |
throws AccessPoemException, PoemException { |
263 | 0 | return ((Affiliate)g).getPercentage(); |
264 | |
} |
265 | |
|
266 | |
public void setCooked(Persistent g, Object cooked) |
267 | |
throws AccessPoemException, ValidationPoemException { |
268 | 0 | ((Affiliate)g).setPercentage((Double)cooked); |
269 | 0 | } |
270 | |
|
271 | |
public Field asField(Persistent g) { |
272 | 0 | return ((Affiliate)g).getPercentageField(); |
273 | |
} |
274 | |
|
275 | |
protected DisplayLevel defaultDisplayLevel() { |
276 | 0 | return DisplayLevel.record; |
277 | |
} |
278 | |
|
279 | |
protected Searchability defaultSearchability() { |
280 | 0 | return Searchability.no; |
281 | |
} |
282 | |
|
283 | |
protected String defaultDisplayName() { |
284 | 0 | return "Percentage"; |
285 | |
} |
286 | |
|
287 | |
protected int defaultDisplayOrder() { |
288 | 0 | return 3; |
289 | |
} |
290 | |
|
291 | |
protected String defaultDescription() { |
292 | 0 | return "The percentage of sales for this Affiliate"; |
293 | |
} |
294 | |
|
295 | |
public Object getRaw_unsafe(Persistent g) |
296 | |
throws AccessPoemException { |
297 | 0 | return ((Affiliate)g).getPercentage_unsafe(); |
298 | |
} |
299 | |
|
300 | |
public void setRaw_unsafe(Persistent g, Object raw) |
301 | |
throws AccessPoemException { |
302 | 0 | ((Affiliate)g).setPercentage_unsafe((Double)raw); |
303 | 0 | } |
304 | |
|
305 | |
public Object getRaw(Persistent g) |
306 | |
throws AccessPoemException { |
307 | 0 | return ((Affiliate)g).getPercentage(); |
308 | |
} |
309 | |
|
310 | 0 | public void setRaw(Persistent g, Object raw) |
311 | |
throws AccessPoemException { |
312 | 0 | ((Affiliate)g).setPercentage((Double)raw); |
313 | 0 | } |
314 | |
}); |
315 | |
|
316 | 0 | defineColumn(col_cookiedays = |
317 | |
new Column(this, "cookiedays", |
318 | |
new IntegerPoemType(false), |
319 | |
DefinitionSource.dsd) { |
320 | |
public Object getCooked(Persistent g) |
321 | |
throws AccessPoemException, PoemException { |
322 | 0 | return ((Affiliate)g).getCookiedays(); |
323 | |
} |
324 | |
|
325 | |
public void setCooked(Persistent g, Object cooked) |
326 | |
throws AccessPoemException, ValidationPoemException { |
327 | 0 | ((Affiliate)g).setCookiedays((Integer)cooked); |
328 | 0 | } |
329 | |
|
330 | |
public Field asField(Persistent g) { |
331 | 0 | return ((Affiliate)g).getCookiedaysField(); |
332 | |
} |
333 | |
|
334 | |
protected DisplayLevel defaultDisplayLevel() { |
335 | 0 | return DisplayLevel.record; |
336 | |
} |
337 | |
|
338 | |
protected Searchability defaultSearchability() { |
339 | 0 | return Searchability.no; |
340 | |
} |
341 | |
|
342 | |
protected String defaultDisplayName() { |
343 | 0 | return "Cookie Days"; |
344 | |
} |
345 | |
|
346 | |
protected int defaultDisplayOrder() { |
347 | 0 | return 4; |
348 | |
} |
349 | |
|
350 | |
protected String defaultDescription() { |
351 | 0 | return "The number of days to set a cookie for for this Affiliate"; |
352 | |
} |
353 | |
|
354 | |
public Object getRaw_unsafe(Persistent g) |
355 | |
throws AccessPoemException { |
356 | 0 | return ((Affiliate)g).getCookiedays_unsafe(); |
357 | |
} |
358 | |
|
359 | |
public void setRaw_unsafe(Persistent g, Object raw) |
360 | |
throws AccessPoemException { |
361 | 0 | ((Affiliate)g).setCookiedays_unsafe((Integer)raw); |
362 | 0 | } |
363 | |
|
364 | |
public Object getRaw(Persistent g) |
365 | |
throws AccessPoemException { |
366 | 0 | return ((Affiliate)g).getCookiedays(); |
367 | |
} |
368 | |
|
369 | 0 | public void setRaw(Persistent g, Object raw) |
370 | |
throws AccessPoemException { |
371 | 0 | ((Affiliate)g).setCookiedays((Integer)raw); |
372 | 0 | } |
373 | |
}); |
374 | |
|
375 | 0 | defineColumn(col_registration = |
376 | |
new Column(this, "registration", |
377 | |
new TimestampPoemType(false), |
378 | |
DefinitionSource.dsd) { |
379 | |
public Object getCooked(Persistent g) |
380 | |
throws AccessPoemException, PoemException { |
381 | 0 | return ((Affiliate)g).getRegistration(); |
382 | |
} |
383 | |
|
384 | |
public void setCooked(Persistent g, Object cooked) |
385 | |
throws AccessPoemException, ValidationPoemException { |
386 | 0 | ((Affiliate)g).setRegistration((Timestamp)cooked); |
387 | 0 | } |
388 | |
|
389 | |
public Field asField(Persistent g) { |
390 | 0 | return ((Affiliate)g).getRegistrationField(); |
391 | |
} |
392 | |
|
393 | |
protected DisplayLevel defaultDisplayLevel() { |
394 | 0 | return DisplayLevel.record; |
395 | |
} |
396 | |
|
397 | |
protected String defaultDisplayName() { |
398 | 0 | return "Date of Registration"; |
399 | |
} |
400 | |
|
401 | |
protected int defaultDisplayOrder() { |
402 | 0 | return 5; |
403 | |
} |
404 | |
|
405 | |
protected String defaultDescription() { |
406 | 0 | return "The date when this Affiliate Registered"; |
407 | |
} |
408 | |
|
409 | |
public Object getRaw_unsafe(Persistent g) |
410 | |
throws AccessPoemException { |
411 | 0 | return ((Affiliate)g).getRegistration_unsafe(); |
412 | |
} |
413 | |
|
414 | |
public void setRaw_unsafe(Persistent g, Object raw) |
415 | |
throws AccessPoemException { |
416 | 0 | ((Affiliate)g).setRegistration_unsafe((Timestamp)raw); |
417 | 0 | } |
418 | |
|
419 | |
public Object getRaw(Persistent g) |
420 | |
throws AccessPoemException { |
421 | 0 | return ((Affiliate)g).getRegistration(); |
422 | |
} |
423 | |
|
424 | 0 | public void setRaw(Persistent g, Object raw) |
425 | |
throws AccessPoemException { |
426 | 0 | ((Affiliate)g).setRegistration((Timestamp)raw); |
427 | 0 | } |
428 | |
}); |
429 | 0 | } |
430 | |
|
431 | |
|
432 | |
|
433 | |
|
434 | |
|
435 | |
|
436 | |
|
437 | |
|
438 | |
|
439 | |
public final Column getIdColumn() { |
440 | 0 | return col_id; |
441 | |
} |
442 | |
|
443 | |
|
444 | |
|
445 | |
|
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
|
451 | |
public final Column getCompanyColumn() { |
452 | 0 | return col_company; |
453 | |
} |
454 | |
|
455 | |
|
456 | |
|
457 | |
|
458 | |
|
459 | |
|
460 | |
|
461 | |
|
462 | |
|
463 | |
public final Column getPayeeColumn() { |
464 | 0 | return col_payee; |
465 | |
} |
466 | |
|
467 | |
|
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
|
474 | |
|
475 | |
public final Column getPercentageColumn() { |
476 | 0 | return col_percentage; |
477 | |
} |
478 | |
|
479 | |
|
480 | |
|
481 | |
|
482 | |
|
483 | |
|
484 | |
|
485 | |
|
486 | |
|
487 | |
public final Column getCookiedaysColumn() { |
488 | 0 | return col_cookiedays; |
489 | |
} |
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
|
497 | |
|
498 | |
|
499 | |
public final Column getRegistrationColumn() { |
500 | 0 | return col_registration; |
501 | |
} |
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
|
507 | |
|
508 | |
|
509 | |
|
510 | |
|
511 | |
public Affiliate getAffiliateObject(Integer troid) { |
512 | 0 | return (Affiliate)getObject(troid); |
513 | |
} |
514 | |
|
515 | |
|
516 | |
|
517 | |
|
518 | |
|
519 | |
|
520 | |
|
521 | |
|
522 | |
|
523 | |
public Affiliate getAffiliateObject(int troid) { |
524 | 0 | return (Affiliate)getObject(troid); |
525 | |
} |
526 | |
|
527 | |
protected JdbcPersistent _newPersistent() { |
528 | 0 | return new Affiliate(); |
529 | |
} |
530 | |
protected String defaultDisplayName() { |
531 | 0 | return "Affiliate"; |
532 | |
} |
533 | |
|
534 | |
protected String defaultDescription() { |
535 | 0 | return "A JammyJoes Affiliate"; |
536 | |
} |
537 | |
|
538 | |
protected boolean defaultRememberAllTroids() { |
539 | 0 | return true; |
540 | |
} |
541 | |
|
542 | |
protected String defaultCategory() { |
543 | 0 | return "Data"; |
544 | |
} |
545 | |
|
546 | |
protected int defaultDisplayOrder() { |
547 | 0 | return 80; |
548 | |
} |
549 | |
} |
550 | |
|