Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CampaignBase |
|
| 1.0731707317073171;1.073 |
1 | // Do not edit this file! It was generated by Melati POEM's DSD preprocessor. | |
2 | ||
3 | package org.paneris.bibliomania.generated; | |
4 | ||
5 | ||
6 | import java.sql.Timestamp; | |
7 | import java.util.Collections; | |
8 | import java.util.Enumeration; | |
9 | import java.util.List; | |
10 | import org.melati.poem.AccessPoemException; | |
11 | import org.melati.poem.CachedSelection; | |
12 | import org.melati.poem.Column; | |
13 | import org.melati.poem.Field; | |
14 | import org.melati.poem.JdbcPersistent; | |
15 | import org.melati.poem.ValidationPoemException; | |
16 | import org.melati.poem.util.EmptyEnumeration; | |
17 | import org.paneris.bibliomania.BibliomaniaDatabaseTables; | |
18 | import org.paneris.bibliomania.Campaign; | |
19 | import org.paneris.bibliomania.CampaignTable; | |
20 | import org.paneris.bibliomania.CampaignUser; | |
21 | ||
22 | ||
23 | /** | |
24 | * Melati POEM generated abstract base class for a <code>Persistent</code> | |
25 | * <code>Campaign</code> Object. | |
26 | * | |
27 | * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava | |
28 | */ | |
29 | 0 | public abstract class CampaignBase extends JdbcPersistent { |
30 | ||
31 | ||
32 | /** | |
33 | * Retrieves the Database object. | |
34 | * | |
35 | * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava | |
36 | * @return the database | |
37 | */ | |
38 | public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { | |
39 | 0 | return (BibliomaniaDatabaseTables)getDatabase(); |
40 | } | |
41 | ||
42 | ||
43 | /** | |
44 | * Retrieves the <code>CampaignTable</code> table | |
45 | * which this <code>Persistent</code> is from. | |
46 | * | |
47 | * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava | |
48 | * @return the CampaignTable | |
49 | */ | |
50 | @SuppressWarnings("unchecked") | |
51 | public CampaignTable<Campaign> getCampaignTable() { | |
52 | 0 | return (CampaignTable<Campaign>)getTable(); |
53 | } | |
54 | ||
55 | @SuppressWarnings("unchecked") | |
56 | private CampaignTable<Campaign> _getCampaignTable() { | |
57 | 0 | return (CampaignTable<Campaign>)getTable(); |
58 | } | |
59 | ||
60 | // Fields in this table | |
61 | /** | |
62 | * id | |
63 | */ | |
64 | protected Integer id; | |
65 | /** | |
66 | * Display name - The Campaign's name | |
67 | */ | |
68 | protected String displayname; | |
69 | /** | |
70 | * Date Created - When this Campaign was created | |
71 | */ | |
72 | protected Timestamp created; | |
73 | /** | |
74 | * Date Last Run - When the users in this his Campaign were last emailed | |
75 | */ | |
76 | protected Timestamp lastrun; | |
77 | /** | |
78 | * Output - The file containing the output from the last run | |
79 | */ | |
80 | protected String output; | |
81 | /** | |
82 | * comment - Any comments on this Campaign | |
83 | */ | |
84 | protected String comment; | |
85 | /** | |
86 | * template - A template for the email to be sent | |
87 | */ | |
88 | protected String template; | |
89 | ||
90 | ||
91 | /** | |
92 | * Retrieves the <code>Id</code> value, without locking, | |
93 | * for this <code>Campaign</code> <code>Persistent</code>. | |
94 | * | |
95 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
96 | * @return the Integer id | |
97 | */ | |
98 | public Integer getId_unsafe() { | |
99 | 0 | return id; |
100 | } | |
101 | ||
102 | ||
103 | /** | |
104 | * Sets the <code>Id</code> value directly, without checking, | |
105 | * for this Campaign <code>Persistent</code>. | |
106 | * | |
107 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
108 | * @param cooked the pre-validated value to set | |
109 | */ | |
110 | public void setId_unsafe(Integer cooked) { | |
111 | 0 | id = cooked; |
112 | 0 | } |
113 | ||
114 | /** | |
115 | * Retrieves the Id value, with locking, for this | |
116 | * <code>Campaign</code> <code>Persistent</code>. | |
117 | * | |
118 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
119 | * @throws AccessPoemException | |
120 | * if the current <code>AccessToken</code> | |
121 | * does not confer write access rights | |
122 | * @return the value of the field <code>Id</code> for this | |
123 | * <code>Campaign</code> <code>Persistent</code> | |
124 | */ | |
125 | ||
126 | public Integer getId() | |
127 | throws AccessPoemException { | |
128 | 0 | readLock(); |
129 | 0 | return getId_unsafe(); |
130 | } | |
131 | ||
132 | ||
133 | /** | |
134 | * Sets the <code>Id</code> value, with checking, for this | |
135 | * <code>Campaign</code> <code>Persistent</code>. | |
136 | * | |
137 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
138 | * @param cooked a validated <code>int</code> | |
139 | * @throws AccessPoemException | |
140 | * if the current <code>AccessToken</code> | |
141 | * does not confer write access rights | |
142 | * @throws ValidationPoemException | |
143 | * if the value is not valid | |
144 | */ | |
145 | public void setId(Integer cooked) | |
146 | throws AccessPoemException, ValidationPoemException { | |
147 | 0 | _getCampaignTable().getIdColumn(). |
148 | getType().assertValidCooked(cooked); | |
149 | 0 | writeLock(); |
150 | 0 | setId_unsafe(cooked); |
151 | 0 | } |
152 | ||
153 | /** | |
154 | * Sets the <code>Id</code> value, with checking, for this | |
155 | * <code>Campaign</code> <code>Persistent</code>. | |
156 | * | |
157 | * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods | |
158 | * @param cooked a validated <code>int</code> | |
159 | * @throws AccessPoemException | |
160 | * if the current <code>AccessToken</code> | |
161 | * does not confer write access rights | |
162 | * @throws ValidationPoemException | |
163 | * if the value is not valid | |
164 | */ | |
165 | ||
166 | public final void setId(int cooked) | |
167 | throws AccessPoemException, ValidationPoemException { | |
168 | 0 | setId(new Integer(cooked)); |
169 | 0 | } |
170 | ||
171 | ||
172 | /** | |
173 | * Retrieves the <code>Id</code> value as a <code>Field</code> | |
174 | * from this <code>Campaign</code> <code>Persistent</code>. | |
175 | * | |
176 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
177 | * @throws AccessPoemException | |
178 | * if the current <code>AccessToken</code> | |
179 | * does not confer write access rights | |
180 | * @return the Integer id | |
181 | */ | |
182 | public Field<Integer> getIdField() throws AccessPoemException { | |
183 | 0 | Column<Integer> c = _getCampaignTable().getIdColumn(); |
184 | 0 | return new Field<Integer>((Integer)c.getRaw(this), c); |
185 | } | |
186 | ||
187 | ||
188 | /** | |
189 | * Retrieves the <code>Displayname</code> value, without locking, | |
190 | * for this <code>Campaign</code> <code>Persistent</code>. | |
191 | * | |
192 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
193 | * @return the String displayname | |
194 | */ | |
195 | public String getDisplayname_unsafe() { | |
196 | 0 | return displayname; |
197 | } | |
198 | ||
199 | ||
200 | /** | |
201 | * Sets the <code>Displayname</code> value directly, without checking, | |
202 | * for this Campaign <code>Persistent</code>. | |
203 | * | |
204 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
205 | * @param cooked the pre-validated value to set | |
206 | */ | |
207 | public void setDisplayname_unsafe(String cooked) { | |
208 | 0 | displayname = cooked; |
209 | 0 | } |
210 | ||
211 | /** | |
212 | * Retrieves the Displayname value, with locking, for this | |
213 | * <code>Campaign</code> <code>Persistent</code>. | |
214 | * Field description: | |
215 | * The Campaign's name | |
216 | * | |
217 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
218 | * @throws AccessPoemException | |
219 | * if the current <code>AccessToken</code> | |
220 | * does not confer write access rights | |
221 | * @return the value of the field <code>Displayname</code> for this | |
222 | * <code>Campaign</code> <code>Persistent</code> | |
223 | */ | |
224 | ||
225 | public String getDisplayname() | |
226 | throws AccessPoemException { | |
227 | 0 | readLock(); |
228 | 0 | return getDisplayname_unsafe(); |
229 | } | |
230 | ||
231 | ||
232 | /** | |
233 | * Sets the <code>Displayname</code> value, with checking, for this | |
234 | * <code>Campaign</code> <code>Persistent</code>. | |
235 | * Field description: | |
236 | * The Campaign's name | |
237 | * | |
238 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
239 | * @param cooked a validated <code>int</code> | |
240 | * @throws AccessPoemException | |
241 | * if the current <code>AccessToken</code> | |
242 | * does not confer write access rights | |
243 | * @throws ValidationPoemException | |
244 | * if the value is not valid | |
245 | */ | |
246 | public void setDisplayname(String cooked) | |
247 | throws AccessPoemException, ValidationPoemException { | |
248 | 0 | _getCampaignTable().getDisplaynameColumn(). |
249 | getType().assertValidCooked(cooked); | |
250 | 0 | writeLock(); |
251 | 0 | setDisplayname_unsafe(cooked); |
252 | 0 | } |
253 | ||
254 | ||
255 | /** | |
256 | * Retrieves the <code>Displayname</code> value as a <code>Field</code> | |
257 | * from this <code>Campaign</code> <code>Persistent</code>. | |
258 | * | |
259 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
260 | * @throws AccessPoemException | |
261 | * if the current <code>AccessToken</code> | |
262 | * does not confer write access rights | |
263 | * @return the String displayname | |
264 | */ | |
265 | public Field<String> getDisplaynameField() throws AccessPoemException { | |
266 | 0 | Column<String> c = _getCampaignTable().getDisplaynameColumn(); |
267 | 0 | return new Field<String>((String)c.getRaw(this), c); |
268 | } | |
269 | ||
270 | ||
271 | /** | |
272 | * Retrieves the <code>Created</code> value, without locking, | |
273 | * for this <code>Campaign</code> <code>Persistent</code>. | |
274 | * | |
275 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
276 | * @return the Timestamp created | |
277 | */ | |
278 | public Timestamp getCreated_unsafe() { | |
279 | 0 | return created; |
280 | } | |
281 | ||
282 | ||
283 | /** | |
284 | * Sets the <code>Created</code> value directly, without checking, | |
285 | * for this Campaign <code>Persistent</code>. | |
286 | * | |
287 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
288 | * @param cooked the pre-validated value to set | |
289 | */ | |
290 | public void setCreated_unsafe(Timestamp cooked) { | |
291 | 0 | created = cooked; |
292 | 0 | } |
293 | ||
294 | /** | |
295 | * Retrieves the Created value, with locking, for this | |
296 | * <code>Campaign</code> <code>Persistent</code>. | |
297 | * Field description: | |
298 | * When this Campaign was created | |
299 | * | |
300 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
301 | * @throws AccessPoemException | |
302 | * if the current <code>AccessToken</code> | |
303 | * does not confer write access rights | |
304 | * @return the value of the field <code>Created</code> for this | |
305 | * <code>Campaign</code> <code>Persistent</code> | |
306 | */ | |
307 | ||
308 | public Timestamp getCreated() | |
309 | throws AccessPoemException { | |
310 | 0 | readLock(); |
311 | 0 | return getCreated_unsafe(); |
312 | } | |
313 | ||
314 | ||
315 | /** | |
316 | * Sets the <code>Created</code> value, with checking, for this | |
317 | * <code>Campaign</code> <code>Persistent</code>. | |
318 | * Field description: | |
319 | * When this Campaign was created | |
320 | * | |
321 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
322 | * @param cooked a validated <code>int</code> | |
323 | * @throws AccessPoemException | |
324 | * if the current <code>AccessToken</code> | |
325 | * does not confer write access rights | |
326 | * @throws ValidationPoemException | |
327 | * if the value is not valid | |
328 | */ | |
329 | public void setCreated(Timestamp cooked) | |
330 | throws AccessPoemException, ValidationPoemException { | |
331 | 0 | _getCampaignTable().getCreatedColumn(). |
332 | getType().assertValidCooked(cooked); | |
333 | 0 | writeLock(); |
334 | 0 | setCreated_unsafe(cooked); |
335 | 0 | } |
336 | ||
337 | ||
338 | /** | |
339 | * Retrieves the <code>Created</code> value as a <code>Field</code> | |
340 | * from this <code>Campaign</code> <code>Persistent</code>. | |
341 | * | |
342 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
343 | * @throws AccessPoemException | |
344 | * if the current <code>AccessToken</code> | |
345 | * does not confer write access rights | |
346 | * @return the Timestamp created | |
347 | */ | |
348 | public Field<Timestamp> getCreatedField() throws AccessPoemException { | |
349 | 0 | Column<Timestamp> c = _getCampaignTable().getCreatedColumn(); |
350 | 0 | return new Field<Timestamp>((Timestamp)c.getRaw(this), c); |
351 | } | |
352 | ||
353 | ||
354 | /** | |
355 | * Retrieves the <code>Lastrun</code> value, without locking, | |
356 | * for this <code>Campaign</code> <code>Persistent</code>. | |
357 | * | |
358 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
359 | * @return the Timestamp lastrun | |
360 | */ | |
361 | public Timestamp getLastrun_unsafe() { | |
362 | 0 | return lastrun; |
363 | } | |
364 | ||
365 | ||
366 | /** | |
367 | * Sets the <code>Lastrun</code> value directly, without checking, | |
368 | * for this Campaign <code>Persistent</code>. | |
369 | * | |
370 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
371 | * @param cooked the pre-validated value to set | |
372 | */ | |
373 | public void setLastrun_unsafe(Timestamp cooked) { | |
374 | 0 | lastrun = cooked; |
375 | 0 | } |
376 | ||
377 | /** | |
378 | * Retrieves the Lastrun value, with locking, for this | |
379 | * <code>Campaign</code> <code>Persistent</code>. | |
380 | * Field description: | |
381 | * When the users in this his Campaign were last emailed | |
382 | * | |
383 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
384 | * @throws AccessPoemException | |
385 | * if the current <code>AccessToken</code> | |
386 | * does not confer write access rights | |
387 | * @return the value of the field <code>Lastrun</code> for this | |
388 | * <code>Campaign</code> <code>Persistent</code> | |
389 | */ | |
390 | ||
391 | public Timestamp getLastrun() | |
392 | throws AccessPoemException { | |
393 | 0 | readLock(); |
394 | 0 | return getLastrun_unsafe(); |
395 | } | |
396 | ||
397 | ||
398 | /** | |
399 | * Sets the <code>Lastrun</code> value, with checking, for this | |
400 | * <code>Campaign</code> <code>Persistent</code>. | |
401 | * Field description: | |
402 | * When the users in this his Campaign were last emailed | |
403 | * | |
404 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
405 | * @param cooked a validated <code>int</code> | |
406 | * @throws AccessPoemException | |
407 | * if the current <code>AccessToken</code> | |
408 | * does not confer write access rights | |
409 | * @throws ValidationPoemException | |
410 | * if the value is not valid | |
411 | */ | |
412 | public void setLastrun(Timestamp cooked) | |
413 | throws AccessPoemException, ValidationPoemException { | |
414 | 0 | _getCampaignTable().getLastrunColumn(). |
415 | getType().assertValidCooked(cooked); | |
416 | 0 | writeLock(); |
417 | 0 | setLastrun_unsafe(cooked); |
418 | 0 | } |
419 | ||
420 | ||
421 | /** | |
422 | * Retrieves the <code>Lastrun</code> value as a <code>Field</code> | |
423 | * from this <code>Campaign</code> <code>Persistent</code>. | |
424 | * | |
425 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
426 | * @throws AccessPoemException | |
427 | * if the current <code>AccessToken</code> | |
428 | * does not confer write access rights | |
429 | * @return the Timestamp lastrun | |
430 | */ | |
431 | public Field<Timestamp> getLastrunField() throws AccessPoemException { | |
432 | 0 | Column<Timestamp> c = _getCampaignTable().getLastrunColumn(); |
433 | 0 | return new Field<Timestamp>((Timestamp)c.getRaw(this), c); |
434 | } | |
435 | ||
436 | ||
437 | /** | |
438 | * Retrieves the <code>Output</code> value, without locking, | |
439 | * for this <code>Campaign</code> <code>Persistent</code>. | |
440 | * | |
441 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
442 | * @return the String output | |
443 | */ | |
444 | public String getOutput_unsafe() { | |
445 | 0 | return output; |
446 | } | |
447 | ||
448 | ||
449 | /** | |
450 | * Sets the <code>Output</code> value directly, without checking, | |
451 | * for this Campaign <code>Persistent</code>. | |
452 | * | |
453 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
454 | * @param cooked the pre-validated value to set | |
455 | */ | |
456 | public void setOutput_unsafe(String cooked) { | |
457 | 0 | output = cooked; |
458 | 0 | } |
459 | ||
460 | /** | |
461 | * Retrieves the Output value, with locking, for this | |
462 | * <code>Campaign</code> <code>Persistent</code>. | |
463 | * Field description: | |
464 | * The file containing the output from the last run | |
465 | * | |
466 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
467 | * @throws AccessPoemException | |
468 | * if the current <code>AccessToken</code> | |
469 | * does not confer write access rights | |
470 | * @return the value of the field <code>Output</code> for this | |
471 | * <code>Campaign</code> <code>Persistent</code> | |
472 | */ | |
473 | ||
474 | public String getOutput() | |
475 | throws AccessPoemException { | |
476 | 0 | readLock(); |
477 | 0 | return getOutput_unsafe(); |
478 | } | |
479 | ||
480 | ||
481 | /** | |
482 | * Sets the <code>Output</code> value, with checking, for this | |
483 | * <code>Campaign</code> <code>Persistent</code>. | |
484 | * Field description: | |
485 | * The file containing the output from the last run | |
486 | * | |
487 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
488 | * @param cooked a validated <code>int</code> | |
489 | * @throws AccessPoemException | |
490 | * if the current <code>AccessToken</code> | |
491 | * does not confer write access rights | |
492 | * @throws ValidationPoemException | |
493 | * if the value is not valid | |
494 | */ | |
495 | public void setOutput(String cooked) | |
496 | throws AccessPoemException, ValidationPoemException { | |
497 | 0 | _getCampaignTable().getOutputColumn(). |
498 | getType().assertValidCooked(cooked); | |
499 | 0 | writeLock(); |
500 | 0 | setOutput_unsafe(cooked); |
501 | 0 | } |
502 | ||
503 | ||
504 | /** | |
505 | * Retrieves the <code>Output</code> value as a <code>Field</code> | |
506 | * from this <code>Campaign</code> <code>Persistent</code>. | |
507 | * | |
508 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
509 | * @throws AccessPoemException | |
510 | * if the current <code>AccessToken</code> | |
511 | * does not confer write access rights | |
512 | * @return the String output | |
513 | */ | |
514 | public Field<String> getOutputField() throws AccessPoemException { | |
515 | 0 | Column<String> c = _getCampaignTable().getOutputColumn(); |
516 | 0 | return new Field<String>((String)c.getRaw(this), c); |
517 | } | |
518 | ||
519 | ||
520 | /** | |
521 | * Retrieves the <code>Comment</code> value, without locking, | |
522 | * for this <code>Campaign</code> <code>Persistent</code>. | |
523 | * | |
524 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
525 | * @return the String comment | |
526 | */ | |
527 | public String getComment_unsafe() { | |
528 | 0 | return comment; |
529 | } | |
530 | ||
531 | ||
532 | /** | |
533 | * Sets the <code>Comment</code> value directly, without checking, | |
534 | * for this Campaign <code>Persistent</code>. | |
535 | * | |
536 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
537 | * @param cooked the pre-validated value to set | |
538 | */ | |
539 | public void setComment_unsafe(String cooked) { | |
540 | 0 | comment = cooked; |
541 | 0 | } |
542 | ||
543 | /** | |
544 | * Retrieves the Comment value, with locking, for this | |
545 | * <code>Campaign</code> <code>Persistent</code>. | |
546 | * Field description: | |
547 | * Any comments on this Campaign | |
548 | * | |
549 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
550 | * @throws AccessPoemException | |
551 | * if the current <code>AccessToken</code> | |
552 | * does not confer write access rights | |
553 | * @return the value of the field <code>Comment</code> for this | |
554 | * <code>Campaign</code> <code>Persistent</code> | |
555 | */ | |
556 | ||
557 | public String getComment() | |
558 | throws AccessPoemException { | |
559 | 0 | readLock(); |
560 | 0 | return getComment_unsafe(); |
561 | } | |
562 | ||
563 | ||
564 | /** | |
565 | * Sets the <code>Comment</code> value, with checking, for this | |
566 | * <code>Campaign</code> <code>Persistent</code>. | |
567 | * Field description: | |
568 | * Any comments on this Campaign | |
569 | * | |
570 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
571 | * @param cooked a validated <code>int</code> | |
572 | * @throws AccessPoemException | |
573 | * if the current <code>AccessToken</code> | |
574 | * does not confer write access rights | |
575 | * @throws ValidationPoemException | |
576 | * if the value is not valid | |
577 | */ | |
578 | public void setComment(String cooked) | |
579 | throws AccessPoemException, ValidationPoemException { | |
580 | 0 | _getCampaignTable().getCommentColumn(). |
581 | getType().assertValidCooked(cooked); | |
582 | 0 | writeLock(); |
583 | 0 | setComment_unsafe(cooked); |
584 | 0 | } |
585 | ||
586 | ||
587 | /** | |
588 | * Retrieves the <code>Comment</code> value as a <code>Field</code> | |
589 | * from this <code>Campaign</code> <code>Persistent</code>. | |
590 | * | |
591 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
592 | * @throws AccessPoemException | |
593 | * if the current <code>AccessToken</code> | |
594 | * does not confer write access rights | |
595 | * @return the String comment | |
596 | */ | |
597 | public Field<String> getCommentField() throws AccessPoemException { | |
598 | 0 | Column<String> c = _getCampaignTable().getCommentColumn(); |
599 | 0 | return new Field<String>((String)c.getRaw(this), c); |
600 | } | |
601 | ||
602 | ||
603 | /** | |
604 | * Retrieves the <code>Template</code> value, without locking, | |
605 | * for this <code>Campaign</code> <code>Persistent</code>. | |
606 | * | |
607 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
608 | * @return the String template | |
609 | */ | |
610 | public String getTemplate_unsafe() { | |
611 | 0 | return template; |
612 | } | |
613 | ||
614 | ||
615 | /** | |
616 | * Sets the <code>Template</code> value directly, without checking, | |
617 | * for this Campaign <code>Persistent</code>. | |
618 | * | |
619 | * see org.melati.poem.prepro.FieldDef#generateBaseMethods | |
620 | * @param cooked the pre-validated value to set | |
621 | */ | |
622 | public void setTemplate_unsafe(String cooked) { | |
623 | 0 | template = cooked; |
624 | 0 | } |
625 | ||
626 | /** | |
627 | * Retrieves the Template value, with locking, for this | |
628 | * <code>Campaign</code> <code>Persistent</code>. | |
629 | * Field description: | |
630 | * A template for the email to be sent | |
631 | * | |
632 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
633 | * @throws AccessPoemException | |
634 | * if the current <code>AccessToken</code> | |
635 | * does not confer write access rights | |
636 | * @return the value of the field <code>Template</code> for this | |
637 | * <code>Campaign</code> <code>Persistent</code> | |
638 | */ | |
639 | ||
640 | public String getTemplate() | |
641 | throws AccessPoemException { | |
642 | 0 | readLock(); |
643 | 0 | return getTemplate_unsafe(); |
644 | } | |
645 | ||
646 | ||
647 | /** | |
648 | * Sets the <code>Template</code> value, with checking, for this | |
649 | * <code>Campaign</code> <code>Persistent</code>. | |
650 | * Field description: | |
651 | * A template for the email to be sent | |
652 | * | |
653 | * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods | |
654 | * @param cooked a validated <code>int</code> | |
655 | * @throws AccessPoemException | |
656 | * if the current <code>AccessToken</code> | |
657 | * does not confer write access rights | |
658 | * @throws ValidationPoemException | |
659 | * if the value is not valid | |
660 | */ | |
661 | public void setTemplate(String cooked) | |
662 | throws AccessPoemException, ValidationPoemException { | |
663 | 0 | _getCampaignTable().getTemplateColumn(). |
664 | getType().assertValidCooked(cooked); | |
665 | 0 | writeLock(); |
666 | 0 | setTemplate_unsafe(cooked); |
667 | 0 | } |
668 | ||
669 | ||
670 | /** | |
671 | * Retrieves the <code>Template</code> value as a <code>Field</code> | |
672 | * from this <code>Campaign</code> <code>Persistent</code>. | |
673 | * | |
674 | * see org.melati.poem.prepro.FieldDef#generateFieldCreator | |
675 | * @throws AccessPoemException | |
676 | * if the current <code>AccessToken</code> | |
677 | * does not confer write access rights | |
678 | * @return the String template | |
679 | */ | |
680 | public Field<String> getTemplateField() throws AccessPoemException { | |
681 | 0 | Column<String> c = _getCampaignTable().getTemplateColumn(); |
682 | 0 | return new Field<String>((String)c.getRaw(this), c); |
683 | } | |
684 | ||
685 | 0 | private CachedSelection<CampaignUser> campaignCampaignUsers = null; |
686 | /** References to this Campaign in the CampaignUser table via its campaign field.*/ | |
687 | @SuppressWarnings("unchecked") | |
688 | public Enumeration<CampaignUser> getCampaignCampaignUsers() { | |
689 | 0 | if (getTroid() == null) |
690 | 0 | return new EmptyEnumeration<CampaignUser>(); |
691 | else { | |
692 | 0 | if (campaignCampaignUsers == null) |
693 | 0 | campaignCampaignUsers = |
694 | getBibliomaniaDatabaseTables().getCampaignUserTable().getCampaignColumn().cachedSelectionWhereEq(getTroid()); | |
695 | 0 | return campaignCampaignUsers.objects(); |
696 | } | |
697 | } | |
698 | ||
699 | ||
700 | /** References to this Campaign in the CampaignUser table via its campaign field, as a List.*/ | |
701 | public List<CampaignUser> getCampaignCampaignUserList() { | |
702 | 0 | return Collections.list(getCampaignCampaignUsers()); |
703 | } | |
704 | ||
705 | ||
706 | ||
707 | } | |
708 |