1 // Do not edit this file! It was generated by Melati POEM's DSD preprocessor. 2 3 package org.paneris.melati.site.model.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.ValidationPoemException; 10 import org.paneris.melati.site.model.SiteDatabaseTables; 11 import org.paneris.melati.site.model.TemplateTable; 12 import org.paneris.melati.site.model.UploadedFile; 13 14 15 /** 16 * Melati POEM generated abstract base class for a <code>Persistent</code> 17 * <code>Template</code> Object. 18 * 19 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 20 */ 21 public abstract class TemplateBase extends UploadedFile { 22 23 24 /** 25 * Retrieves the Database object. 26 * 27 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 28 * @return the database 29 */ 30 public SiteDatabaseTables getSiteDatabaseTables() { 31 return (SiteDatabaseTables)getDatabase(); 32 } 33 34 35 /** 36 * Retrieves the <code>TemplateTable</code> table 37 * which this <code>Persistent</code> is from. 38 * 39 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 40 * @return the TemplateTable 41 */ 42 public TemplateTable getTemplateTable() { 43 return (TemplateTable)getTable(); 44 } 45 46 private TemplateTable _getTemplateTable() { 47 return (TemplateTable)getTable(); 48 } 49 50 // Fields in this table 51 /** 52 * id 53 */ 54 protected Integer id; 55 /** 56 * url - Key by which template engine can locate template, no need for 57 * extension 58 */ 59 protected String url; 60 61 62 /** 63 * Retrieves the <code>Id</code> value, without locking, 64 * for this <code>Template</code> <code>Persistent</code>. 65 * 66 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods 67 * @return the Integer id 68 */ 69 public Integer getId_unsafe() { 70 return id; 71 } 72 73 74 /** 75 * Sets the <code>Id</code> value directly, without checking, 76 * for this Template <code>Persistent</code>. 77 * 78 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods 79 * @param cooked the pre-validated value to set 80 */ 81 public void setId_unsafe(Integer cooked) { 82 id = cooked; 83 } 84 85 /** 86 * Retrieves the Id value, with locking, for this 87 * <code>Template</code> <code>Persistent</code>. 88 * 89 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 90 * @throws AccessPoemException 91 * if the current <code>AccessToken</code> 92 * does not confer write access rights 93 * @return the value of the field <code>Id</code> for this 94 * <code>Template</code> <code>Persistent</code> 95 */ 96 97 public Integer getId() 98 throws AccessPoemException { 99 readLock(); 100 return getId_unsafe(); 101 } 102 103 104 /** 105 * Sets the <code>Id</code> value, with checking, for this 106 * <code>Template</code> <code>Persistent</code>. 107 * 108 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 109 * @param cooked a validated <code>int</code> 110 * @throws AccessPoemException 111 * if the current <code>AccessToken</code> 112 * does not confer write access rights 113 * @throws ValidationPoemException 114 * if the value is not valid 115 */ 116 public void setId(Integer cooked) 117 throws AccessPoemException, ValidationPoemException { 118 _getTemplateTable().getIdColumn(). 119 getType().assertValidCooked(cooked); 120 writeLock(); 121 setId_unsafe(cooked); 122 } 123 124 /** 125 * Sets the <code>Id</code> value, with checking, for this 126 * <code>Template</code> <code>Persistent</code>. 127 * 128 * @generator org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 129 * @param cooked a validated <code>int</code> 130 * @throws AccessPoemException 131 * if the current <code>AccessToken</code> 132 * does not confer write access rights 133 * @throws ValidationPoemException 134 * if the value is not valid 135 */ 136 137 public final void setId(int cooked) 138 throws AccessPoemException, ValidationPoemException { 139 setId(new Integer(cooked)); 140 } 141 142 143 /** 144 * Retrieves the <code>Id</code> value as a <code>Field</code> 145 * from this <code>Template</code> <code>Persistent</code>. 146 * 147 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator 148 * @throws AccessPoemException 149 * if the current <code>AccessToken</code> 150 * does not confer write access rights 151 * @return the Integer id 152 */ 153 public Field getIdField() throws AccessPoemException { 154 Column c = _getTemplateTable().getIdColumn(); 155 return new Field(c.getRaw(this), c); 156 } 157 158 159 /** 160 * Retrieves the <code>Url</code> value, without locking, 161 * for this <code>Template</code> <code>Persistent</code>. 162 * 163 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods 164 * @return the String url 165 */ 166 public String getUrl_unsafe() { 167 return url; 168 } 169 170 171 /** 172 * Sets the <code>Url</code> value directly, without checking, 173 * for this Template <code>Persistent</code>. 174 * 175 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods 176 * @param cooked the pre-validated value to set 177 */ 178 public void setUrl_unsafe(String cooked) { 179 url = cooked; 180 } 181 182 /** 183 * Retrieves the Url value, with locking, for this 184 * <code>Template</code> <code>Persistent</code>. 185 * Field description: 186 * Key by which template engine can locate template, no need for extension 187 * 188 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 189 * @throws AccessPoemException 190 * if the current <code>AccessToken</code> 191 * does not confer write access rights 192 * @return the value of the field <code>Url</code> for this 193 * <code>Template</code> <code>Persistent</code> 194 */ 195 196 public String getUrl() 197 throws AccessPoemException { 198 readLock(); 199 return getUrl_unsafe(); 200 } 201 202 203 /** 204 * Sets the <code>Url</code> value, with checking, for this 205 * <code>Template</code> <code>Persistent</code>. 206 * Field description: 207 * Key by which template engine can locate template, no need for extension 208 * 209 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 210 * @param cooked a validated <code>int</code> 211 * @throws AccessPoemException 212 * if the current <code>AccessToken</code> 213 * does not confer write access rights 214 * @throws ValidationPoemException 215 * if the value is not valid 216 */ 217 public void setUrl(String cooked) 218 throws AccessPoemException, ValidationPoemException { 219 _getTemplateTable().getUrlColumn(). 220 getType().assertValidCooked(cooked); 221 writeLock(); 222 setUrl_unsafe(cooked); 223 } 224 225 226 /** 227 * Retrieves the <code>Url</code> value as a <code>Field</code> 228 * from this <code>Template</code> <code>Persistent</code>. 229 * 230 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator 231 * @throws AccessPoemException 232 * if the current <code>AccessToken</code> 233 * does not confer write access rights 234 * @return the String url 235 */ 236 public Field getUrlField() throws AccessPoemException { 237 Column c = _getTemplateTable().getUrlColumn(); 238 return new Field(c.getRaw(this), c); 239 } 240 } 241