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.Field;
12 import org.melati.poem.JdbcPersistent;
13 import org.melati.poem.Persistent;
14 import org.melati.poem.PoemException;
15 import org.melati.poem.ReferencePoemType;
16 import org.melati.poem.Searchability;
17 import org.melati.poem.StringPoemType;
18 import org.melati.poem.TimestampPoemType;
19 import org.melati.poem.TroidPoemType;
20 import org.melati.poem.ValidationPoemException;
21 import org.paneris.jammyjoes.model.Affiliate;
22 import org.paneris.jammyjoes.model.AffiliateTransaction;
23 import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
24 import org.paneris.jammyjoes.model.JammyjoesTable;
25
26
27 /**
28 * Melati POEM generated base class for
29 <code>Table</code> <code>AffiliateTransaction</code>.
30 *
31 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
32 */
33
34 public class AffiliateTransactionTableBase extends JammyjoesTable {
35
36 private Column col_id = null;
37 private Column col_affiliate = null;
38 private Column col_hit = null;
39 private Column col_referrerURL = null;
40 private Column col_landingPage = null;
41 private Column col_userIpAddress = null;
42
43 /**
44 * Constructor.
45 *
46 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
47 * @param database the POEM database we are using
48 * @param name the name of this <code>Table</code>
49 * @param definitionSource which definition is being used
50 * @throws PoemException if anything goes wrong
51 */
52
53 public AffiliateTransactionTableBase(
54 Database database, String name,
55 DefinitionSource definitionSource) throws PoemException {
56 super(database, name, definitionSource);
57 }
58
59
60 /**
61 * Get the database tables.
62 *
63 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
64 * @return the database tables
65 */
66 public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
67 return (JammyjoesDatabaseTables)getDatabase();
68 }
69
70 public void init() throws PoemException {
71 super.init();
72 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 return ((AffiliateTransaction)g).getId();
79 }
80
81 public void setCooked(Persistent g, Object cooked)
82 throws AccessPoemException, ValidationPoemException {
83 ((AffiliateTransaction)g).setId((Integer)cooked);
84 }
85
86 public Field asField(Persistent g) {
87 return ((AffiliateTransaction)g).getIdField();
88 }
89
90 protected boolean defaultUserEditable() {
91 return false;
92 }
93
94 protected boolean defaultUserCreateable() {
95 return false;
96 }
97
98 protected DisplayLevel defaultDisplayLevel() {
99 return DisplayLevel.record;
100 }
101
102 protected Searchability defaultSearchability() {
103 return Searchability.no;
104 }
105
106 protected Integer defaultDisplayOrderPriority() {
107 return new Integer(0);
108 }
109
110 protected boolean defaultSortDescending() {
111 return true;
112 }
113
114 protected int defaultDisplayOrder() {
115 return 0;
116 }
117
118 public Object getRaw_unsafe(Persistent g)
119 throws AccessPoemException {
120 return ((AffiliateTransaction)g).getId_unsafe();
121 }
122
123 public void setRaw_unsafe(Persistent g, Object raw)
124 throws AccessPoemException {
125 ((AffiliateTransaction)g).setId_unsafe((Integer)raw);
126 }
127
128 public Object getRaw(Persistent g)
129 throws AccessPoemException {
130 return ((AffiliateTransaction)g).getId();
131 }
132
133 public void setRaw(Persistent g, Object raw)
134 throws AccessPoemException {
135 ((AffiliateTransaction)g).setId((Integer)raw);
136 }
137 });
138
139 defineColumn(col_affiliate =
140 new Column(this, "affiliate",
141 new ReferencePoemType(getJammyjoesDatabaseTables().
142 getAffiliateTable(), false),
143 DefinitionSource.dsd) {
144 public Object getCooked(Persistent g)
145 throws AccessPoemException, PoemException {
146 return ((AffiliateTransaction)g).getAffiliate();
147 }
148
149 public void setCooked(Persistent g, Object cooked)
150 throws AccessPoemException, ValidationPoemException {
151 ((AffiliateTransaction)g).setAffiliate((Affiliate)cooked);
152 }
153
154 public Field asField(Persistent g) {
155 return ((AffiliateTransaction)g).getAffiliateField();
156 }
157
158 protected DisplayLevel defaultDisplayLevel() {
159 return DisplayLevel.record;
160 }
161
162 protected int defaultDisplayOrder() {
163 return 1;
164 }
165
166 protected String defaultDescription() {
167 return "The Affiliate that generated this hit";
168 }
169
170 public Object getRaw_unsafe(Persistent g)
171 throws AccessPoemException {
172 return ((AffiliateTransaction)g).getAffiliate_unsafe();
173 }
174
175 public void setRaw_unsafe(Persistent g, Object raw)
176 throws AccessPoemException {
177 ((AffiliateTransaction)g).setAffiliate_unsafe((Integer)raw);
178 }
179
180 public Object getRaw(Persistent g)
181 throws AccessPoemException {
182 return ((AffiliateTransaction)g).getAffiliateTroid();
183 }
184
185 public void setRaw(Persistent g, Object raw)
186 throws AccessPoemException {
187 ((AffiliateTransaction)g).setAffiliateTroid((Integer)raw);
188 }
189 });
190
191 defineColumn(col_hit =
192 new Column(this, "hit",
193 new TimestampPoemType(false),
194 DefinitionSource.dsd) {
195 public Object getCooked(Persistent g)
196 throws AccessPoemException, PoemException {
197 return ((AffiliateTransaction)g).getHit();
198 }
199
200 public void setCooked(Persistent g, Object cooked)
201 throws AccessPoemException, ValidationPoemException {
202 ((AffiliateTransaction)g).setHit((Timestamp)cooked);
203 }
204
205 public Field asField(Persistent g) {
206 return ((AffiliateTransaction)g).getHitField();
207 }
208
209 protected DisplayLevel defaultDisplayLevel() {
210 return DisplayLevel.primary;
211 }
212
213 protected String defaultDisplayName() {
214 return "Date of hit";
215 }
216
217 protected int defaultDisplayOrder() {
218 return 2;
219 }
220
221 protected String defaultDescription() {
222 return "The date when this hit came in";
223 }
224
225 public Object getRaw_unsafe(Persistent g)
226 throws AccessPoemException {
227 return ((AffiliateTransaction)g).getHit_unsafe();
228 }
229
230 public void setRaw_unsafe(Persistent g, Object raw)
231 throws AccessPoemException {
232 ((AffiliateTransaction)g).setHit_unsafe((Timestamp)raw);
233 }
234
235 public Object getRaw(Persistent g)
236 throws AccessPoemException {
237 return ((AffiliateTransaction)g).getHit();
238 }
239
240 public void setRaw(Persistent g, Object raw)
241 throws AccessPoemException {
242 ((AffiliateTransaction)g).setHit((Timestamp)raw);
243 }
244 });
245
246 defineColumn(col_referrerURL =
247 new Column(this, "referrerURL",
248 new StringPoemType(true, -1),
249 DefinitionSource.dsd) {
250 public Object getCooked(Persistent g)
251 throws AccessPoemException, PoemException {
252 return ((AffiliateTransaction)g).getReferrerURL();
253 }
254
255 public void setCooked(Persistent g, Object cooked)
256 throws AccessPoemException, ValidationPoemException {
257 ((AffiliateTransaction)g).setReferrerURL((String)cooked);
258 }
259
260 public Field asField(Persistent g) {
261 return ((AffiliateTransaction)g).getReferrerURLField();
262 }
263
264 protected Searchability defaultSearchability() {
265 return Searchability.yes;
266 }
267
268 protected String defaultDisplayName() {
269 return "URL";
270 }
271
272 protected int defaultDisplayOrder() {
273 return 3;
274 }
275
276 protected String defaultDescription() {
277 return "The Referring URL";
278 }
279
280 protected int defaultWidth() {
281 return 40;
282 }
283
284 public Object getRaw_unsafe(Persistent g)
285 throws AccessPoemException {
286 return ((AffiliateTransaction)g).getReferrerURL_unsafe();
287 }
288
289 public void setRaw_unsafe(Persistent g, Object raw)
290 throws AccessPoemException {
291 ((AffiliateTransaction)g).setReferrerURL_unsafe((String)raw);
292 }
293
294 public Object getRaw(Persistent g)
295 throws AccessPoemException {
296 return ((AffiliateTransaction)g).getReferrerURL();
297 }
298
299 public void setRaw(Persistent g, Object raw)
300 throws AccessPoemException {
301 ((AffiliateTransaction)g).setReferrerURL((String)raw);
302 }
303 });
304
305 defineColumn(col_landingPage =
306 new Column(this, "landingPage",
307 new StringPoemType(false, -1),
308 DefinitionSource.dsd) {
309 public Object getCooked(Persistent g)
310 throws AccessPoemException, PoemException {
311 return ((AffiliateTransaction)g).getLandingPage();
312 }
313
314 public void setCooked(Persistent g, Object cooked)
315 throws AccessPoemException, ValidationPoemException {
316 ((AffiliateTransaction)g).setLandingPage((String)cooked);
317 }
318
319 public Field asField(Persistent g) {
320 return ((AffiliateTransaction)g).getLandingPageField();
321 }
322
323 protected Searchability defaultSearchability() {
324 return Searchability.yes;
325 }
326
327 protected String defaultDisplayName() {
328 return "URL";
329 }
330
331 protected int defaultDisplayOrder() {
332 return 4;
333 }
334
335 protected String defaultDescription() {
336 return "The Landing Page";
337 }
338
339 protected int defaultWidth() {
340 return 40;
341 }
342
343 public Object getRaw_unsafe(Persistent g)
344 throws AccessPoemException {
345 return ((AffiliateTransaction)g).getLandingPage_unsafe();
346 }
347
348 public void setRaw_unsafe(Persistent g, Object raw)
349 throws AccessPoemException {
350 ((AffiliateTransaction)g).setLandingPage_unsafe((String)raw);
351 }
352
353 public Object getRaw(Persistent g)
354 throws AccessPoemException {
355 return ((AffiliateTransaction)g).getLandingPage();
356 }
357
358 public void setRaw(Persistent g, Object raw)
359 throws AccessPoemException {
360 ((AffiliateTransaction)g).setLandingPage((String)raw);
361 }
362 });
363
364 defineColumn(col_userIpAddress =
365 new Column(this, "userIpAddress",
366 new StringPoemType(false, -1),
367 DefinitionSource.dsd) {
368 public Object getCooked(Persistent g)
369 throws AccessPoemException, PoemException {
370 return ((AffiliateTransaction)g).getUserIpAddress();
371 }
372
373 public void setCooked(Persistent g, Object cooked)
374 throws AccessPoemException, ValidationPoemException {
375 ((AffiliateTransaction)g).setUserIpAddress((String)cooked);
376 }
377
378 public Field asField(Persistent g) {
379 return ((AffiliateTransaction)g).getUserIpAddressField();
380 }
381
382 protected Searchability defaultSearchability() {
383 return Searchability.yes;
384 }
385
386 protected String defaultDisplayName() {
387 return "IP Address";
388 }
389
390 protected int defaultDisplayOrder() {
391 return 5;
392 }
393
394 protected String defaultDescription() {
395 return "The User's IP Address";
396 }
397
398 protected int defaultWidth() {
399 return 40;
400 }
401
402 public Object getRaw_unsafe(Persistent g)
403 throws AccessPoemException {
404 return ((AffiliateTransaction)g).getUserIpAddress_unsafe();
405 }
406
407 public void setRaw_unsafe(Persistent g, Object raw)
408 throws AccessPoemException {
409 ((AffiliateTransaction)g).setUserIpAddress_unsafe((String)raw);
410 }
411
412 public Object getRaw(Persistent g)
413 throws AccessPoemException {
414 return ((AffiliateTransaction)g).getUserIpAddress();
415 }
416
417 public void setRaw(Persistent g, Object raw)
418 throws AccessPoemException {
419 ((AffiliateTransaction)g).setUserIpAddress((String)raw);
420 }
421 });
422 }
423
424
425 /**
426 * Retrieves the <code>Id</code> <code>Column</code> for this
427 * <code>AffiliateTransaction</code> <code>Table</code>.
428 *
429 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
430 * @return the id <code>Column</code>
431 */
432 public final Column getIdColumn() {
433 return col_id;
434 }
435
436
437 /**
438 * Retrieves the <code>Affiliate</code> <code>Column</code> for this
439 * <code>AffiliateTransaction</code> <code>Table</code>.
440 *
441 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
442 * @return the affiliate <code>Column</code>
443 */
444 public final Column getAffiliateColumn() {
445 return col_affiliate;
446 }
447
448
449 /**
450 * Retrieves the <code>Hit</code> <code>Column</code> for this
451 * <code>AffiliateTransaction</code> <code>Table</code>.
452 *
453 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
454 * @return the hit <code>Column</code>
455 */
456 public final Column getHitColumn() {
457 return col_hit;
458 }
459
460
461 /**
462 * Retrieves the <code>ReferrerURL</code> <code>Column</code> for this
463 * <code>AffiliateTransaction</code> <code>Table</code>.
464 *
465 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
466 * @return the referrerURL <code>Column</code>
467 */
468 public final Column getReferrerURLColumn() {
469 return col_referrerURL;
470 }
471
472
473 /**
474 * Retrieves the <code>LandingPage</code> <code>Column</code> for this
475 * <code>AffiliateTransaction</code> <code>Table</code>.
476 *
477 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
478 * @return the landingPage <code>Column</code>
479 */
480 public final Column getLandingPageColumn() {
481 return col_landingPage;
482 }
483
484
485 /**
486 * Retrieves the <code>UserIpAddress</code> <code>Column</code> for this
487 * <code>AffiliateTransaction</code> <code>Table</code>.
488 *
489 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
490 * @return the userIpAddress <code>Column</code>
491 */
492 public final Column getUserIpAddressColumn() {
493 return col_userIpAddress;
494 }
495
496
497 /**
498 * Retrieve the <code>AffiliateTransaction</code> as a <code>AffiliateTransaction</code>.
499 *
500 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
501 * @param troid a Table Row Oject ID
502 * @return the <code>Persistent</code> identified by the <code>troid</code>
503 */
504 public AffiliateTransaction getAffiliateTransactionObject(Integer troid) {
505 return (AffiliateTransaction)getObject(troid);
506 }
507
508
509 /**
510 * Retrieve the <code>AffiliateTransaction</code>
511 * as a <code>AffiliateTransaction</code>.
512 *
513 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
514 * @param troid a Table Row Object ID
515 * @return the <code>Persistent</code> identified */
516 public AffiliateTransaction getAffiliateTransactionObject(int troid) {
517 return (AffiliateTransaction)getObject(troid);
518 }
519
520 protected JdbcPersistent _newPersistent() {
521 return new AffiliateTransaction();
522 }
523 protected String defaultDisplayName() {
524 return "AffiliateTransaction";
525 }
526
527 protected String defaultDescription() {
528 return "A 'hit' for this affiliate";
529 }
530
531 protected boolean defaultRememberAllTroids() {
532 return true;
533 }
534
535 protected String defaultCategory() {
536 return "Data";
537 }
538
539 protected int defaultDisplayOrder() {
540 return 80;
541 }
542 }
543