Coverage Report - org.melati.poem.generated.GroupCapabilityBase
 
Classes in this File Line Coverage Branch Coverage Complexity
GroupCapabilityBase
61%
38/62
33%
4/12
1.261
 
 1  
 // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
 2  
 
 3  
 package org.melati.poem.generated;
 4  
 
 5  
 
 6  
 import org.melati.poem.AccessPoemException;
 7  
 import org.melati.poem.Capability;
 8  
 import org.melati.poem.Column;
 9  
 import org.melati.poem.Field;
 10  
 import org.melati.poem.Group;
 11  
 import org.melati.poem.GroupCapability;
 12  
 import org.melati.poem.GroupCapabilityTable;
 13  
 import org.melati.poem.JdbcPersistent;
 14  
 import org.melati.poem.NoSuchRowPoemException;
 15  
 import org.melati.poem.PoemDatabaseTables;
 16  
 import org.melati.poem.ValidationPoemException;
 17  
 
 18  
 
 19  
 /**
 20  
  * Melati POEM generated abstract base class for a <code>Persistent</code> 
 21  
  * <code>groupCapability</code> Object.
 22  
  *
 23  
  * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 24  
  */
 25  48
 public abstract class GroupCapabilityBase extends JdbcPersistent {
 26  
 
 27  
 
 28  
  /**
 29  
   * Retrieves the Database object.
 30  
   * 
 31  
   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 32  
   * @return the database
 33  
   */
 34  
   public PoemDatabaseTables getPoemDatabaseTables() {
 35  4
     return (PoemDatabaseTables)getDatabase();
 36  
   }
 37  
 
 38  
 
 39  
  /**
 40  
   * Retrieves the  <code>GroupCapabilityTable</code> table 
 41  
   * which this <code>Persistent</code> is from.
 42  
   * 
 43  
   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 44  
   * @return the GroupCapabilityTable
 45  
   */
 46  
   @SuppressWarnings("unchecked")
 47  
   public GroupCapabilityTable<GroupCapability> getGroupCapabilityTable() {
 48  0
     return (GroupCapabilityTable<GroupCapability>)getTable();
 49  
   }
 50  
 
 51  
   @SuppressWarnings("unchecked")
 52  
   private GroupCapabilityTable<GroupCapability> _getGroupCapabilityTable() {
 53  90
     return (GroupCapabilityTable<GroupCapability>)getTable();
 54  
   }
 55  
 
 56  
   // Fields in this table 
 57  
  /**
 58  
   * id - The Table Row Object ID 
 59  
   */
 60  
   protected Integer id;
 61  
  /**
 62  
   * group - The Group which has the capability 
 63  
   */
 64  
   protected Integer group;
 65  
  /**
 66  
   * capability - The capability 
 67  
   */
 68  
   protected Integer capability;
 69  
 
 70  
 
 71  
  /**
 72  
   * Retrieves the <code>Id</code> value, without locking, 
 73  
   * for this <code>groupCapability</code> <code>Persistent</code>.
 74  
   *
 75  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 76  
   * @return the Integer id
 77  
   */
 78  
   public Integer getId_unsafe() {
 79  93
     return id;
 80  
   }
 81  
 
 82  
 
 83  
  /**
 84  
   * Sets the <code>Id</code> value directly, without checking, 
 85  
   * for this groupCapability <code>Persistent</code>.
 86  
   * 
 87  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 88  
   * @param cooked  the pre-validated value to set
 89  
   */
 90  
   public void setId_unsafe(Integer cooked) {
 91  49
     id = cooked;
 92  49
   }
 93  
 
 94  
  /**
 95  
   * Retrieves the Id value, with locking, for this 
 96  
   * <code>groupCapability</code> <code>Persistent</code>.
 97  
   * Field description: 
 98  
   *   The Table Row Object ID 
 99  
   * 
 100  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 101  
   * @throws AccessPoemException 
 102  
   *         if the current <code>AccessToken</code> 
 103  
   *         does not confer write access rights 
 104  
   * @return the value of the field <code>Id</code> for this 
 105  
   *         <code>groupCapability</code> <code>Persistent</code>  
 106  
   */
 107  
 
 108  
   public Integer getId()
 109  
       throws AccessPoemException {
 110  0
     readLock();
 111  0
     return getId_unsafe();
 112  
   }
 113  
 
 114  
 
 115  
  /**
 116  
   * Sets the <code>Id</code> value, with checking, for this 
 117  
   * <code>groupCapability</code> <code>Persistent</code>.
 118  
   * Field description: 
 119  
   *   The Table Row Object ID 
 120  
   * 
 121  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 122  
   * @param cooked  a validated <code>int</code> 
 123  
   * @throws AccessPoemException 
 124  
   *         if the current <code>AccessToken</code> 
 125  
   *         does not confer write access rights
 126  
   * @throws ValidationPoemException 
 127  
   *         if the value is not valid
 128  
   */
 129  
   public void setId(Integer cooked)
 130  
       throws AccessPoemException, ValidationPoemException {
 131  0
     _getGroupCapabilityTable().getIdColumn().
 132  0
       getType().assertValidCooked(cooked);
 133  0
     writeLock();
 134  0
     setId_unsafe(cooked);
 135  0
   }
 136  
 
 137  
  /**
 138  
   * Sets the <code>Id</code> value, with checking, for this 
 139  
   * <code>groupCapability</code> <code>Persistent</code>.
 140  
   * Field description: 
 141  
   *   The Table Row Object ID 
 142  
   * 
 143  
   * 
 144  
   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
 145  
   * @param cooked  a validated <code>int</code>
 146  
   * @throws AccessPoemException 
 147  
   *         if the current <code>AccessToken</code> 
 148  
   *         does not confer write access rights
 149  
   * @throws ValidationPoemException 
 150  
   *         if the value is not valid
 151  
   */
 152  
 
 153  
   public final void setId(int cooked)
 154  
       throws AccessPoemException, ValidationPoemException {
 155  0
     setId(new Integer(cooked));
 156  0
   }
 157  
 
 158  
 
 159  
  /**
 160  
   * Retrieves the <code>Id</code> value as a <code>Field</code>
 161  
   * from this <code>groupCapability</code> <code>Persistent</code>.
 162  
   * 
 163  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 164  
   * @throws AccessPoemException 
 165  
   *         if the current <code>AccessToken</code> 
 166  
   *         does not confer write access rights
 167  
   * @return the Integer id
 168  
   */
 169  
   public Field<Integer> getIdField() throws AccessPoemException {
 170  0
     Column<Integer> c = _getGroupCapabilityTable().getIdColumn();
 171  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 172  
   }
 173  
 
 174  
 
 175  
  /**
 176  
   * Retrieves the <code>Group</code> value, without locking, 
 177  
   * for this <code>groupCapability</code> <code>Persistent</code>.
 178  
   *
 179  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 180  
   * @return the Integer group
 181  
   */
 182  
   public Integer getGroup_unsafe() {
 183  95
     return group;
 184  
   }
 185  
 
 186  
 
 187  
  /**
 188  
   * Sets the <code>Group</code> value directly, without checking, 
 189  
   * for this groupCapability <code>Persistent</code>.
 190  
   * 
 191  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 192  
   * @param cooked  the pre-validated value to set
 193  
   */
 194  
   public void setGroup_unsafe(Integer cooked) {
 195  46
     group = cooked;
 196  46
   }
 197  
 
 198  
  /**
 199  
   * Retrieves the Table Row Object ID. 
 200  
   *
 201  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 202  
   * @throws AccessPoemException  
 203  
   *         if the current <code>AccessToken</code> 
 204  
   *         does not confer read access rights 
 205  
   * @return the TROID as an <code>Integer</code> 
 206  
   */
 207  
 
 208  
   public Integer getGroupTroid()
 209  
       throws AccessPoemException {
 210  2
     readLock();
 211  2
     return getGroup_unsafe();
 212  
   }
 213  
 
 214  
 
 215  
  /**
 216  
   * Sets the Table Row Object ID. 
 217  
   * 
 218  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 219  
   * @param raw  a Table Row Object Id 
 220  
   * @throws AccessPoemException  
 221  
   *         if the current <code>AccessToken</code> 
 222  
   *         does not confer write access rights
 223  
   */
 224  
   public void setGroupTroid(Integer raw)
 225  
       throws AccessPoemException {
 226  0
     setGroup(raw == null ? null : 
 227  0
         getPoemDatabaseTables().getGroupTable().getGroupObject(raw));
 228  0
   }
 229  
 
 230  
 
 231  
  /**
 232  
   * Retrieves the <code>Group</code> object referred to.
 233  
   *  
 234  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 235  
   * @throws AccessPoemException  
 236  
   *         if the current <code>AccessToken</code> 
 237  
   *         does not confer read access rights 
 238  
   * @throws NoSuchRowPoemException  
 239  
   *         if the <code>Persistent</code> has yet to be allocated a TROID 
 240  
   * @return the <code>Group</code> as a <code>Group</code> 
 241  
   */
 242  
   public Group getGroup()
 243  
       throws AccessPoemException, NoSuchRowPoemException {
 244  2
     Integer troid = getGroupTroid();
 245  2
     return troid == null ? null :
 246  2
         getPoemDatabaseTables().getGroupTable().getGroupObject(troid);
 247  
   }
 248  
 
 249  
 
 250  
  /**
 251  
   * Set the Group.
 252  
   * 
 253  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 254  
   * @param cooked  a validated <code>Group</code>
 255  
   * @throws AccessPoemException  
 256  
   *         if the current <code>AccessToken</code> 
 257  
   *         does not confer write access rights 
 258  
   */
 259  
   public void setGroup(Group cooked)
 260  
       throws AccessPoemException {
 261  45
     _getGroupCapabilityTable().
 262  45
       getGroupColumn().
 263  45
         getType().assertValidCooked(cooked);
 264  45
     writeLock();
 265  45
     if (cooked == null)
 266  0
       setGroup_unsafe(null);
 267  
     else {
 268  45
       cooked.existenceLock();
 269  45
       setGroup_unsafe(cooked.troid());
 270  
     }
 271  45
   }
 272  
 
 273  
 
 274  
  /**
 275  
   * Retrieves the <code>Group</code> value as a <code>Field</code>
 276  
   * from this <code>groupCapability</code> <code>Persistent</code>.
 277  
   * 
 278  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 279  
   * @throws AccessPoemException 
 280  
   *         if the current <code>AccessToken</code> 
 281  
   *         does not confer write access rights
 282  
   * @return the Integer group
 283  
   */
 284  
   public Field<Integer> getGroupField() throws AccessPoemException {
 285  0
     Column<Integer> c = _getGroupCapabilityTable().getGroupColumn();
 286  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 287  
   }
 288  
 
 289  
 
 290  
  /**
 291  
   * Retrieves the <code>Capability</code> value, without locking, 
 292  
   * for this <code>groupCapability</code> <code>Persistent</code>.
 293  
   *
 294  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 295  
   * @return the Integer capability
 296  
   */
 297  
   public Integer getCapability_unsafe() {
 298  95
     return capability;
 299  
   }
 300  
 
 301  
 
 302  
  /**
 303  
   * Sets the <code>Capability</code> value directly, without checking, 
 304  
   * for this groupCapability <code>Persistent</code>.
 305  
   * 
 306  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 307  
   * @param cooked  the pre-validated value to set
 308  
   */
 309  
   public void setCapability_unsafe(Integer cooked) {
 310  46
     capability = cooked;
 311  46
   }
 312  
 
 313  
  /**
 314  
   * Retrieves the Table Row Object ID. 
 315  
   *
 316  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 317  
   * @throws AccessPoemException  
 318  
   *         if the current <code>AccessToken</code> 
 319  
   *         does not confer read access rights 
 320  
   * @return the TROID as an <code>Integer</code> 
 321  
   */
 322  
 
 323  
   public Integer getCapabilityTroid()
 324  
       throws AccessPoemException {
 325  2
     readLock();
 326  2
     return getCapability_unsafe();
 327  
   }
 328  
 
 329  
 
 330  
  /**
 331  
   * Sets the Table Row Object ID. 
 332  
   * 
 333  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 334  
   * @param raw  a Table Row Object Id 
 335  
   * @throws AccessPoemException  
 336  
   *         if the current <code>AccessToken</code> 
 337  
   *         does not confer write access rights
 338  
   */
 339  
   public void setCapabilityTroid(Integer raw)
 340  
       throws AccessPoemException {
 341  0
     setCapability(raw == null ? null : 
 342  0
         getPoemDatabaseTables().getCapabilityTable().getCapabilityObject(raw));
 343  0
   }
 344  
 
 345  
 
 346  
  /**
 347  
   * Retrieves the <code>Capability</code> object referred to.
 348  
   *  
 349  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 350  
   * @throws AccessPoemException  
 351  
   *         if the current <code>AccessToken</code> 
 352  
   *         does not confer read access rights 
 353  
   * @throws NoSuchRowPoemException  
 354  
   *         if the <code>Persistent</code> has yet to be allocated a TROID 
 355  
   * @return the <code>Capability</code> as a <code>Capability</code> 
 356  
   */
 357  
   public Capability getCapability()
 358  
       throws AccessPoemException, NoSuchRowPoemException {
 359  2
     Integer troid = getCapabilityTroid();
 360  2
     return troid == null ? null :
 361  2
         getPoemDatabaseTables().getCapabilityTable().getCapabilityObject(troid);
 362  
   }
 363  
 
 364  
 
 365  
  /**
 366  
   * Set the Capability.
 367  
   * 
 368  
   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
 369  
   * @param cooked  a validated <code>Capability</code>
 370  
   * @throws AccessPoemException  
 371  
   *         if the current <code>AccessToken</code> 
 372  
   *         does not confer write access rights 
 373  
   */
 374  
   public void setCapability(Capability cooked)
 375  
       throws AccessPoemException {
 376  45
     _getGroupCapabilityTable().
 377  45
       getCapabilityColumn().
 378  45
         getType().assertValidCooked(cooked);
 379  45
     writeLock();
 380  45
     if (cooked == null)
 381  0
       setCapability_unsafe(null);
 382  
     else {
 383  45
       cooked.existenceLock();
 384  45
       setCapability_unsafe(cooked.troid());
 385  
     }
 386  45
   }
 387  
 
 388  
 
 389  
  /**
 390  
   * Retrieves the <code>Capability</code> value as a <code>Field</code>
 391  
   * from this <code>groupCapability</code> <code>Persistent</code>.
 392  
   * 
 393  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 394  
   * @throws AccessPoemException 
 395  
   *         if the current <code>AccessToken</code> 
 396  
   *         does not confer write access rights
 397  
   * @return the Integer capability
 398  
   */
 399  
   public Field<Integer> getCapabilityField() throws AccessPoemException {
 400  0
     Column<Integer> c = _getGroupCapabilityTable().getCapabilityColumn();
 401  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 402  
   }
 403  
 
 404  
 }
 405