| 1 | |
|
| 2 | |
|
| 3 | |
package org.paneris.bibliomania.generated; |
| 4 | |
|
| 5 | |
|
| 6 | |
import org.melati.poem.AccessPoemException; |
| 7 | |
import org.melati.poem.BooleanPoemType; |
| 8 | |
import org.melati.poem.Column; |
| 9 | |
import org.melati.poem.Database; |
| 10 | |
import org.melati.poem.DefinitionSource; |
| 11 | |
import org.melati.poem.DisplayLevel; |
| 12 | |
import org.melati.poem.Field; |
| 13 | |
import org.melati.poem.JdbcPersistent; |
| 14 | |
import org.melati.poem.Persistent; |
| 15 | |
import org.melati.poem.PoemException; |
| 16 | |
import org.melati.poem.Searchability; |
| 17 | |
import org.melati.poem.StringPoemType; |
| 18 | |
import org.melati.poem.TroidPoemType; |
| 19 | |
import org.melati.poem.ValidationPoemException; |
| 20 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
| 21 | |
import org.paneris.bibliomania.BibliomaniaTable; |
| 22 | |
import org.paneris.bibliomania.Bookshop; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
public class BookshopTableBase<T extends Bookshop> extends BibliomaniaTable<T> { |
| 32 | |
|
| 33 | 2 | private Column<Integer> col_id = null; |
| 34 | 2 | private Column<String> col_code = null; |
| 35 | 2 | private Column<String> col_displayname = null; |
| 36 | 2 | private Column<String> col_flagfilename = null; |
| 37 | 2 | private Column<Boolean> col_disabled = null; |
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
public BookshopTableBase( |
| 50 | |
Database database, String name, |
| 51 | |
DefinitionSource definitionSource) throws PoemException { |
| 52 | 2 | super(database, name, definitionSource); |
| 53 | 2 | } |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
| 63 | 0 | return (BibliomaniaDatabaseTables)getDatabase(); |
| 64 | |
} |
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
public void init() throws PoemException { |
| 73 | 2 | super.init(); |
| 74 | 2 | defineColumn(col_id = |
| 75 | |
new Column<Integer>(this, "id", |
| 76 | |
new TroidPoemType(), |
| 77 | 2 | DefinitionSource.dsd) { |
| 78 | |
public Object getCooked(Persistent g) |
| 79 | |
throws AccessPoemException, PoemException { |
| 80 | 0 | return ((Bookshop)g).getId(); |
| 81 | |
} |
| 82 | |
|
| 83 | |
public void setCooked(Persistent g, Object cooked) |
| 84 | |
throws AccessPoemException, ValidationPoemException { |
| 85 | 0 | ((Bookshop)g).setId((Integer)cooked); |
| 86 | 0 | } |
| 87 | |
|
| 88 | |
public Field<Integer> asField(Persistent g) { |
| 89 | 0 | return ((Bookshop)g).getIdField(); |
| 90 | |
} |
| 91 | |
|
| 92 | |
public boolean defaultUserEditable() { |
| 93 | 0 | return false; |
| 94 | |
} |
| 95 | |
|
| 96 | |
public boolean defaultUserCreateable() { |
| 97 | 0 | return false; |
| 98 | |
} |
| 99 | |
|
| 100 | |
public DisplayLevel defaultDisplayLevel() { |
| 101 | 0 | return DisplayLevel.record; |
| 102 | |
} |
| 103 | |
|
| 104 | |
public int defaultDisplayOrder() { |
| 105 | 0 | return 0; |
| 106 | |
} |
| 107 | |
|
| 108 | |
public Object getRaw_unsafe(Persistent g) |
| 109 | |
throws AccessPoemException { |
| 110 | 0 | return ((Bookshop)g).getId_unsafe(); |
| 111 | |
} |
| 112 | |
|
| 113 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 114 | |
throws AccessPoemException { |
| 115 | 12 | ((Bookshop)g).setId_unsafe((Integer)raw); |
| 116 | 12 | } |
| 117 | |
|
| 118 | |
public Object getRaw(Persistent g) |
| 119 | |
throws AccessPoemException { |
| 120 | 0 | return ((Bookshop)g).getId(); |
| 121 | |
} |
| 122 | |
|
| 123 | |
public void setRaw(Persistent g, Object raw) |
| 124 | |
throws AccessPoemException { |
| 125 | 0 | ((Bookshop)g).setId((Integer)raw); |
| 126 | 0 | } |
| 127 | |
}); |
| 128 | |
|
| 129 | 2 | defineColumn(col_code = |
| 130 | |
new Column<String>(this, "code", |
| 131 | |
new StringPoemType(false, 10), |
| 132 | 2 | DefinitionSource.dsd) { |
| 133 | |
public Object getCooked(Persistent g) |
| 134 | |
throws AccessPoemException, PoemException { |
| 135 | 0 | return ((Bookshop)g).getCode(); |
| 136 | |
} |
| 137 | |
|
| 138 | |
public void setCooked(Persistent g, Object cooked) |
| 139 | |
throws AccessPoemException, ValidationPoemException { |
| 140 | 0 | ((Bookshop)g).setCode((String)cooked); |
| 141 | 0 | } |
| 142 | |
|
| 143 | |
public Field<String> asField(Persistent g) { |
| 144 | 0 | return ((Bookshop)g).getCodeField(); |
| 145 | |
} |
| 146 | |
|
| 147 | |
public boolean defaultUserEditable() { |
| 148 | 0 | return false; |
| 149 | |
} |
| 150 | |
|
| 151 | |
public DisplayLevel defaultDisplayLevel() { |
| 152 | 0 | return DisplayLevel.record; |
| 153 | |
} |
| 154 | |
|
| 155 | |
public int defaultDisplayOrder() { |
| 156 | 0 | return 1; |
| 157 | |
} |
| 158 | |
|
| 159 | |
public String defaultDescription() { |
| 160 | 0 | return "The system codename for the shop: must be BOB for blackwell.co.uk, BOLUK for uk.bol.com"; |
| 161 | |
} |
| 162 | |
|
| 163 | |
public boolean defaultUnique() { |
| 164 | 0 | return true; |
| 165 | |
} |
| 166 | |
|
| 167 | |
public Object getRaw_unsafe(Persistent g) |
| 168 | |
throws AccessPoemException { |
| 169 | 6 | return ((Bookshop)g).getCode_unsafe(); |
| 170 | |
} |
| 171 | |
|
| 172 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 173 | |
throws AccessPoemException { |
| 174 | 6 | ((Bookshop)g).setCode_unsafe((String)raw); |
| 175 | 6 | } |
| 176 | |
|
| 177 | |
public Object getRaw(Persistent g) |
| 178 | |
throws AccessPoemException { |
| 179 | 0 | return ((Bookshop)g).getCode(); |
| 180 | |
} |
| 181 | |
|
| 182 | |
public void setRaw(Persistent g, Object raw) |
| 183 | |
throws AccessPoemException { |
| 184 | 0 | ((Bookshop)g).setCode((String)raw); |
| 185 | 0 | } |
| 186 | |
}); |
| 187 | |
|
| 188 | 2 | defineColumn(col_displayname = |
| 189 | |
new Column<String>(this, "displayname", |
| 190 | |
new StringPoemType(false, -1), |
| 191 | 2 | DefinitionSource.dsd) { |
| 192 | |
public Object getCooked(Persistent g) |
| 193 | |
throws AccessPoemException, PoemException { |
| 194 | 0 | return ((Bookshop)g).getDisplayname(); |
| 195 | |
} |
| 196 | |
|
| 197 | |
public void setCooked(Persistent g, Object cooked) |
| 198 | |
throws AccessPoemException, ValidationPoemException { |
| 199 | 0 | ((Bookshop)g).setDisplayname((String)cooked); |
| 200 | 0 | } |
| 201 | |
|
| 202 | |
public Field<String> asField(Persistent g) { |
| 203 | 0 | return ((Bookshop)g).getDisplaynameField(); |
| 204 | |
} |
| 205 | |
|
| 206 | |
public DisplayLevel defaultDisplayLevel() { |
| 207 | 0 | return DisplayLevel.primary; |
| 208 | |
} |
| 209 | |
|
| 210 | |
public Searchability defaultSearchability() { |
| 211 | 0 | return Searchability.primary; |
| 212 | |
} |
| 213 | |
|
| 214 | |
public String defaultDisplayName() { |
| 215 | 0 | return "Display name"; |
| 216 | |
} |
| 217 | |
|
| 218 | |
public int defaultDisplayOrder() { |
| 219 | 0 | return 2; |
| 220 | |
} |
| 221 | |
|
| 222 | |
public String defaultDescription() { |
| 223 | 0 | return "A display name for the bookshop"; |
| 224 | |
} |
| 225 | |
|
| 226 | |
public Object getRaw_unsafe(Persistent g) |
| 227 | |
throws AccessPoemException { |
| 228 | 0 | return ((Bookshop)g).getDisplayname_unsafe(); |
| 229 | |
} |
| 230 | |
|
| 231 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 232 | |
throws AccessPoemException { |
| 233 | 6 | ((Bookshop)g).setDisplayname_unsafe((String)raw); |
| 234 | 6 | } |
| 235 | |
|
| 236 | |
public Object getRaw(Persistent g) |
| 237 | |
throws AccessPoemException { |
| 238 | 0 | return ((Bookshop)g).getDisplayname(); |
| 239 | |
} |
| 240 | |
|
| 241 | |
public void setRaw(Persistent g, Object raw) |
| 242 | |
throws AccessPoemException { |
| 243 | 0 | ((Bookshop)g).setDisplayname((String)raw); |
| 244 | 0 | } |
| 245 | |
}); |
| 246 | |
|
| 247 | 2 | defineColumn(col_flagfilename = |
| 248 | |
new Column<String>(this, "flagfilename", |
| 249 | |
new StringPoemType(true, -1), |
| 250 | 2 | DefinitionSource.dsd) { |
| 251 | |
public Object getCooked(Persistent g) |
| 252 | |
throws AccessPoemException, PoemException { |
| 253 | 0 | return ((Bookshop)g).getFlagfilename(); |
| 254 | |
} |
| 255 | |
|
| 256 | |
public void setCooked(Persistent g, Object cooked) |
| 257 | |
throws AccessPoemException, ValidationPoemException { |
| 258 | 0 | ((Bookshop)g).setFlagfilename((String)cooked); |
| 259 | 0 | } |
| 260 | |
|
| 261 | |
public Field<String> asField(Persistent g) { |
| 262 | 0 | return ((Bookshop)g).getFlagfilenameField(); |
| 263 | |
} |
| 264 | |
|
| 265 | |
public DisplayLevel defaultDisplayLevel() { |
| 266 | 0 | return DisplayLevel.record; |
| 267 | |
} |
| 268 | |
|
| 269 | |
public Searchability defaultSearchability() { |
| 270 | 0 | return Searchability.no; |
| 271 | |
} |
| 272 | |
|
| 273 | |
public String defaultDisplayName() { |
| 274 | 0 | return "Flag image name"; |
| 275 | |
} |
| 276 | |
|
| 277 | |
public int defaultDisplayOrder() { |
| 278 | 0 | return 3; |
| 279 | |
} |
| 280 | |
|
| 281 | |
public String defaultDescription() { |
| 282 | 0 | return "The name of a flag image file in bibliomania/html/graphics to be displayed next to the bookshop's stockings"; |
| 283 | |
} |
| 284 | |
|
| 285 | |
public Object getRaw_unsafe(Persistent g) |
| 286 | |
throws AccessPoemException { |
| 287 | 0 | return ((Bookshop)g).getFlagfilename_unsafe(); |
| 288 | |
} |
| 289 | |
|
| 290 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 291 | |
throws AccessPoemException { |
| 292 | 6 | ((Bookshop)g).setFlagfilename_unsafe((String)raw); |
| 293 | 6 | } |
| 294 | |
|
| 295 | |
public Object getRaw(Persistent g) |
| 296 | |
throws AccessPoemException { |
| 297 | 0 | return ((Bookshop)g).getFlagfilename(); |
| 298 | |
} |
| 299 | |
|
| 300 | |
public void setRaw(Persistent g, Object raw) |
| 301 | |
throws AccessPoemException { |
| 302 | 0 | ((Bookshop)g).setFlagfilename((String)raw); |
| 303 | 0 | } |
| 304 | |
}); |
| 305 | |
|
| 306 | 2 | defineColumn(col_disabled = |
| 307 | |
new Column<Boolean>(this, "disabled", |
| 308 | |
new BooleanPoemType(false), |
| 309 | 2 | DefinitionSource.dsd) { |
| 310 | |
public Object getCooked(Persistent g) |
| 311 | |
throws AccessPoemException, PoemException { |
| 312 | 0 | return ((Bookshop)g).getDisabled(); |
| 313 | |
} |
| 314 | |
|
| 315 | |
public void setCooked(Persistent g, Object cooked) |
| 316 | |
throws AccessPoemException, ValidationPoemException { |
| 317 | 0 | ((Bookshop)g).setDisabled((Boolean)cooked); |
| 318 | 0 | } |
| 319 | |
|
| 320 | |
public Field<Boolean> asField(Persistent g) { |
| 321 | 0 | return ((Bookshop)g).getDisabledField(); |
| 322 | |
} |
| 323 | |
|
| 324 | |
public DisplayLevel defaultDisplayLevel() { |
| 325 | 0 | return DisplayLevel.summary; |
| 326 | |
} |
| 327 | |
|
| 328 | |
public Searchability defaultSearchability() { |
| 329 | 0 | return Searchability.no; |
| 330 | |
} |
| 331 | |
|
| 332 | |
public int defaultDisplayOrder() { |
| 333 | 0 | return 4; |
| 334 | |
} |
| 335 | |
|
| 336 | |
public String defaultDescription() { |
| 337 | 0 | return "Whether the shop should currently be excluded from searches (takes effect next time server restarted)"; |
| 338 | |
} |
| 339 | |
|
| 340 | |
public Object getRaw_unsafe(Persistent g) |
| 341 | |
throws AccessPoemException { |
| 342 | 0 | return ((Bookshop)g).getDisabled_unsafe(); |
| 343 | |
} |
| 344 | |
|
| 345 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 346 | |
throws AccessPoemException { |
| 347 | 6 | ((Bookshop)g).setDisabled_unsafe((Boolean)raw); |
| 348 | 6 | } |
| 349 | |
|
| 350 | |
public Object getRaw(Persistent g) |
| 351 | |
throws AccessPoemException { |
| 352 | 0 | return ((Bookshop)g).getDisabled(); |
| 353 | |
} |
| 354 | |
|
| 355 | |
public void setRaw(Persistent g, Object raw) |
| 356 | |
throws AccessPoemException { |
| 357 | 0 | ((Bookshop)g).setDisabled((Boolean)raw); |
| 358 | 0 | } |
| 359 | |
}); |
| 360 | 2 | } |
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
|
| 370 | |
public final Column<Integer> getIdColumn() { |
| 371 | 0 | return col_id; |
| 372 | |
} |
| 373 | |
|
| 374 | |
|
| 375 | |
|
| 376 | |
|
| 377 | |
|
| 378 | |
|
| 379 | |
|
| 380 | |
|
| 381 | |
|
| 382 | |
public final Column<String> getCodeColumn() { |
| 383 | 12 | return col_code; |
| 384 | |
} |
| 385 | |
|
| 386 | |
|
| 387 | |
|
| 388 | |
|
| 389 | |
|
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
public final Column<String> getDisplaynameColumn() { |
| 395 | 6 | return col_displayname; |
| 396 | |
} |
| 397 | |
|
| 398 | |
|
| 399 | |
|
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
public final Column<String> getFlagfilenameColumn() { |
| 407 | 6 | return col_flagfilename; |
| 408 | |
} |
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
|
| 417 | |
|
| 418 | |
public final Column<Boolean> getDisabledColumn() { |
| 419 | 6 | return col_disabled; |
| 420 | |
} |
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | |
|
| 425 | |
|
| 426 | |
|
| 427 | |
|
| 428 | |
|
| 429 | |
|
| 430 | |
public Bookshop getBookshopObject(Integer troid) { |
| 431 | 0 | return (Bookshop)getObject(troid); |
| 432 | |
} |
| 433 | |
|
| 434 | |
|
| 435 | |
|
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | |
public Bookshop getBookshopObject(int troid) { |
| 443 | 0 | return (Bookshop)getObject(troid); |
| 444 | |
} |
| 445 | |
|
| 446 | |
protected JdbcPersistent _newPersistent() { |
| 447 | 12 | return new Bookshop(); |
| 448 | |
} |
| 449 | |
public String defaultDescription() { |
| 450 | 0 | return "An online bookshop"; |
| 451 | |
} |
| 452 | |
|
| 453 | |
public String defaultCategory() { |
| 454 | 0 | return "Comparison Shopper"; |
| 455 | |
} |
| 456 | |
|
| 457 | |
public int defaultDisplayOrder() { |
| 458 | 0 | return 1300; |
| 459 | |
} |
| 460 | |
} |
| 461 | |
|