Coverage Report - org.melati.poem.generated.SettingBase
 
Classes in this File Line Coverage Branch Coverage Complexity
SettingBase
76%
32/42
N/A
1
 
 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.Column;
 8  
 import org.melati.poem.Field;
 9  
 import org.melati.poem.PoemDatabaseTables;
 10  
 import org.melati.poem.Setting;
 11  
 import org.melati.poem.SettingTable;
 12  
 import org.melati.poem.ValidationPoemException;
 13  
 import org.melati.poem.ValueInfo;
 14  
 
 15  
 
 16  
 /**
 17  
  * Melati POEM generated abstract base class for a <code>Persistent</code> 
 18  
  * <code>setting</code> Object.
 19  
  *
 20  
  * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 21  
  */
 22  23
 public abstract class SettingBase extends ValueInfo {
 23  
 
 24  
 
 25  
  /**
 26  
   * Retrieves the Database object.
 27  
   * 
 28  
   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 29  
   * @return the database
 30  
   */
 31  
   public PoemDatabaseTables getPoemDatabaseTables() {
 32  0
     return (PoemDatabaseTables)getDatabase();
 33  
   }
 34  
 
 35  
 
 36  
  /**
 37  
   * Retrieves the  <code>SettingTable</code> table 
 38  
   * which this <code>Persistent</code> is from.
 39  
   * 
 40  
   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
 41  
   * @return the SettingTable
 42  
   */
 43  
   @SuppressWarnings("unchecked")
 44  
   public SettingTable<Setting> getSettingTable() {
 45  4
     return (SettingTable<Setting>)getTable();
 46  
   }
 47  
 
 48  
   @SuppressWarnings("unchecked")
 49  
   private SettingTable<Setting> _getSettingTable() {
 50  53
     return (SettingTable<Setting>)getTable();
 51  
   }
 52  
 
 53  
   // Fields in this table 
 54  
  /**
 55  
   * id - The Table Row Object ID 
 56  
   */
 57  
   protected Integer id;
 58  
  /**
 59  
   * name - A code name for this setting 
 60  
   */
 61  
   protected String name;
 62  
  /**
 63  
   * value - The value of this setting 
 64  
   */
 65  
   protected String value;
 66  
 
 67  
 
 68  
  /**
 69  
   * Retrieves the <code>Id</code> value, without locking, 
 70  
   * for this <code>setting</code> <code>Persistent</code>.
 71  
   *
 72  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 73  
   * @return the Integer id
 74  
   */
 75  
   public Integer getId_unsafe() {
 76  50
     return id;
 77  
   }
 78  
 
 79  
 
 80  
  /**
 81  
   * Sets the <code>Id</code> value directly, without checking, 
 82  
   * for this setting <code>Persistent</code>.
 83  
   * 
 84  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 85  
   * @param cooked  the pre-validated value to set
 86  
   */
 87  
   public void setId_unsafe(Integer cooked) {
 88  48
     id = cooked;
 89  48
   }
 90  
 
 91  
  /**
 92  
   * Retrieves the Id value, with locking, for this 
 93  
   * <code>setting</code> <code>Persistent</code>.
 94  
   * Field description: 
 95  
   *   The Table Row Object ID 
 96  
   * 
 97  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 98  
   * @throws AccessPoemException 
 99  
   *         if the current <code>AccessToken</code> 
 100  
   *         does not confer write access rights 
 101  
   * @return the value of the field <code>Id</code> for this 
 102  
   *         <code>setting</code> <code>Persistent</code>  
 103  
   */
 104  
 
 105  
   public Integer getId()
 106  
       throws AccessPoemException {
 107  2
     readLock();
 108  2
     return getId_unsafe();
 109  
   }
 110  
 
 111  
 
 112  
  /**
 113  
   * Sets the <code>Id</code> value, with checking, for this 
 114  
   * <code>setting</code> <code>Persistent</code>.
 115  
   * Field description: 
 116  
   *   The Table Row Object ID 
 117  
   * 
 118  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 119  
   * @param cooked  a validated <code>int</code> 
 120  
   * @throws AccessPoemException 
 121  
   *         if the current <code>AccessToken</code> 
 122  
   *         does not confer write access rights
 123  
   * @throws ValidationPoemException 
 124  
   *         if the value is not valid
 125  
   */
 126  
   public void setId(Integer cooked)
 127  
       throws AccessPoemException, ValidationPoemException {
 128  0
     _getSettingTable().getIdColumn().
 129  0
       getType().assertValidCooked(cooked);
 130  0
     writeLock();
 131  0
     setId_unsafe(cooked);
 132  0
   }
 133  
 
 134  
  /**
 135  
   * Sets the <code>Id</code> value, with checking, for this 
 136  
   * <code>setting</code> <code>Persistent</code>.
 137  
   * Field description: 
 138  
   *   The Table Row Object ID 
 139  
   * 
 140  
   * 
 141  
   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
 142  
   * @param cooked  a validated <code>int</code>
 143  
   * @throws AccessPoemException 
 144  
   *         if the current <code>AccessToken</code> 
 145  
   *         does not confer write access rights
 146  
   * @throws ValidationPoemException 
 147  
   *         if the value is not valid
 148  
   */
 149  
 
 150  
   public final void setId(int cooked)
 151  
       throws AccessPoemException, ValidationPoemException {
 152  0
     setId(new Integer(cooked));
 153  0
   }
 154  
 
 155  
 
 156  
  /**
 157  
   * Retrieves the <code>Id</code> value as a <code>Field</code>
 158  
   * from this <code>setting</code> <code>Persistent</code>.
 159  
   * 
 160  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 161  
   * @throws AccessPoemException 
 162  
   *         if the current <code>AccessToken</code> 
 163  
   *         does not confer write access rights
 164  
   * @return the Integer id
 165  
   */
 166  
   public Field<Integer> getIdField() throws AccessPoemException {
 167  2
     Column<Integer> c = _getSettingTable().getIdColumn();
 168  2
     return new Field<Integer>((Integer)c.getRaw(this), c);
 169  
   }
 170  
 
 171  
 
 172  
  /**
 173  
   * Retrieves the <code>Name</code> value, without locking, 
 174  
   * for this <code>setting</code> <code>Persistent</code>.
 175  
   *
 176  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 177  
   * @return the String name
 178  
   */
 179  
   public String getName_unsafe() {
 180  75
     return name;
 181  
   }
 182  
 
 183  
 
 184  
  /**
 185  
   * Sets the <code>Name</code> value directly, without checking, 
 186  
   * for this setting <code>Persistent</code>.
 187  
   * 
 188  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 189  
   * @param cooked  the pre-validated value to set
 190  
   */
 191  
   public void setName_unsafe(String cooked) {
 192  23
     name = cooked;
 193  23
   }
 194  
 
 195  
  /**
 196  
   * Retrieves the Name value, with locking, for this 
 197  
   * <code>setting</code> <code>Persistent</code>.
 198  
   * Field description: 
 199  
   *   A code name for this setting 
 200  
   * 
 201  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 202  
   * @throws AccessPoemException 
 203  
   *         if the current <code>AccessToken</code> 
 204  
   *         does not confer write access rights 
 205  
   * @return the value of the field <code>Name</code> for this 
 206  
   *         <code>setting</code> <code>Persistent</code>  
 207  
   */
 208  
 
 209  
   public String getName()
 210  
       throws AccessPoemException {
 211  2
     readLock();
 212  2
     return getName_unsafe();
 213  
   }
 214  
 
 215  
 
 216  
  /**
 217  
   * Sets the <code>Name</code> value, with checking, for this 
 218  
   * <code>setting</code> <code>Persistent</code>.
 219  
   * Field description: 
 220  
   *   A code name for this setting 
 221  
   * 
 222  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 223  
   * @param cooked  a validated <code>int</code> 
 224  
   * @throws AccessPoemException 
 225  
   *         if the current <code>AccessToken</code> 
 226  
   *         does not confer write access rights
 227  
   * @throws ValidationPoemException 
 228  
   *         if the value is not valid
 229  
   */
 230  
   public void setName(String cooked)
 231  
       throws AccessPoemException, ValidationPoemException {
 232  18
     _getSettingTable().getNameColumn().
 233  18
       getType().assertValidCooked(cooked);
 234  18
     writeLock();
 235  18
     setName_unsafe(cooked);
 236  18
   }
 237  
 
 238  
 
 239  
  /**
 240  
   * Retrieves the <code>Name</code> value as a <code>Field</code>
 241  
   * from this <code>setting</code> <code>Persistent</code>.
 242  
   * 
 243  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 244  
   * @throws AccessPoemException 
 245  
   *         if the current <code>AccessToken</code> 
 246  
   *         does not confer write access rights
 247  
   * @return the String name
 248  
   */
 249  
   public Field<String> getNameField() throws AccessPoemException {
 250  2
     Column<String> c = _getSettingTable().getNameColumn();
 251  2
     return new Field<String>((String)c.getRaw(this), c);
 252  
   }
 253  
 
 254  
 
 255  
  /**
 256  
   * Retrieves the <code>Value</code> value, without locking, 
 257  
   * for this <code>setting</code> <code>Persistent</code>.
 258  
   *
 259  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 260  
   * @return the String value
 261  
   */
 262  
   public String getValue_unsafe() {
 263  60
     return value;
 264  
   }
 265  
 
 266  
 
 267  
  /**
 268  
   * Sets the <code>Value</code> value directly, without checking, 
 269  
   * for this setting <code>Persistent</code>.
 270  
   * 
 271  
   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
 272  
   * @param cooked  the pre-validated value to set
 273  
   */
 274  
   public void setValue_unsafe(String cooked) {
 275  36
     value = cooked;
 276  36
   }
 277  
 
 278  
  /**
 279  
   * Retrieves the Value value, with locking, for this 
 280  
   * <code>setting</code> <code>Persistent</code>.
 281  
   * Field description: 
 282  
   *   The value of this setting 
 283  
   * 
 284  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
 285  
   * @throws AccessPoemException 
 286  
   *         if the current <code>AccessToken</code> 
 287  
   *         does not confer write access rights 
 288  
   * @return the value of the field <code>Value</code> for this 
 289  
   *         <code>setting</code> <code>Persistent</code>  
 290  
   */
 291  
 
 292  
   public String getValue()
 293  
       throws AccessPoemException {
 294  12
     readLock();
 295  12
     return getValue_unsafe();
 296  
   }
 297  
 
 298  
 
 299  
  /**
 300  
   * Sets the <code>Value</code> value, with checking, for this 
 301  
   * <code>setting</code> <code>Persistent</code>.
 302  
   * Field description: 
 303  
   *   The value of this setting 
 304  
   * 
 305  
   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
 306  
   * @param cooked  a validated <code>int</code> 
 307  
   * @throws AccessPoemException 
 308  
   *         if the current <code>AccessToken</code> 
 309  
   *         does not confer write access rights
 310  
   * @throws ValidationPoemException 
 311  
   *         if the value is not valid
 312  
   */
 313  
   public void setValue(String cooked)
 314  
       throws AccessPoemException, ValidationPoemException {
 315  31
     _getSettingTable().getValueColumn().
 316  31
       getType().assertValidCooked(cooked);
 317  31
     writeLock();
 318  31
     setValue_unsafe(cooked);
 319  31
   }
 320  
 
 321  
 
 322  
  /**
 323  
   * Retrieves the <code>Value</code> value as a <code>Field</code>
 324  
   * from this <code>setting</code> <code>Persistent</code>.
 325  
   * 
 326  
   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
 327  
   * @throws AccessPoemException 
 328  
   *         if the current <code>AccessToken</code> 
 329  
   *         does not confer write access rights
 330  
   * @return the String value
 331  
   */
 332  
   public Field<String> getValueField() throws AccessPoemException {
 333  0
     Column<String> c = _getSettingTable().getValueColumn();
 334  0
     return new Field<String>((String)c.getRaw(this), c);
 335  
   }
 336  
 
 337  
 }
 338