Coverage Report - org.paneris.bibliomania.generated.SupplierTableBase
 
Classes in this File Line Coverage Branch Coverage Complexity
SupplierTableBase
52%
18/34
N/A
1
SupplierTableBase$1
6%
1/16
N/A
1
SupplierTableBase$2
5%
1/18
N/A
1
SupplierTableBase$3
5%
1/18
N/A
1
SupplierTableBase$4
5%
1/18
N/A
1
SupplierTableBase$5
5%
1/17
N/A
1
SupplierTableBase$6
5%
1/17
N/A
1
SupplierTableBase$7
6%
1/16
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 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.Searchability;
 16  
 import org.melati.poem.StringPoemType;
 17  
 import org.melati.poem.TroidPoemType;
 18  
 import org.melati.poem.ValidationPoemException;
 19  
 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
 20  
 import org.paneris.bibliomania.BibliomaniaTable;
 21  
 import org.paneris.bibliomania.Supplier;
 22  
 
 23  
 
 24  
 /**
 25  
  * Melati POEM generated base class for <code>Table</code> <code>Supplier</code>.
 26  
  *
 27  
  * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 28  
  */
 29  
 
 30  
 public class SupplierTableBase<T extends Supplier> extends BibliomaniaTable<T> {
 31  
 
 32  2
   private Column<Integer> col_id = null;
 33  2
   private Column<String> col_name = null;
 34  2
   private Column<String> col_address = null;
 35  2
   private Column<String> col_contact = null;
 36  2
   private Column<String> col_email = null;
 37  2
   private Column<String> col_website = null;
 38  2
   private Column<String> col_location = null;
 39  
 
 40  
  /**
 41  
   * Constructor. 
 42  
   * 
 43  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 44  
   * @param database          the POEM database we are using
 45  
   * @param name              the name of this <code>Table</code>
 46  
   * @param definitionSource  which definition is being used
 47  
   * @throws PoemException    if anything goes wrong
 48  
   */
 49  
 
 50  
   public SupplierTableBase(
 51  
       Database database, String name,
 52  
       DefinitionSource definitionSource) throws PoemException {
 53  2
     super(database, name, definitionSource);
 54  2
   }
 55  
 
 56  
 
 57  
  /**
 58  
   * Get the database tables.
 59  
   *
 60  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 61  
   * @return the database tables
 62  
   */
 63  
   public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
 64  0
     return (BibliomaniaDatabaseTables)getDatabase();
 65  
   }
 66  
 
 67  
 
 68  
  /**
 69  
   * Initialise this table by defining its columns.
 70  
   *
 71  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 72  
   */
 73  
   public void init() throws PoemException {
 74  2
     super.init();
 75  2
     defineColumn(col_id =
 76  
         new Column<Integer>(this, "id",
 77  
                    new TroidPoemType(),
 78  2
                    DefinitionSource.dsd) { 
 79  
           public Object getCooked(Persistent g)
 80  
               throws AccessPoemException, PoemException {
 81  0
             return ((Supplier)g).getId();
 82  
           }
 83  
 
 84  
           public void setCooked(Persistent g, Object cooked)
 85  
               throws AccessPoemException, ValidationPoemException {
 86  0
             ((Supplier)g).setId((Integer)cooked);
 87  0
           }
 88  
 
 89  
           public Field<Integer> asField(Persistent g) {
 90  0
             return ((Supplier)g).getIdField();
 91  
           }
 92  
 
 93  
           public boolean defaultUserEditable() {
 94  0
             return false;
 95  
           }
 96  
 
 97  
           public boolean defaultUserCreateable() {
 98  0
             return false;
 99  
           }
 100  
 
 101  
           public DisplayLevel defaultDisplayLevel() {
 102  0
             return DisplayLevel.record;
 103  
           }
 104  
 
 105  
           public Searchability defaultSearchability() {
 106  0
             return Searchability.no;
 107  
           }
 108  
 
 109  
           public int defaultDisplayOrder() {
 110  0
             return 0;
 111  
           }
 112  
 
 113  
           public Object getRaw_unsafe(Persistent g)
 114  
               throws AccessPoemException {
 115  0
             return ((Supplier)g).getId_unsafe();
 116  
           }
 117  
 
 118  
           public void setRaw_unsafe(Persistent g, Object raw)
 119  
               throws AccessPoemException {
 120  0
             ((Supplier)g).setId_unsafe((Integer)raw);
 121  0
           }
 122  
 
 123  
           public Object getRaw(Persistent g)
 124  
               throws AccessPoemException {
 125  0
             return ((Supplier)g).getId();
 126  
           }
 127  
 
 128  
           public void setRaw(Persistent g, Object raw)
 129  
               throws AccessPoemException {
 130  0
             ((Supplier)g).setId((Integer)raw);
 131  0
           }
 132  
         });
 133  
 
 134  2
     defineColumn(col_name =
 135  
         new Column<String>(this, "name",
 136  
                    new StringPoemType(false, -1),
 137  2
                    DefinitionSource.dsd) { 
 138  
           public Object getCooked(Persistent g)
 139  
               throws AccessPoemException, PoemException {
 140  0
             return ((Supplier)g).getName();
 141  
           }
 142  
 
 143  
           public void setCooked(Persistent g, Object cooked)
 144  
               throws AccessPoemException, ValidationPoemException {
 145  0
             ((Supplier)g).setName((String)cooked);
 146  0
           }
 147  
 
 148  
           public Field<String> asField(Persistent g) {
 149  0
             return ((Supplier)g).getNameField();
 150  
           }
 151  
 
 152  
           public DisplayLevel defaultDisplayLevel() {
 153  0
             return DisplayLevel.primary;
 154  
           }
 155  
 
 156  
           public Searchability defaultSearchability() {
 157  0
             return Searchability.yes;
 158  
           }
 159  
 
 160  
           public String defaultDisplayName() {
 161  0
             return "Name";
 162  
           }
 163  
 
 164  
           public int defaultDisplayOrder() {
 165  0
             return 1;
 166  
           }
 167  
 
 168  
           public String defaultDescription() {
 169  0
             return "The full name of the Supplier";
 170  
           }
 171  
 
 172  
           public boolean defaultUnique() {
 173  0
             return true;
 174  
           }
 175  
 
 176  
           public int defaultWidth() {
 177  0
             return 20;
 178  
           }
 179  
 
 180  
           public Object getRaw_unsafe(Persistent g)
 181  
               throws AccessPoemException {
 182  0
             return ((Supplier)g).getName_unsafe();
 183  
           }
 184  
 
 185  
           public void setRaw_unsafe(Persistent g, Object raw)
 186  
               throws AccessPoemException {
 187  0
             ((Supplier)g).setName_unsafe((String)raw);
 188  0
           }
 189  
 
 190  
           public Object getRaw(Persistent g)
 191  
               throws AccessPoemException {
 192  0
             return ((Supplier)g).getName();
 193  
           }
 194  
 
 195  
           public void setRaw(Persistent g, Object raw)
 196  
               throws AccessPoemException {
 197  0
             ((Supplier)g).setName((String)raw);
 198  0
           }
 199  
         });
 200  
 
 201  2
     defineColumn(col_address =
 202  
         new Column<String>(this, "address",
 203  
                    new StringPoemType(true, -1),
 204  2
                    DefinitionSource.dsd) { 
 205  
           public Object getCooked(Persistent g)
 206  
               throws AccessPoemException, PoemException {
 207  0
             return ((Supplier)g).getAddress();
 208  
           }
 209  
 
 210  
           public void setCooked(Persistent g, Object cooked)
 211  
               throws AccessPoemException, ValidationPoemException {
 212  0
             ((Supplier)g).setAddress((String)cooked);
 213  0
           }
 214  
 
 215  
           public Field<String> asField(Persistent g) {
 216  0
             return ((Supplier)g).getAddressField();
 217  
           }
 218  
 
 219  
           public DisplayLevel defaultDisplayLevel() {
 220  0
             return DisplayLevel.record;
 221  
           }
 222  
 
 223  
           public Searchability defaultSearchability() {
 224  0
             return Searchability.no;
 225  
           }
 226  
 
 227  
           public String defaultDisplayName() {
 228  0
             return "Address";
 229  
           }
 230  
 
 231  
           public int defaultDisplayOrder() {
 232  0
             return 2;
 233  
           }
 234  
 
 235  
           public String defaultDescription() {
 236  0
             return "A postal address for the Supplier";
 237  
           }
 238  
 
 239  
           public int defaultWidth() {
 240  0
             return 20;
 241  
           }
 242  
 
 243  
           public int defaultHeight() {
 244  0
             return 5;
 245  
           }
 246  
 
 247  
           public Object getRaw_unsafe(Persistent g)
 248  
               throws AccessPoemException {
 249  0
             return ((Supplier)g).getAddress_unsafe();
 250  
           }
 251  
 
 252  
           public void setRaw_unsafe(Persistent g, Object raw)
 253  
               throws AccessPoemException {
 254  0
             ((Supplier)g).setAddress_unsafe((String)raw);
 255  0
           }
 256  
 
 257  
           public Object getRaw(Persistent g)
 258  
               throws AccessPoemException {
 259  0
             return ((Supplier)g).getAddress();
 260  
           }
 261  
 
 262  
           public void setRaw(Persistent g, Object raw)
 263  
               throws AccessPoemException {
 264  0
             ((Supplier)g).setAddress((String)raw);
 265  0
           }
 266  
         });
 267  
 
 268  2
     defineColumn(col_contact =
 269  
         new Column<String>(this, "contact",
 270  
                    new StringPoemType(true, -1),
 271  2
                    DefinitionSource.dsd) { 
 272  
           public Object getCooked(Persistent g)
 273  
               throws AccessPoemException, PoemException {
 274  0
             return ((Supplier)g).getContact();
 275  
           }
 276  
 
 277  
           public void setCooked(Persistent g, Object cooked)
 278  
               throws AccessPoemException, ValidationPoemException {
 279  0
             ((Supplier)g).setContact((String)cooked);
 280  0
           }
 281  
 
 282  
           public Field<String> asField(Persistent g) {
 283  0
             return ((Supplier)g).getContactField();
 284  
           }
 285  
 
 286  
           public DisplayLevel defaultDisplayLevel() {
 287  0
             return DisplayLevel.summary;
 288  
           }
 289  
 
 290  
           public Searchability defaultSearchability() {
 291  0
             return Searchability.yes;
 292  
           }
 293  
 
 294  
           public String defaultDisplayName() {
 295  0
             return "Contact Name";
 296  
           }
 297  
 
 298  
           public int defaultDisplayOrder() {
 299  0
             return 3;
 300  
           }
 301  
 
 302  
           public String defaultDescription() {
 303  0
             return "The person who will deal with queries";
 304  
           }
 305  
 
 306  
           public boolean defaultUnique() {
 307  0
             return true;
 308  
           }
 309  
 
 310  
           public int defaultWidth() {
 311  0
             return 20;
 312  
           }
 313  
 
 314  
           public Object getRaw_unsafe(Persistent g)
 315  
               throws AccessPoemException {
 316  0
             return ((Supplier)g).getContact_unsafe();
 317  
           }
 318  
 
 319  
           public void setRaw_unsafe(Persistent g, Object raw)
 320  
               throws AccessPoemException {
 321  0
             ((Supplier)g).setContact_unsafe((String)raw);
 322  0
           }
 323  
 
 324  
           public Object getRaw(Persistent g)
 325  
               throws AccessPoemException {
 326  0
             return ((Supplier)g).getContact();
 327  
           }
 328  
 
 329  
           public void setRaw(Persistent g, Object raw)
 330  
               throws AccessPoemException {
 331  0
             ((Supplier)g).setContact((String)raw);
 332  0
           }
 333  
         });
 334  
 
 335  2
     defineColumn(col_email =
 336  
         new Column<String>(this, "email",
 337  
                    new StringPoemType(false, -1),
 338  2
                    DefinitionSource.dsd) { 
 339  
           public Object getCooked(Persistent g)
 340  
               throws AccessPoemException, PoemException {
 341  0
             return ((Supplier)g).getEmail();
 342  
           }
 343  
 
 344  
           public void setCooked(Persistent g, Object cooked)
 345  
               throws AccessPoemException, ValidationPoemException {
 346  0
             ((Supplier)g).setEmail((String)cooked);
 347  0
           }
 348  
 
 349  
           public Field<String> asField(Persistent g) {
 350  0
             return ((Supplier)g).getEmailField();
 351  
           }
 352  
 
 353  
           public DisplayLevel defaultDisplayLevel() {
 354  0
             return DisplayLevel.record;
 355  
           }
 356  
 
 357  
           public Searchability defaultSearchability() {
 358  0
             return Searchability.no;
 359  
           }
 360  
 
 361  
           public String defaultDisplayName() {
 362  0
             return "email";
 363  
           }
 364  
 
 365  
           public int defaultDisplayOrder() {
 366  0
             return 4;
 367  
           }
 368  
 
 369  
           public String defaultDescription() {
 370  0
             return "An email address used to submit orders to this Supplier";
 371  
           }
 372  
 
 373  
           public int defaultWidth() {
 374  0
             return 40;
 375  
           }
 376  
 
 377  
           public Object getRaw_unsafe(Persistent g)
 378  
               throws AccessPoemException {
 379  0
             return ((Supplier)g).getEmail_unsafe();
 380  
           }
 381  
 
 382  
           public void setRaw_unsafe(Persistent g, Object raw)
 383  
               throws AccessPoemException {
 384  0
             ((Supplier)g).setEmail_unsafe((String)raw);
 385  0
           }
 386  
 
 387  
           public Object getRaw(Persistent g)
 388  
               throws AccessPoemException {
 389  0
             return ((Supplier)g).getEmail();
 390  
           }
 391  
 
 392  
           public void setRaw(Persistent g, Object raw)
 393  
               throws AccessPoemException {
 394  0
             ((Supplier)g).setEmail((String)raw);
 395  0
           }
 396  
         });
 397  
 
 398  2
     defineColumn(col_website =
 399  
         new Column<String>(this, "website",
 400  
                    new StringPoemType(true, -1),
 401  2
                    DefinitionSource.dsd) { 
 402  
           public Object getCooked(Persistent g)
 403  
               throws AccessPoemException, PoemException {
 404  0
             return ((Supplier)g).getWebsite();
 405  
           }
 406  
 
 407  
           public void setCooked(Persistent g, Object cooked)
 408  
               throws AccessPoemException, ValidationPoemException {
 409  0
             ((Supplier)g).setWebsite((String)cooked);
 410  0
           }
 411  
 
 412  
           public Field<String> asField(Persistent g) {
 413  0
             return ((Supplier)g).getWebsiteField();
 414  
           }
 415  
 
 416  
           public DisplayLevel defaultDisplayLevel() {
 417  0
             return DisplayLevel.record;
 418  
           }
 419  
 
 420  
           public Searchability defaultSearchability() {
 421  0
             return Searchability.no;
 422  
           }
 423  
 
 424  
           public String defaultDisplayName() {
 425  0
             return "Website";
 426  
           }
 427  
 
 428  
           public int defaultDisplayOrder() {
 429  0
             return 5;
 430  
           }
 431  
 
 432  
           public String defaultDescription() {
 433  0
             return "The website for this supplier, if they have one";
 434  
           }
 435  
 
 436  
           public int defaultWidth() {
 437  0
             return 40;
 438  
           }
 439  
 
 440  
           public Object getRaw_unsafe(Persistent g)
 441  
               throws AccessPoemException {
 442  0
             return ((Supplier)g).getWebsite_unsafe();
 443  
           }
 444  
 
 445  
           public void setRaw_unsafe(Persistent g, Object raw)
 446  
               throws AccessPoemException {
 447  0
             ((Supplier)g).setWebsite_unsafe((String)raw);
 448  0
           }
 449  
 
 450  
           public Object getRaw(Persistent g)
 451  
               throws AccessPoemException {
 452  0
             return ((Supplier)g).getWebsite();
 453  
           }
 454  
 
 455  
           public void setRaw(Persistent g, Object raw)
 456  
               throws AccessPoemException {
 457  0
             ((Supplier)g).setWebsite((String)raw);
 458  0
           }
 459  
         });
 460  
 
 461  2
     defineColumn(col_location =
 462  
         new Column<String>(this, "location",
 463  
                    new StringPoemType(false, -1),
 464  2
                    DefinitionSource.dsd) { 
 465  
           public Object getCooked(Persistent g)
 466  
               throws AccessPoemException, PoemException {
 467  0
             return ((Supplier)g).getLocation();
 468  
           }
 469  
 
 470  
           public void setCooked(Persistent g, Object cooked)
 471  
               throws AccessPoemException, ValidationPoemException {
 472  0
             ((Supplier)g).setLocation((String)cooked);
 473  0
           }
 474  
 
 475  
           public Field<String> asField(Persistent g) {
 476  0
             return ((Supplier)g).getLocationField();
 477  
           }
 478  
 
 479  
           public DisplayLevel defaultDisplayLevel() {
 480  0
             return DisplayLevel.record;
 481  
           }
 482  
 
 483  
           public Searchability defaultSearchability() {
 484  0
             return Searchability.no;
 485  
           }
 486  
 
 487  
           public int defaultDisplayOrder() {
 488  0
             return 6;
 489  
           }
 490  
 
 491  
           public String defaultDescription() {
 492  0
             return "The Location of this supplier (eg London)";
 493  
           }
 494  
 
 495  
           public int defaultWidth() {
 496  0
             return 40;
 497  
           }
 498  
 
 499  
           public Object getRaw_unsafe(Persistent g)
 500  
               throws AccessPoemException {
 501  0
             return ((Supplier)g).getLocation_unsafe();
 502  
           }
 503  
 
 504  
           public void setRaw_unsafe(Persistent g, Object raw)
 505  
               throws AccessPoemException {
 506  0
             ((Supplier)g).setLocation_unsafe((String)raw);
 507  0
           }
 508  
 
 509  
           public Object getRaw(Persistent g)
 510  
               throws AccessPoemException {
 511  0
             return ((Supplier)g).getLocation();
 512  
           }
 513  
 
 514  
           public void setRaw(Persistent g, Object raw)
 515  
               throws AccessPoemException {
 516  0
             ((Supplier)g).setLocation((String)raw);
 517  0
           }
 518  
         });
 519  2
   }
 520  
 
 521  
 
 522  
  /**
 523  
   * Retrieves the <code>Id</code> <code>Column</code> for this 
 524  
   * <code>Supplier</code> <code>Table</code>.
 525  
   * 
 526  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 527  
   * @return the id <code>Column</code>
 528  
   */
 529  
   public final Column<Integer> getIdColumn() {
 530  0
     return col_id;
 531  
   }
 532  
 
 533  
 
 534  
  /**
 535  
   * Retrieves the <code>Name</code> <code>Column</code> for this 
 536  
   * <code>Supplier</code> <code>Table</code>.
 537  
   * 
 538  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 539  
   * @return the name <code>Column</code>
 540  
   */
 541  
   public final Column<String> getNameColumn() {
 542  0
     return col_name;
 543  
   }
 544  
 
 545  
 
 546  
  /**
 547  
   * Retrieves the <code>Address</code> <code>Column</code> for this 
 548  
   * <code>Supplier</code> <code>Table</code>.
 549  
   * 
 550  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 551  
   * @return the address <code>Column</code>
 552  
   */
 553  
   public final Column<String> getAddressColumn() {
 554  0
     return col_address;
 555  
   }
 556  
 
 557  
 
 558  
  /**
 559  
   * Retrieves the <code>Contact</code> <code>Column</code> for this 
 560  
   * <code>Supplier</code> <code>Table</code>.
 561  
   * 
 562  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 563  
   * @return the contact <code>Column</code>
 564  
   */
 565  
   public final Column<String> getContactColumn() {
 566  0
     return col_contact;
 567  
   }
 568  
 
 569  
 
 570  
  /**
 571  
   * Retrieves the <code>Email</code> <code>Column</code> for this 
 572  
   * <code>Supplier</code> <code>Table</code>.
 573  
   * 
 574  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 575  
   * @return the email <code>Column</code>
 576  
   */
 577  
   public final Column<String> getEmailColumn() {
 578  0
     return col_email;
 579  
   }
 580  
 
 581  
 
 582  
  /**
 583  
   * Retrieves the <code>Website</code> <code>Column</code> for this 
 584  
   * <code>Supplier</code> <code>Table</code>.
 585  
   * 
 586  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 587  
   * @return the website <code>Column</code>
 588  
   */
 589  
   public final Column<String> getWebsiteColumn() {
 590  0
     return col_website;
 591  
   }
 592  
 
 593  
 
 594  
  /**
 595  
   * Retrieves the <code>Location</code> <code>Column</code> for this 
 596  
   * <code>Supplier</code> <code>Table</code>.
 597  
   * 
 598  
   * see org.melati.poem.prepro.FieldDef#generateColAccessor 
 599  
   * @return the location <code>Column</code>
 600  
   */
 601  
   public final Column<String> getLocationColumn() {
 602  0
     return col_location;
 603  
   }
 604  
 
 605  
 
 606  
  /**
 607  
   * Retrieve the <code>Supplier</code> as a <code>Supplier</code>.
 608  
   *
 609  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 610  
   * @param troid a Table Row Oject ID
 611  
   * @return the <code>Persistent</code> identified by the <code>troid</code>
 612  
   */
 613  
   public Supplier getSupplierObject(Integer troid) {
 614  0
     return (Supplier)getObject(troid);
 615  
   }
 616  
 
 617  
 
 618  
  /**
 619  
   * Retrieve the <code>Supplier</code> 
 620  
   * as a <code>Supplier</code>.
 621  
   *
 622  
   * see org.melati.poem.prepro.TableDef#generateTableBaseJava 
 623  
   * @param troid a Table Row Object ID
 624  
   * @return the <code>Persistent</code> identified   */
 625  
   public Supplier getSupplierObject(int troid) {
 626  0
     return (Supplier)getObject(troid);
 627  
   }
 628  
 
 629  
   protected JdbcPersistent _newPersistent() {
 630  0
     return new Supplier();
 631  
   }
 632  
   public String defaultDisplayName() {
 633  0
     return "Supplier";
 634  
   }
 635  
 
 636  
   public String defaultDescription() {
 637  0
     return "Product Supplier";
 638  
   }
 639  
 
 640  
   public boolean defaultRememberAllTroids() {
 641  0
     return true;
 642  
   }
 643  
 
 644  
   public String defaultCategory() {
 645  0
     return "Shop";
 646  
   }
 647  
 
 648  
   public int defaultDisplayOrder() {
 649  0
     return 1210;
 650  
   }
 651  
 }
 652