Coverage Report - org.paneris.bibliomania.generated.ProductAssociationBase
 
Classes in this File Line Coverage Branch Coverage Complexity
ProductAssociationBase
0%
0/71
0%
0/18
1.3
 
 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.Field;
 9  
 import org.melati.poem.JdbcPersistent;
 10  
 import org.melati.poem.NoSuchRowPoemException;
 11  
 import org.melati.poem.ValidationPoemException;
 12  
 import org.paneris.bibliomania.Author;
 13  
 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
 14  
 import org.paneris.bibliomania.Book;
 15  
 import org.paneris.bibliomania.Product;
 16  
 import org.paneris.bibliomania.ProductAssociation;
 17  
 import org.paneris.bibliomania.ProductAssociationTable;
 18  
 
 19  
 
 20  
 /**
 21  
  * Melati POEM generated abstract base class for a <code>Persistent</code> 
 22  
  * <code>ProductAssociation</code> Object.
 23  
  *
 24  
  * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 25  
  */
 26  0
 public abstract class ProductAssociationBase extends JdbcPersistent {
 27  
 
 28  
 
 29  
  /**
 30  
   * Retrieves the Database object.
 31  
   * 
 32  
   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 33  
   * @return the database
 34  
   */
 35  
   public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
 36  0
     return (BibliomaniaDatabaseTables)getDatabase();
 37  
   }
 38  
 
 39  
 
 40  
  /**
 41  
   * Retrieves the  <code>ProductAssociationTable</code> table 
 42  
   * which this <code>Persistent</code> is from.
 43  
   * 
 44  
   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 45  
   * @return the ProductAssociationTable
 46  
   */
 47  
   @SuppressWarnings("unchecked")
 48  
   public ProductAssociationTable<ProductAssociation> getProductAssociationTable() {
 49  0
     return (ProductAssociationTable<ProductAssociation>)getTable();
 50  
   }
 51  
 
 52  
   @SuppressWarnings("unchecked")
 53  
   private ProductAssociationTable<ProductAssociation> _getProductAssociationTable() {
 54  0
     return (ProductAssociationTable<ProductAssociation>)getTable();
 55  
   }
 56  
 
 57  
   // Fields in this table 
 58  
  /**
 59  
   * id 
 60  
   */
 61  
   protected Integer id;
 62  
  /**
 63  
   * product - The related shop item 
 64  
   */
 65  
   protected Integer product;
 66  
  /**
 67  
   * book - The book this product is related to 
 68  
   */
 69  
   protected Integer book;
 70  
  /**
 71  
   * author - The author this product is related to 
 72  
   */
 73  
   protected Integer author;
 74  
 
 75  
 
 76  
  /**
 77  
   * Retrieves the <code>Id</code> value, without locking, 
 78  
   * for this <code>ProductAssociation</code> <code>Persistent</code>.
 79  
   *
 80  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 81  
   * @return the Integer id
 82  
   */
 83  
   public Integer getId_unsafe() {
 84  0
     return id;
 85  
   }
 86  
 
 87  
 
 88  
  /**
 89  
   * Sets the <code>Id</code> value directly, without checking, 
 90  
   * for this ProductAssociation <code>Persistent</code>.
 91  
   * 
 92  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 93  
   * @param cooked  the pre-validated value to set
 94  
   */
 95  
   public void setId_unsafe(Integer cooked) {
 96  0
     id = cooked;
 97  0
   }
 98  
 
 99  
  /**
 100  
   * Retrieves the Id value, with locking, for this 
 101  
   * <code>ProductAssociation</code> <code>Persistent</code>.
 102  
   * 
 103  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 104  
   * @throws AccessPoemException 
 105  
   *         if the current <code>AccessToken</code> 
 106  
   *         does not confer write access rights 
 107  
   * @return the value of the field <code>Id</code> for this 
 108  
   *         <code>ProductAssociation</code> <code>Persistent</code>  
 109  
   */
 110  
 
 111  
   public Integer getId()
 112  
       throws AccessPoemException {
 113  0
     readLock();
 114  0
     return getId_unsafe();
 115  
   }
 116  
 
 117  
 
 118  
  /**
 119  
   * Sets the <code>Id</code> value, with checking, for this 
 120  
   * <code>ProductAssociation</code> <code>Persistent</code>.
 121  
   * 
 122  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 123  
   * @param cooked  a validated <code>int</code> 
 124  
   * @throws AccessPoemException 
 125  
   *         if the current <code>AccessToken</code> 
 126  
   *         does not confer write access rights
 127  
   * @throws ValidationPoemException 
 128  
   *         if the value is not valid
 129  
   */
 130  
   public void setId(Integer cooked)
 131  
       throws AccessPoemException, ValidationPoemException {
 132  0
     _getProductAssociationTable().getIdColumn().
 133  
       getType().assertValidCooked(cooked);
 134  0
     writeLock();
 135  0
     setId_unsafe(cooked);
 136  0
   }
 137  
 
 138  
  /**
 139  
   * Sets the <code>Id</code> value, with checking, for this 
 140  
   * <code>ProductAssociation</code> <code>Persistent</code>.
 141  
   * 
 142  
   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
 143  
   * @param cooked  a validated <code>int</code>
 144  
   * @throws AccessPoemException 
 145  
   *         if the current <code>AccessToken</code> 
 146  
   *         does not confer write access rights
 147  
   * @throws ValidationPoemException 
 148  
   *         if the value is not valid
 149  
   */
 150  
 
 151  
   public final void setId(int cooked)
 152  
       throws AccessPoemException, ValidationPoemException {
 153  0
     setId(new Integer(cooked));
 154  0
   }
 155  
 
 156  
 
 157  
  /**
 158  
   * Retrieves the <code>Id</code> value as a <code>Field</code>
 159  
   * from this <code>ProductAssociation</code> <code>Persistent</code>.
 160  
   * 
 161  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 162  
   * @throws AccessPoemException 
 163  
   *         if the current <code>AccessToken</code> 
 164  
   *         does not confer write access rights
 165  
   * @return the Integer id
 166  
   */
 167  
   public Field<Integer> getIdField() throws AccessPoemException {
 168  0
     Column<Integer> c = _getProductAssociationTable().getIdColumn();
 169  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 170  
   }
 171  
 
 172  
 
 173  
  /**
 174  
   * Retrieves the <code>Product</code> value, without locking, 
 175  
   * for this <code>ProductAssociation</code> <code>Persistent</code>.
 176  
   *
 177  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 178  
   * @return the Integer product
 179  
   */
 180  
   public Integer getProduct_unsafe() {
 181  0
     return product;
 182  
   }
 183  
 
 184  
 
 185  
  /**
 186  
   * Sets the <code>Product</code> value directly, without checking, 
 187  
   * for this ProductAssociation <code>Persistent</code>.
 188  
   * 
 189  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 190  
   * @param cooked  the pre-validated value to set
 191  
   */
 192  
   public void setProduct_unsafe(Integer cooked) {
 193  0
     product = cooked;
 194  0
   }
 195  
 
 196  
  /**
 197  
   * Retrieves the Table Row Object ID. 
 198  
   *
 199  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 200  
   * @throws AccessPoemException  
 201  
   *         if the current <code>AccessToken</code> 
 202  
   *         does not confer read access rights 
 203  
   * @return the TROID as an <code>Integer</code> 
 204  
   */
 205  
 
 206  
   public Integer getProductTroid()
 207  
       throws AccessPoemException {
 208  0
     readLock();
 209  0
     return getProduct_unsafe();
 210  
   }
 211  
 
 212  
 
 213  
  /**
 214  
   * Sets the Table Row Object ID. 
 215  
   * 
 216  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 217  
   * @param raw  a Table Row Object Id 
 218  
   * @throws AccessPoemException  
 219  
   *         if the current <code>AccessToken</code> 
 220  
   *         does not confer write access rights
 221  
   */
 222  
   public void setProductTroid(Integer raw)
 223  
       throws AccessPoemException {
 224  0
     setProduct(raw == null ? null : 
 225  
         getBibliomaniaDatabaseTables().getProductTable().getProductObject(raw));
 226  0
   }
 227  
 
 228  
 
 229  
  /**
 230  
   * Retrieves the <code>Product</code> object referred to.
 231  
   *  
 232  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 233  
   * @throws AccessPoemException  
 234  
   *         if the current <code>AccessToken</code> 
 235  
   *         does not confer read access rights 
 236  
   * @throws NoSuchRowPoemException  
 237  
   *         if the <code>Persistent</code> has yet to be allocated a TROID 
 238  
   * @return the <code>Product</code> as a <code>Product</code> 
 239  
   */
 240  
   public Product getProduct()
 241  
       throws AccessPoemException, NoSuchRowPoemException {
 242  0
     Integer troid = getProductTroid();
 243  0
     return troid == null ? null :
 244  
         getBibliomaniaDatabaseTables().getProductTable().getProductObject(troid);
 245  
   }
 246  
 
 247  
 
 248  
  /**
 249  
   * Set the Product.
 250  
   * 
 251  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 252  
   * @param cooked  a validated <code>Product</code>
 253  
   * @throws AccessPoemException  
 254  
   *         if the current <code>AccessToken</code> 
 255  
   *         does not confer write access rights 
 256  
   */
 257  
   public void setProduct(Product cooked)
 258  
       throws AccessPoemException {
 259  0
     _getProductAssociationTable().
 260  
       getProductColumn().
 261  
         getType().assertValidCooked(cooked);
 262  0
     writeLock();
 263  0
     if (cooked == null)
 264  0
       setProduct_unsafe(null);
 265  
     else {
 266  0
       cooked.existenceLock();
 267  0
       setProduct_unsafe(cooked.troid());
 268  
     }
 269  0
   }
 270  
 
 271  
 
 272  
  /**
 273  
   * Retrieves the <code>Product</code> value as a <code>Field</code>
 274  
   * from this <code>ProductAssociation</code> <code>Persistent</code>.
 275  
   * 
 276  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 277  
   * @throws AccessPoemException 
 278  
   *         if the current <code>AccessToken</code> 
 279  
   *         does not confer write access rights
 280  
   * @return the Integer product
 281  
   */
 282  
   public Field<Integer> getProductField() throws AccessPoemException {
 283  0
     Column<Integer> c = _getProductAssociationTable().getProductColumn();
 284  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 285  
   }
 286  
 
 287  
 
 288  
  /**
 289  
   * Retrieves the <code>Book</code> value, without locking, 
 290  
   * for this <code>ProductAssociation</code> <code>Persistent</code>.
 291  
   *
 292  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 293  
   * @return the Integer book
 294  
   */
 295  
   public Integer getBook_unsafe() {
 296  0
     return book;
 297  
   }
 298  
 
 299  
 
 300  
  /**
 301  
   * Sets the <code>Book</code> value directly, without checking, 
 302  
   * for this ProductAssociation <code>Persistent</code>.
 303  
   * 
 304  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 305  
   * @param cooked  the pre-validated value to set
 306  
   */
 307  
   public void setBook_unsafe(Integer cooked) {
 308  0
     book = cooked;
 309  0
   }
 310  
 
 311  
  /**
 312  
   * Retrieves the Table Row Object ID. 
 313  
   *
 314  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 315  
   * @throws AccessPoemException  
 316  
   *         if the current <code>AccessToken</code> 
 317  
   *         does not confer read access rights 
 318  
   * @return the TROID as an <code>Integer</code> 
 319  
   */
 320  
 
 321  
   public Integer getBookTroid()
 322  
       throws AccessPoemException {
 323  0
     readLock();
 324  0
     return getBook_unsafe();
 325  
   }
 326  
 
 327  
 
 328  
  /**
 329  
   * Sets the Table Row Object ID. 
 330  
   * 
 331  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 332  
   * @param raw  a Table Row Object Id 
 333  
   * @throws AccessPoemException  
 334  
   *         if the current <code>AccessToken</code> 
 335  
   *         does not confer write access rights
 336  
   */
 337  
   public void setBookTroid(Integer raw)
 338  
       throws AccessPoemException {
 339  0
     setBook(raw == null ? null : 
 340  
         (Book)getBibliomaniaDatabaseTables().getBookTable().getBookObject(raw));
 341  0
   }
 342  
 
 343  
 
 344  
  /**
 345  
   * Retrieves the <code>Book</code> object referred to.
 346  
   *  
 347  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 348  
   * @throws AccessPoemException  
 349  
   *         if the current <code>AccessToken</code> 
 350  
   *         does not confer read access rights 
 351  
   * @throws NoSuchRowPoemException  
 352  
   *         if the <code>Persistent</code> has yet to be allocated a TROID 
 353  
   * @return the <code>Book</code> as a <code>Book</code> 
 354  
   */
 355  
   public Book getBook()
 356  
       throws AccessPoemException, NoSuchRowPoemException {
 357  0
     Integer troid = getBookTroid();
 358  0
     return troid == null ? null :
 359  
         (Book)getBibliomaniaDatabaseTables().getBookTable().getBookObject(troid);
 360  
   }
 361  
 
 362  
 
 363  
  /**
 364  
   * Set the Book.
 365  
   * 
 366  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 367  
   * @param cooked  a validated <code>Book</code>
 368  
   * @throws AccessPoemException  
 369  
   *         if the current <code>AccessToken</code> 
 370  
   *         does not confer write access rights 
 371  
   */
 372  
   public void setBook(Book cooked)
 373  
       throws AccessPoemException {
 374  0
     _getProductAssociationTable().
 375  
       getBookColumn().
 376  
         getType().assertValidCooked(cooked);
 377  0
     writeLock();
 378  0
     if (cooked == null)
 379  0
       setBook_unsafe(null);
 380  
     else {
 381  0
       cooked.existenceLock();
 382  0
       setBook_unsafe(cooked.troid());
 383  
     }
 384  0
   }
 385  
 
 386  
 
 387  
  /**
 388  
   * Retrieves the <code>Book</code> value as a <code>Field</code>
 389  
   * from this <code>ProductAssociation</code> <code>Persistent</code>.
 390  
   * 
 391  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 392  
   * @throws AccessPoemException 
 393  
   *         if the current <code>AccessToken</code> 
 394  
   *         does not confer write access rights
 395  
   * @return the Integer book
 396  
   */
 397  
   public Field<Integer> getBookField() throws AccessPoemException {
 398  0
     Column<Integer> c = _getProductAssociationTable().getBookColumn();
 399  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 400  
   }
 401  
 
 402  
 
 403  
  /**
 404  
   * Retrieves the <code>Author</code> value, without locking, 
 405  
   * for this <code>ProductAssociation</code> <code>Persistent</code>.
 406  
   *
 407  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 408  
   * @return the Integer author
 409  
   */
 410  
   public Integer getAuthor_unsafe() {
 411  0
     return author;
 412  
   }
 413  
 
 414  
 
 415  
  /**
 416  
   * Sets the <code>Author</code> value directly, without checking, 
 417  
   * for this ProductAssociation <code>Persistent</code>.
 418  
   * 
 419  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 420  
   * @param cooked  the pre-validated value to set
 421  
   */
 422  
   public void setAuthor_unsafe(Integer cooked) {
 423  0
     author = cooked;
 424  0
   }
 425  
 
 426  
  /**
 427  
   * Retrieves the Table Row Object ID. 
 428  
   *
 429  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 430  
   * @throws AccessPoemException  
 431  
   *         if the current <code>AccessToken</code> 
 432  
   *         does not confer read access rights 
 433  
   * @return the TROID as an <code>Integer</code> 
 434  
   */
 435  
 
 436  
   public Integer getAuthorTroid()
 437  
       throws AccessPoemException {
 438  0
     readLock();
 439  0
     return getAuthor_unsafe();
 440  
   }
 441  
 
 442  
 
 443  
  /**
 444  
   * Sets the Table Row Object ID. 
 445  
   * 
 446  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 447  
   * @param raw  a Table Row Object Id 
 448  
   * @throws AccessPoemException  
 449  
   *         if the current <code>AccessToken</code> 
 450  
   *         does not confer write access rights
 451  
   */
 452  
   public void setAuthorTroid(Integer raw)
 453  
       throws AccessPoemException {
 454  0
     setAuthor(raw == null ? null : 
 455  
         (Author)getBibliomaniaDatabaseTables().getAuthorTable().getAuthorObject(raw));
 456  0
   }
 457  
 
 458  
 
 459  
  /**
 460  
   * Retrieves the <code>Author</code> object referred to.
 461  
   *  
 462  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 463  
   * @throws AccessPoemException  
 464  
   *         if the current <code>AccessToken</code> 
 465  
   *         does not confer read access rights 
 466  
   * @throws NoSuchRowPoemException  
 467  
   *         if the <code>Persistent</code> has yet to be allocated a TROID 
 468  
   * @return the <code>Author</code> as a <code>Author</code> 
 469  
   */
 470  
   public Author getAuthor()
 471  
       throws AccessPoemException, NoSuchRowPoemException {
 472  0
     Integer troid = getAuthorTroid();
 473  0
     return troid == null ? null :
 474  
         (Author)getBibliomaniaDatabaseTables().getAuthorTable().getAuthorObject(troid);
 475  
   }
 476  
 
 477  
 
 478  
  /**
 479  
   * Set the Author.
 480  
   * 
 481  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 482  
   * @param cooked  a validated <code>Author</code>
 483  
   * @throws AccessPoemException  
 484  
   *         if the current <code>AccessToken</code> 
 485  
   *         does not confer write access rights 
 486  
   */
 487  
   public void setAuthor(Author cooked)
 488  
       throws AccessPoemException {
 489  0
     _getProductAssociationTable().
 490  
       getAuthorColumn().
 491  
         getType().assertValidCooked(cooked);
 492  0
     writeLock();
 493  0
     if (cooked == null)
 494  0
       setAuthor_unsafe(null);
 495  
     else {
 496  0
       cooked.existenceLock();
 497  0
       setAuthor_unsafe(cooked.troid());
 498  
     }
 499  0
   }
 500  
 
 501  
 
 502  
  /**
 503  
   * Retrieves the <code>Author</code> value as a <code>Field</code>
 504  
   * from this <code>ProductAssociation</code> <code>Persistent</code>.
 505  
   * 
 506  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 507  
   * @throws AccessPoemException 
 508  
   *         if the current <code>AccessToken</code> 
 509  
   *         does not confer write access rights
 510  
   * @return the Integer author
 511  
   */
 512  
   public Field<Integer> getAuthorField() throws AccessPoemException {
 513  0
     Column<Integer> c = _getProductAssociationTable().getAuthorColumn();
 514  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 515  
   }
 516  
 
 517  
 }
 518