Coverage Report - org.melati.poem.generated.CapabilityBase
 
Classes in this File Line Coverage Branch Coverage Complexity
CapabilityBase
31%
22/70
0%
0/20
1.625
 
 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 java.util.Collections;
 7  
 import java.util.Enumeration;
 8  
 import java.util.List;
 9  
 import org.melati.poem.AccessPoemException;
 10  
 import org.melati.poem.CachedSelection;
 11  
 import org.melati.poem.Capability;
 12  
 import org.melati.poem.CapabilityTable;
 13  
 import org.melati.poem.Column;
 14  
 import org.melati.poem.Field;
 15  
 import org.melati.poem.GroupCapability;
 16  
 import org.melati.poem.JdbcPersistent;
 17  
 import org.melati.poem.PoemDatabaseTables;
 18  
 import org.melati.poem.TableInfo;
 19  
 import org.melati.poem.ValidationPoemException;
 20  
 import org.melati.poem.util.EmptyEnumeration;
 21  
 
 22  
 
 23  
 /**
 24  
  * Melati POEM generated abstract base class for a <code>Persistent</code> 
 25  
  * <code>capability</code> Object.
 26  
  *
 27  
  * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 28  
  */
 29  221
 public abstract class CapabilityBase 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 PoemDatabaseTables getPoemDatabaseTables() {
 39  0
     return (PoemDatabaseTables)getDatabase();
 40  
   }
 41  
 
 42  
 
 43  
  /**
 44  
   * Retrieves the  <code>CapabilityTable</code> table 
 45  
   * which this <code>Persistent</code> is from.
 46  
   * 
 47  
   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 48  
   * @return the CapabilityTable
 49  
   */
 50  
   @SuppressWarnings("unchecked")
 51  
   public CapabilityTable<Capability> getCapabilityTable() {
 52  0
     return (CapabilityTable<Capability>)getTable();
 53  
   }
 54  
 
 55  
   @SuppressWarnings("unchecked")
 56  
   private CapabilityTable<Capability> _getCapabilityTable() {
 57  115
     return (CapabilityTable<Capability>)getTable();
 58  
   }
 59  
 
 60  
   // Fields in this table 
 61  
  /**
 62  
   * id - The Table Row Object ID 
 63  
   */
 64  
   protected Integer id;
 65  
  /**
 66  
   * name - A human-readable name for the Capability 
 67  
   */
 68  
   protected String name;
 69  
 
 70  
 
 71  
  /**
 72  
   * Retrieves the <code>Id</code> value, without locking, 
 73  
   * for this <code>capability</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  239
     return id;
 80  
   }
 81  
 
 82  
 
 83  
  /**
 84  
   * Sets the <code>Id</code> value directly, without checking, 
 85  
   * for this capability <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  555
     id = cooked;
 92  555
   }
 93  
 
 94  
  /**
 95  
   * Retrieves the Id value, with locking, for this 
 96  
   * <code>capability</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>capability</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>capability</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
     _getCapabilityTable().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>capability</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>capability</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 = _getCapabilityTable().getIdColumn();
 171  0
     return new Field<Integer>((Integer)c.getRaw(this), c);
 172  
   }
 173  
 
 174  
 
 175  
  /**
 176  
   * Retrieves the <code>Name</code> value, without locking, 
 177  
   * for this <code>capability</code> <code>Persistent</code>.
 178  
   *
 179  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 180  
   * @return the String name
 181  
   */
 182  
   public String getName_unsafe() {
 183  413
     return name;
 184  
   }
 185  
 
 186  
 
 187  
  /**
 188  
   * Sets the <code>Name</code> value directly, without checking, 
 189  
   * for this capability <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 setName_unsafe(String cooked) {
 195  325
     name = cooked;
 196  325
   }
 197  
 
 198  
  /**
 199  
   * Retrieves the Name value, with locking, for this 
 200  
   * <code>capability</code> <code>Persistent</code>.
 201  
   * Field description: 
 202  
   *   A human-readable name for the Capability 
 203  
   * 
 204  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 205  
   * @throws AccessPoemException 
 206  
   *         if the current <code>AccessToken</code> 
 207  
   *         does not confer write access rights 
 208  
   * @return the value of the field <code>Name</code> for this 
 209  
   *         <code>capability</code> <code>Persistent</code>  
 210  
   */
 211  
 
 212  
   public String getName()
 213  
       throws AccessPoemException {
 214  62
     readLock();
 215  62
     return getName_unsafe();
 216  
   }
 217  
 
 218  
 
 219  
  /**
 220  
   * Sets the <code>Name</code> value, with checking, for this 
 221  
   * <code>capability</code> <code>Persistent</code>.
 222  
   * Field description: 
 223  
   *   A human-readable name for the Capability 
 224  
   * 
 225  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 226  
   * @param cooked  a validated <code>int</code> 
 227  
   * @throws AccessPoemException 
 228  
   *         if the current <code>AccessToken</code> 
 229  
   *         does not confer write access rights
 230  
   * @throws ValidationPoemException 
 231  
   *         if the value is not valid
 232  
   */
 233  
   public void setName(String cooked)
 234  
       throws AccessPoemException, ValidationPoemException {
 235  113
     _getCapabilityTable().getNameColumn().
 236  113
       getType().assertValidCooked(cooked);
 237  113
     writeLock();
 238  113
     setName_unsafe(cooked);
 239  113
   }
 240  
 
 241  
 
 242  
  /**
 243  
   * Retrieves the <code>Name</code> value as a <code>Field</code>
 244  
   * from this <code>capability</code> <code>Persistent</code>.
 245  
   * 
 246  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 247  
   * @throws AccessPoemException 
 248  
   *         if the current <code>AccessToken</code> 
 249  
   *         does not confer write access rights
 250  
   * @return the String name
 251  
   */
 252  
   public Field<String> getNameField() throws AccessPoemException {
 253  2
     Column<String> c = _getCapabilityTable().getNameColumn();
 254  2
     return new Field<String>((String)c.getRaw(this), c);
 255  
   }
 256  
 
 257  221
   private CachedSelection<GroupCapability> capabilityGroupCapabilitys = null;
 258  
   /** References to this Capability in the GroupCapability table via its capability field.*/
 259  
   @SuppressWarnings("unchecked")
 260  
   public Enumeration<GroupCapability> getCapabilityGroupCapabilitys() {
 261  0
     if (getTroid() == null)
 262  0
       return new EmptyEnumeration<GroupCapability>();
 263  
     else {
 264  0
       if (capabilityGroupCapabilitys == null)
 265  0
         capabilityGroupCapabilitys =
 266  0
           getPoemDatabaseTables().getGroupCapabilityTable().getCapabilityColumn().cachedSelectionWhereEq(getTroid());
 267  0
       return capabilityGroupCapabilitys.objects();
 268  
     }
 269  
   }
 270  
 
 271  
 
 272  
   /** References to this Capability in the GroupCapability table via its capability field, as a List.*/
 273  
   public List<GroupCapability> getCapabilityGroupCapabilityList() {
 274  0
     return Collections.list(getCapabilityGroupCapabilitys());
 275  
   }
 276  
 
 277  
 
 278  
 
 279  221
   private CachedSelection<TableInfo> defaultcanreadTableInfos = null;
 280  
   /** References to this Capability in the TableInfo table via its defaultcanread field.*/
 281  
   @SuppressWarnings("unchecked")
 282  
   public Enumeration<TableInfo> getDefaultcanreadTableInfos() {
 283  0
     if (getTroid() == null)
 284  0
       return new EmptyEnumeration<TableInfo>();
 285  
     else {
 286  0
       if (defaultcanreadTableInfos == null)
 287  0
         defaultcanreadTableInfos =
 288  0
           getPoemDatabaseTables().getTableInfoTable().getDefaultcanreadColumn().cachedSelectionWhereEq(getTroid());
 289  0
       return defaultcanreadTableInfos.objects();
 290  
     }
 291  
   }
 292  
 
 293  
 
 294  
   /** References to this Capability in the TableInfo table via its defaultcanread field, as a List.*/
 295  
   public List<TableInfo> getDefaultcanreadTableInfoList() {
 296  0
     return Collections.list(getDefaultcanreadTableInfos());
 297  
   }
 298  
 
 299  
 
 300  
 
 301  221
   private CachedSelection<TableInfo> defaultcanwriteTableInfos = null;
 302  
   /** References to this Capability in the TableInfo table via its defaultcanwrite field.*/
 303  
   @SuppressWarnings("unchecked")
 304  
   public Enumeration<TableInfo> getDefaultcanwriteTableInfos() {
 305  0
     if (getTroid() == null)
 306  0
       return new EmptyEnumeration<TableInfo>();
 307  
     else {
 308  0
       if (defaultcanwriteTableInfos == null)
 309  0
         defaultcanwriteTableInfos =
 310  0
           getPoemDatabaseTables().getTableInfoTable().getDefaultcanwriteColumn().cachedSelectionWhereEq(getTroid());
 311  0
       return defaultcanwriteTableInfos.objects();
 312  
     }
 313  
   }
 314  
 
 315  
 
 316  
   /** References to this Capability in the TableInfo table via its defaultcanwrite field, as a List.*/
 317  
   public List<TableInfo> getDefaultcanwriteTableInfoList() {
 318  0
     return Collections.list(getDefaultcanwriteTableInfos());
 319  
   }
 320  
 
 321  
 
 322  
 
 323  221
   private CachedSelection<TableInfo> defaultcandeleteTableInfos = null;
 324  
   /** References to this Capability in the TableInfo table via its defaultcandelete field.*/
 325  
   @SuppressWarnings("unchecked")
 326  
   public Enumeration<TableInfo> getDefaultcandeleteTableInfos() {
 327  0
     if (getTroid() == null)
 328  0
       return new EmptyEnumeration<TableInfo>();
 329  
     else {
 330  0
       if (defaultcandeleteTableInfos == null)
 331  0
         defaultcandeleteTableInfos =
 332  0
           getPoemDatabaseTables().getTableInfoTable().getDefaultcandeleteColumn().cachedSelectionWhereEq(getTroid());
 333  0
       return defaultcandeleteTableInfos.objects();
 334  
     }
 335  
   }
 336  
 
 337  
 
 338  
   /** References to this Capability in the TableInfo table via its defaultcandelete field, as a List.*/
 339  
   public List<TableInfo> getDefaultcandeleteTableInfoList() {
 340  0
     return Collections.list(getDefaultcandeleteTableInfos());
 341  
   }
 342  
 
 343  
 
 344  
 
 345  221
   private CachedSelection<TableInfo> cancreateTableInfos = null;
 346  
   /** References to this Capability in the TableInfo table via its cancreate field.*/
 347  
   @SuppressWarnings("unchecked")
 348  
   public Enumeration<TableInfo> getCancreateTableInfos() {
 349  0
     if (getTroid() == null)
 350  0
       return new EmptyEnumeration<TableInfo>();
 351  
     else {
 352  0
       if (cancreateTableInfos == null)
 353  0
         cancreateTableInfos =
 354  0
           getPoemDatabaseTables().getTableInfoTable().getCancreateColumn().cachedSelectionWhereEq(getTroid());
 355  0
       return cancreateTableInfos.objects();
 356  
     }
 357  
   }
 358  
 
 359  
 
 360  
   /** References to this Capability in the TableInfo table via its cancreate field, as a List.*/
 361  
   public List<TableInfo> getCancreateTableInfoList() {
 362  0
     return Collections.list(getCancreateTableInfos());
 363  
   }
 364  
 
 365  
 
 366  
 
 367  
 }
 368