Coverage Report - org.paneris.bibliomania.generated.CampaignTableBase
 
Classes in this File Line Coverage Branch Coverage Complexity
CampaignTableBase
54%
18/33
N/A
1
CampaignTableBase$1
6%
1/15
N/A
1
CampaignTableBase$2
6%
1/16
N/A
1
CampaignTableBase$3
6%
1/15
N/A
1
CampaignTableBase$4
6%
1/15
N/A
1
CampaignTableBase$5
6%
1/16
N/A
1
CampaignTableBase$6
5%
1/17
N/A
1
CampaignTableBase$7
5%
1/17
N/A
1
 
 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 org.melati.poem.AccessPoemException;
 8  
 import org.melati.poem.Column;
 9  
 import org.melati.poem.Database;
 10  
 import org.melati.poem.DefinitionSource;
 11  
 import org.melati.poem.DisplayLevel;
 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.TimestampPoemType;
 19  
 import org.melati.poem.TroidPoemType;
 20  
 import org.melati.poem.ValidationPoemException;
 21  
 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
 22  
 import org.paneris.bibliomania.BibliomaniaTable;
 23  
 import org.paneris.bibliomania.Campaign;
 24  
 
 25  
 
 26  
 /**
 27  
  * Melati POEM generated base class for <code>Table</code> <code>Campaign</code>.
 28  
  *
 29  
  * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 30  
  */
 31  
 
 32  
 public class CampaignTableBase<T extends Campaign> extends BibliomaniaTable<T> {
 33  
 
 34  2
   private Column<Integer> col_id = null;
 35  2
   private Column<String> col_displayname = null;
 36  2
   private Column<Timestamp> col_created = null;
 37  2
   private Column<Timestamp> col_lastrun = null;
 38  2
   private Column<String> col_output = null;
 39  2
   private Column<String> col_comment = null;
 40  2
   private Column<String> col_template = null;
 41  
 
 42  
  /**
 43  
   * Constructor. 
 44  
   * 
 45  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 46  
   * @param database          the POEM database we are using
 47  
   * @param name              the name of this <code>Table</code>
 48  
   * @param definitionSource  which definition is being used
 49  
   * @throws PoemException    if anything goes wrong
 50  
   */
 51  
 
 52  
   public CampaignTableBase(
 53  
       Database database, String name,
 54  
       DefinitionSource definitionSource) throws PoemException {
 55  2
     super(database, name, definitionSource);
 56  2
   }
 57  
 
 58  
 
 59  
  /**
 60  
   * Get the database tables.
 61  
   *
 62  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 63  
   * @return the database tables
 64  
   */
 65  
   public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
 66  0
     return (BibliomaniaDatabaseTables)getDatabase();
 67  
   }
 68  
 
 69  
 
 70  
  /**
 71  
   * Initialise this table by defining its columns.
 72  
   *
 73  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 74  
   */
 75  
   public void init() throws PoemException {
 76  2
     super.init();
 77  2
     defineColumn(col_id =
 78  
         new Column<Integer>(this, "id",
 79  
                    new TroidPoemType(),
 80  2
                    DefinitionSource.dsd) { 
 81  
           public Object getCooked(Persistent g)
 82  
               throws AccessPoemException, PoemException {
 83  0
             return ((Campaign)g).getId();
 84  
           }
 85  
 
 86  
           public void setCooked(Persistent g, Object cooked)
 87  
               throws AccessPoemException, ValidationPoemException {
 88  0
             ((Campaign)g).setId((Integer)cooked);
 89  0
           }
 90  
 
 91  
           public Field<Integer> asField(Persistent g) {
 92  0
             return ((Campaign)g).getIdField();
 93  
           }
 94  
 
 95  
           public boolean defaultUserEditable() {
 96  0
             return false;
 97  
           }
 98  
 
 99  
           public boolean defaultUserCreateable() {
 100  0
             return false;
 101  
           }
 102  
 
 103  
           public DisplayLevel defaultDisplayLevel() {
 104  0
             return DisplayLevel.record;
 105  
           }
 106  
 
 107  
           public int defaultDisplayOrder() {
 108  0
             return 0;
 109  
           }
 110  
 
 111  
           public Object getRaw_unsafe(Persistent g)
 112  
               throws AccessPoemException {
 113  0
             return ((Campaign)g).getId_unsafe();
 114  
           }
 115  
 
 116  
           public void setRaw_unsafe(Persistent g, Object raw)
 117  
               throws AccessPoemException {
 118  0
             ((Campaign)g).setId_unsafe((Integer)raw);
 119  0
           }
 120  
 
 121  
           public Object getRaw(Persistent g)
 122  
               throws AccessPoemException {
 123  0
             return ((Campaign)g).getId();
 124  
           }
 125  
 
 126  
           public void setRaw(Persistent g, Object raw)
 127  
               throws AccessPoemException {
 128  0
             ((Campaign)g).setId((Integer)raw);
 129  0
           }
 130  
         });
 131  
 
 132  2
     defineColumn(col_displayname =
 133  
         new Column<String>(this, "displayname",
 134  
                    new StringPoemType(false, -1),
 135  2
                    DefinitionSource.dsd) { 
 136  
           public Object getCooked(Persistent g)
 137  
               throws AccessPoemException, PoemException {
 138  0
             return ((Campaign)g).getDisplayname();
 139  
           }
 140  
 
 141  
           public void setCooked(Persistent g, Object cooked)
 142  
               throws AccessPoemException, ValidationPoemException {
 143  0
             ((Campaign)g).setDisplayname((String)cooked);
 144  0
           }
 145  
 
 146  
           public Field<String> asField(Persistent g) {
 147  0
             return ((Campaign)g).getDisplaynameField();
 148  
           }
 149  
 
 150  
           public DisplayLevel defaultDisplayLevel() {
 151  0
             return DisplayLevel.primary;
 152  
           }
 153  
 
 154  
           public Searchability defaultSearchability() {
 155  0
             return Searchability.primary;
 156  
           }
 157  
 
 158  
           public String defaultDisplayName() {
 159  0
             return "Display name";
 160  
           }
 161  
 
 162  
           public int defaultDisplayOrder() {
 163  0
             return 1;
 164  
           }
 165  
 
 166  
           public String defaultDescription() {
 167  0
             return "The Campaign's name";
 168  
           }
 169  
 
 170  
           public Object getRaw_unsafe(Persistent g)
 171  
               throws AccessPoemException {
 172  0
             return ((Campaign)g).getDisplayname_unsafe();
 173  
           }
 174  
 
 175  
           public void setRaw_unsafe(Persistent g, Object raw)
 176  
               throws AccessPoemException {
 177  0
             ((Campaign)g).setDisplayname_unsafe((String)raw);
 178  0
           }
 179  
 
 180  
           public Object getRaw(Persistent g)
 181  
               throws AccessPoemException {
 182  0
             return ((Campaign)g).getDisplayname();
 183  
           }
 184  
 
 185  
           public void setRaw(Persistent g, Object raw)
 186  
               throws AccessPoemException {
 187  0
             ((Campaign)g).setDisplayname((String)raw);
 188  0
           }
 189  
         });
 190  
 
 191  2
     defineColumn(col_created =
 192  
         new Column<Timestamp>(this, "created",
 193  
                    new TimestampPoemType(false),
 194  2
                    DefinitionSource.dsd) { 
 195  
           public Object getCooked(Persistent g)
 196  
               throws AccessPoemException, PoemException {
 197  0
             return ((Campaign)g).getCreated();
 198  
           }
 199  
 
 200  
           public void setCooked(Persistent g, Object cooked)
 201  
               throws AccessPoemException, ValidationPoemException {
 202  0
             ((Campaign)g).setCreated((Timestamp)cooked);
 203  0
           }
 204  
 
 205  
           public Field<Timestamp> asField(Persistent g) {
 206  0
             return ((Campaign)g).getCreatedField();
 207  
           }
 208  
 
 209  
           public DisplayLevel defaultDisplayLevel() {
 210  0
             return DisplayLevel.record;
 211  
           }
 212  
 
 213  
           public String defaultDisplayName() {
 214  0
             return "Date Created";
 215  
           }
 216  
 
 217  
           public int defaultDisplayOrder() {
 218  0
             return 2;
 219  
           }
 220  
 
 221  
           public String defaultDescription() {
 222  0
             return "When this Campaign was created";
 223  
           }
 224  
 
 225  
           public Object getRaw_unsafe(Persistent g)
 226  
               throws AccessPoemException {
 227  0
             return ((Campaign)g).getCreated_unsafe();
 228  
           }
 229  
 
 230  
           public void setRaw_unsafe(Persistent g, Object raw)
 231  
               throws AccessPoemException {
 232  0
             ((Campaign)g).setCreated_unsafe((Timestamp)raw);
 233  0
           }
 234  
 
 235  
           public Object getRaw(Persistent g)
 236  
               throws AccessPoemException {
 237  0
             return ((Campaign)g).getCreated();
 238  
           }
 239  
 
 240  
           public void setRaw(Persistent g, Object raw)
 241  
               throws AccessPoemException {
 242  0
             ((Campaign)g).setCreated((Timestamp)raw);
 243  0
           }
 244  
         });
 245  
 
 246  2
     defineColumn(col_lastrun =
 247  
         new Column<Timestamp>(this, "lastrun",
 248  
                    new TimestampPoemType(true),
 249  2
                    DefinitionSource.dsd) { 
 250  
           public Object getCooked(Persistent g)
 251  
               throws AccessPoemException, PoemException {
 252  0
             return ((Campaign)g).getLastrun();
 253  
           }
 254  
 
 255  
           public void setCooked(Persistent g, Object cooked)
 256  
               throws AccessPoemException, ValidationPoemException {
 257  0
             ((Campaign)g).setLastrun((Timestamp)cooked);
 258  0
           }
 259  
 
 260  
           public Field<Timestamp> asField(Persistent g) {
 261  0
             return ((Campaign)g).getLastrunField();
 262  
           }
 263  
 
 264  
           public DisplayLevel defaultDisplayLevel() {
 265  0
             return DisplayLevel.record;
 266  
           }
 267  
 
 268  
           public String defaultDisplayName() {
 269  0
             return "Date Last Run";
 270  
           }
 271  
 
 272  
           public int defaultDisplayOrder() {
 273  0
             return 3;
 274  
           }
 275  
 
 276  
           public String defaultDescription() {
 277  0
             return "When the users in this his Campaign were last emailed";
 278  
           }
 279  
 
 280  
           public Object getRaw_unsafe(Persistent g)
 281  
               throws AccessPoemException {
 282  0
             return ((Campaign)g).getLastrun_unsafe();
 283  
           }
 284  
 
 285  
           public void setRaw_unsafe(Persistent g, Object raw)
 286  
               throws AccessPoemException {
 287  0
             ((Campaign)g).setLastrun_unsafe((Timestamp)raw);
 288  0
           }
 289  
 
 290  
           public Object getRaw(Persistent g)
 291  
               throws AccessPoemException {
 292  0
             return ((Campaign)g).getLastrun();
 293  
           }
 294  
 
 295  
           public void setRaw(Persistent g, Object raw)
 296  
               throws AccessPoemException {
 297  0
             ((Campaign)g).setLastrun((Timestamp)raw);
 298  0
           }
 299  
         });
 300  
 
 301  2
     defineColumn(col_output =
 302  
         new Column<String>(this, "output",
 303  
                    new StringPoemType(false, -1),
 304  2
                    DefinitionSource.dsd) { 
 305  
           public Object getCooked(Persistent g)
 306  
               throws AccessPoemException, PoemException {
 307  0
             return ((Campaign)g).getOutput();
 308  
           }
 309  
 
 310  
           public void setCooked(Persistent g, Object cooked)
 311  
               throws AccessPoemException, ValidationPoemException {
 312  0
             ((Campaign)g).setOutput((String)cooked);
 313  0
           }
 314  
 
 315  
           public Field<String> asField(Persistent g) {
 316  0
             return ((Campaign)g).getOutputField();
 317  
           }
 318  
 
 319  
           public DisplayLevel defaultDisplayLevel() {
 320  0
             return DisplayLevel.record;
 321  
           }
 322  
 
 323  
           public Searchability defaultSearchability() {
 324  0
             return Searchability.yes;
 325  
           }
 326  
 
 327  
           public String defaultDisplayName() {
 328  0
             return "Output";
 329  
           }
 330  
 
 331  
           public int defaultDisplayOrder() {
 332  0
             return 4;
 333  
           }
 334  
 
 335  
           public String defaultDescription() {
 336  0
             return "The file containing the output from the last run";
 337  
           }
 338  
 
 339  
           public Object getRaw_unsafe(Persistent g)
 340  
               throws AccessPoemException {
 341  0
             return ((Campaign)g).getOutput_unsafe();
 342  
           }
 343  
 
 344  
           public void setRaw_unsafe(Persistent g, Object raw)
 345  
               throws AccessPoemException {
 346  0
             ((Campaign)g).setOutput_unsafe((String)raw);
 347  0
           }
 348  
 
 349  
           public Object getRaw(Persistent g)
 350  
               throws AccessPoemException {
 351  0
             return ((Campaign)g).getOutput();
 352  
           }
 353  
 
 354  
           public void setRaw(Persistent g, Object raw)
 355  
               throws AccessPoemException {
 356  0
             ((Campaign)g).setOutput((String)raw);
 357  0
           }
 358  
         });
 359  
 
 360  2
     defineColumn(col_comment =
 361  
         new Column<String>(this, "comment",
 362  
                    new StringPoemType(true, -1),
 363  2
                    DefinitionSource.dsd) { 
 364  
           public Object getCooked(Persistent g)
 365  
               throws AccessPoemException, PoemException {
 366  0
             return ((Campaign)g).getComment();
 367  
           }
 368  
 
 369  
           public void setCooked(Persistent g, Object cooked)
 370  
               throws AccessPoemException, ValidationPoemException {
 371  0
             ((Campaign)g).setComment((String)cooked);
 372  0
           }
 373  
 
 374  
           public Field<String> asField(Persistent g) {
 375  0
             return ((Campaign)g).getCommentField();
 376  
           }
 377  
 
 378  
           public DisplayLevel defaultDisplayLevel() {
 379  0
             return DisplayLevel.record;
 380  
           }
 381  
 
 382  
           public Searchability defaultSearchability() {
 383  0
             return Searchability.no;
 384  
           }
 385  
 
 386  
           public int defaultDisplayOrder() {
 387  0
             return 5;
 388  
           }
 389  
 
 390  
           public String defaultDescription() {
 391  0
             return "Any comments on this Campaign";
 392  
           }
 393  
 
 394  
           public int defaultWidth() {
 395  0
             return 60;
 396  
           }
 397  
 
 398  
           public int defaultHeight() {
 399  0
             return 10;
 400  
           }
 401  
 
 402  
           public Object getRaw_unsafe(Persistent g)
 403  
               throws AccessPoemException {
 404  0
             return ((Campaign)g).getComment_unsafe();
 405  
           }
 406  
 
 407  
           public void setRaw_unsafe(Persistent g, Object raw)
 408  
               throws AccessPoemException {
 409  0
             ((Campaign)g).setComment_unsafe((String)raw);
 410  0
           }
 411  
 
 412  
           public Object getRaw(Persistent g)
 413  
               throws AccessPoemException {
 414  0
             return ((Campaign)g).getComment();
 415  
           }
 416  
 
 417  
           public void setRaw(Persistent g, Object raw)
 418  
               throws AccessPoemException {
 419  0
             ((Campaign)g).setComment((String)raw);
 420  0
           }
 421  
         });
 422  
 
 423  2
     defineColumn(col_template =
 424  
         new Column<String>(this, "template",
 425  
                    new StringPoemType(true, -1),
 426  2
                    DefinitionSource.dsd) { 
 427  
           public Object getCooked(Persistent g)
 428  
               throws AccessPoemException, PoemException {
 429  0
             return ((Campaign)g).getTemplate();
 430  
           }
 431  
 
 432  
           public void setCooked(Persistent g, Object cooked)
 433  
               throws AccessPoemException, ValidationPoemException {
 434  0
             ((Campaign)g).setTemplate((String)cooked);
 435  0
           }
 436  
 
 437  
           public Field<String> asField(Persistent g) {
 438  0
             return ((Campaign)g).getTemplateField();
 439  
           }
 440  
 
 441  
           public DisplayLevel defaultDisplayLevel() {
 442  0
             return DisplayLevel.record;
 443  
           }
 444  
 
 445  
           public Searchability defaultSearchability() {
 446  0
             return Searchability.no;
 447  
           }
 448  
 
 449  
           public int defaultDisplayOrder() {
 450  0
             return 6;
 451  
           }
 452  
 
 453  
           public String defaultDescription() {
 454  0
             return "A template for the email to be sent";
 455  
           }
 456  
 
 457  
           public int defaultWidth() {
 458  0
             return 80;
 459  
           }
 460  
 
 461  
           public int defaultHeight() {
 462  0
             return 20;
 463  
           }
 464  
 
 465  
           public Object getRaw_unsafe(Persistent g)
 466  
               throws AccessPoemException {
 467  0
             return ((Campaign)g).getTemplate_unsafe();
 468  
           }
 469  
 
 470  
           public void setRaw_unsafe(Persistent g, Object raw)
 471  
               throws AccessPoemException {
 472  0
             ((Campaign)g).setTemplate_unsafe((String)raw);
 473  0
           }
 474  
 
 475  
           public Object getRaw(Persistent g)
 476  
               throws AccessPoemException {
 477  0
             return ((Campaign)g).getTemplate();
 478  
           }
 479  
 
 480  
           public void setRaw(Persistent g, Object raw)
 481  
               throws AccessPoemException {
 482  0
             ((Campaign)g).setTemplate((String)raw);
 483  0
           }
 484  
         });
 485  2
   }
 486  
 
 487  
 
 488  
  /**
 489  
   * Retrieves the <code>Id</code> <code>Column</code> for this 
 490  
   * <code>Campaign</code> <code>Table</code>.
 491  
   * 
 492  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 493  
   * @return the id <code>Column</code>
 494  
   */
 495  
   public final Column<Integer> getIdColumn() {
 496  0
     return col_id;
 497  
   }
 498  
 
 499  
 
 500  
  /**
 501  
   * Retrieves the <code>Displayname</code> <code>Column</code> for this 
 502  
   * <code>Campaign</code> <code>Table</code>.
 503  
   * 
 504  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 505  
   * @return the displayname <code>Column</code>
 506  
   */
 507  
   public final Column<String> getDisplaynameColumn() {
 508  0
     return col_displayname;
 509  
   }
 510  
 
 511  
 
 512  
  /**
 513  
   * Retrieves the <code>Created</code> <code>Column</code> for this 
 514  
   * <code>Campaign</code> <code>Table</code>.
 515  
   * 
 516  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 517  
   * @return the created <code>Column</code>
 518  
   */
 519  
   public final Column<Timestamp> getCreatedColumn() {
 520  0
     return col_created;
 521  
   }
 522  
 
 523  
 
 524  
  /**
 525  
   * Retrieves the <code>Lastrun</code> <code>Column</code> for this 
 526  
   * <code>Campaign</code> <code>Table</code>.
 527  
   * 
 528  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 529  
   * @return the lastrun <code>Column</code>
 530  
   */
 531  
   public final Column<Timestamp> getLastrunColumn() {
 532  0
     return col_lastrun;
 533  
   }
 534  
 
 535  
 
 536  
  /**
 537  
   * Retrieves the <code>Output</code> <code>Column</code> for this 
 538  
   * <code>Campaign</code> <code>Table</code>.
 539  
   * 
 540  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 541  
   * @return the output <code>Column</code>
 542  
   */
 543  
   public final Column<String> getOutputColumn() {
 544  0
     return col_output;
 545  
   }
 546  
 
 547  
 
 548  
  /**
 549  
   * Retrieves the <code>Comment</code> <code>Column</code> for this 
 550  
   * <code>Campaign</code> <code>Table</code>.
 551  
   * 
 552  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 553  
   * @return the comment <code>Column</code>
 554  
   */
 555  
   public final Column<String> getCommentColumn() {
 556  0
     return col_comment;
 557  
   }
 558  
 
 559  
 
 560  
  /**
 561  
   * Retrieves the <code>Template</code> <code>Column</code> for this 
 562  
   * <code>Campaign</code> <code>Table</code>.
 563  
   * 
 564  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 565  
   * @return the template <code>Column</code>
 566  
   */
 567  
   public final Column<String> getTemplateColumn() {
 568  0
     return col_template;
 569  
   }
 570  
 
 571  
 
 572  
  /**
 573  
   * Retrieve the <code>Campaign</code> as a <code>Campaign</code>.
 574  
   *
 575  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 576  
   * @param troid a Table Row Oject ID
 577  
   * @return the <code>Persistent</code> identified by the <code>troid</code>
 578  
   */
 579  
   public Campaign getCampaignObject(Integer troid) {
 580  0
     return (Campaign)getObject(troid);
 581  
   }
 582  
 
 583  
 
 584  
  /**
 585  
   * Retrieve the <code>Campaign</code> 
 586  
   * as a <code>Campaign</code>.
 587  
   *
 588  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 589  
   * @param troid a Table Row Object ID
 590  
   * @return the <code>Persistent</code> identified   */
 591  
   public Campaign getCampaignObject(int troid) {
 592  0
     return (Campaign)getObject(troid);
 593  
   }
 594  
 
 595  
   protected JdbcPersistent _newPersistent() {
 596  0
     return new Campaign();
 597  
   }
 598  
   public String defaultDescription() {
 599  0
     return "A campaign to send emails to users";
 600  
   }
 601  
 
 602  
   public boolean defaultRememberAllTroids() {
 603  0
     return true;
 604  
   }
 605  
 
 606  
   public String defaultCategory() {
 607  0
     return "User";
 608  
   }
 609  
 
 610  
   public int defaultDisplayOrder() {
 611  0
     return 2100;
 612  
   }
 613  
 }
 614