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