| 1 | |
|
| 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.Database; |
| 9 | |
import org.melati.poem.DefinitionSource; |
| 10 | |
import org.melati.poem.DisplayLevel; |
| 11 | |
import org.melati.poem.DoublePoemType; |
| 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.ReferencePoemType; |
| 17 | |
import org.melati.poem.Searchability; |
| 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.DeliveryCharge; |
| 23 | |
import org.paneris.bibliomania.DeliveryChargeBand; |
| 24 | |
import org.paneris.bibliomania.Supplier; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
public class DeliveryChargeTableBase<T extends DeliveryCharge> extends BibliomaniaTable<T> { |
| 34 | |
|
| 35 | 2 | private Column<Integer> col_id = null; |
| 36 | 2 | private Column<Integer> col_band = null; |
| 37 | 2 | private Column<Integer> col_supplier = null; |
| 38 | 2 | private Column<Double> col_charge = null; |
| 39 | 2 | private Column<Double> col_ordercharge = null; |
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
public DeliveryChargeTableBase( |
| 52 | |
Database database, String name, |
| 53 | |
DefinitionSource definitionSource) throws PoemException { |
| 54 | 2 | super(database, name, definitionSource); |
| 55 | 2 | } |
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
|
| 64 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
| 65 | 4 | return (BibliomaniaDatabaseTables)getDatabase(); |
| 66 | |
} |
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
|
| 73 | |
|
| 74 | |
public void init() throws PoemException { |
| 75 | 2 | super.init(); |
| 76 | 2 | defineColumn(col_id = |
| 77 | |
new Column<Integer>(this, "id", |
| 78 | |
new TroidPoemType(), |
| 79 | 2 | DefinitionSource.dsd) { |
| 80 | |
public Object getCooked(Persistent g) |
| 81 | |
throws AccessPoemException, PoemException { |
| 82 | 0 | return ((DeliveryCharge)g).getId(); |
| 83 | |
} |
| 84 | |
|
| 85 | |
public void setCooked(Persistent g, Object cooked) |
| 86 | |
throws AccessPoemException, ValidationPoemException { |
| 87 | 0 | ((DeliveryCharge)g).setId((Integer)cooked); |
| 88 | 0 | } |
| 89 | |
|
| 90 | |
public Field<Integer> asField(Persistent g) { |
| 91 | 0 | return ((DeliveryCharge)g).getIdField(); |
| 92 | |
} |
| 93 | |
|
| 94 | |
public boolean defaultUserEditable() { |
| 95 | 0 | return false; |
| 96 | |
} |
| 97 | |
|
| 98 | |
public boolean defaultUserCreateable() { |
| 99 | 0 | return false; |
| 100 | |
} |
| 101 | |
|
| 102 | |
public DisplayLevel defaultDisplayLevel() { |
| 103 | 0 | return DisplayLevel.record; |
| 104 | |
} |
| 105 | |
|
| 106 | |
public int defaultDisplayOrder() { |
| 107 | 0 | return 0; |
| 108 | |
} |
| 109 | |
|
| 110 | |
public Object getRaw_unsafe(Persistent g) |
| 111 | |
throws AccessPoemException { |
| 112 | 0 | return ((DeliveryCharge)g).getId_unsafe(); |
| 113 | |
} |
| 114 | |
|
| 115 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 116 | |
throws AccessPoemException { |
| 117 | 0 | ((DeliveryCharge)g).setId_unsafe((Integer)raw); |
| 118 | 0 | } |
| 119 | |
|
| 120 | |
public Object getRaw(Persistent g) |
| 121 | |
throws AccessPoemException { |
| 122 | 0 | return ((DeliveryCharge)g).getId(); |
| 123 | |
} |
| 124 | |
|
| 125 | |
public void setRaw(Persistent g, Object raw) |
| 126 | |
throws AccessPoemException { |
| 127 | 0 | ((DeliveryCharge)g).setId((Integer)raw); |
| 128 | 0 | } |
| 129 | |
}); |
| 130 | |
|
| 131 | 2 | defineColumn(col_band = |
| 132 | |
new Column<Integer>(this, "band", |
| 133 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
| 134 | |
getDeliveryChargeBandTable(), false), |
| 135 | 2 | DefinitionSource.dsd) { |
| 136 | |
public Object getCooked(Persistent g) |
| 137 | |
throws AccessPoemException, PoemException { |
| 138 | 0 | return ((DeliveryCharge)g).getBand(); |
| 139 | |
} |
| 140 | |
|
| 141 | |
public void setCooked(Persistent g, Object cooked) |
| 142 | |
throws AccessPoemException, ValidationPoemException { |
| 143 | 0 | ((DeliveryCharge)g).setBand((DeliveryChargeBand)cooked); |
| 144 | 0 | } |
| 145 | |
|
| 146 | |
public Field<Integer> asField(Persistent g) { |
| 147 | 0 | return ((DeliveryCharge)g).getBandField(); |
| 148 | |
} |
| 149 | |
|
| 150 | |
public DisplayLevel defaultDisplayLevel() { |
| 151 | 0 | return DisplayLevel.summary; |
| 152 | |
} |
| 153 | |
|
| 154 | |
public Searchability defaultSearchability() { |
| 155 | 0 | return Searchability.yes; |
| 156 | |
} |
| 157 | |
|
| 158 | |
public Integer defaultDisplayOrderPriority() { |
| 159 | 0 | return new Integer(1); |
| 160 | |
} |
| 161 | |
|
| 162 | |
public String defaultDisplayName() { |
| 163 | 0 | return "Delivery Charge Band"; |
| 164 | |
} |
| 165 | |
|
| 166 | |
public int defaultDisplayOrder() { |
| 167 | 0 | return 1; |
| 168 | |
} |
| 169 | |
|
| 170 | |
public String defaultDescription() { |
| 171 | 0 | return "The name of area for this delivery charge"; |
| 172 | |
} |
| 173 | |
|
| 174 | |
public boolean defaultIndexed() { |
| 175 | 0 | return true; |
| 176 | |
} |
| 177 | |
|
| 178 | |
public Object getRaw_unsafe(Persistent g) |
| 179 | |
throws AccessPoemException { |
| 180 | 0 | return ((DeliveryCharge)g).getBand_unsafe(); |
| 181 | |
} |
| 182 | |
|
| 183 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 184 | |
throws AccessPoemException { |
| 185 | 0 | ((DeliveryCharge)g).setBand_unsafe((Integer)raw); |
| 186 | 0 | } |
| 187 | |
|
| 188 | |
public Object getRaw(Persistent g) |
| 189 | |
throws AccessPoemException { |
| 190 | 0 | return ((DeliveryCharge)g).getBandTroid(); |
| 191 | |
} |
| 192 | |
|
| 193 | |
public void setRaw(Persistent g, Object raw) |
| 194 | |
throws AccessPoemException { |
| 195 | 0 | ((DeliveryCharge)g).setBandTroid((Integer)raw); |
| 196 | 0 | } |
| 197 | |
}); |
| 198 | |
|
| 199 | 2 | defineColumn(col_supplier = |
| 200 | |
new Column<Integer>(this, "supplier", |
| 201 | |
new ReferencePoemType(getBibliomaniaDatabaseTables(). |
| 202 | |
getSupplierTable(), false), |
| 203 | 2 | DefinitionSource.dsd) { |
| 204 | |
public Object getCooked(Persistent g) |
| 205 | |
throws AccessPoemException, PoemException { |
| 206 | 0 | return ((DeliveryCharge)g).getSupplier(); |
| 207 | |
} |
| 208 | |
|
| 209 | |
public void setCooked(Persistent g, Object cooked) |
| 210 | |
throws AccessPoemException, ValidationPoemException { |
| 211 | 0 | ((DeliveryCharge)g).setSupplier((Supplier)cooked); |
| 212 | 0 | } |
| 213 | |
|
| 214 | |
public Field<Integer> asField(Persistent g) { |
| 215 | 0 | return ((DeliveryCharge)g).getSupplierField(); |
| 216 | |
} |
| 217 | |
|
| 218 | |
public DisplayLevel defaultDisplayLevel() { |
| 219 | 0 | return DisplayLevel.summary; |
| 220 | |
} |
| 221 | |
|
| 222 | |
public Searchability defaultSearchability() { |
| 223 | 0 | return Searchability.yes; |
| 224 | |
} |
| 225 | |
|
| 226 | |
public Integer defaultDisplayOrderPriority() { |
| 227 | 0 | return new Integer(2); |
| 228 | |
} |
| 229 | |
|
| 230 | |
public String defaultDisplayName() { |
| 231 | 0 | return "Supplier"; |
| 232 | |
} |
| 233 | |
|
| 234 | |
public int defaultDisplayOrder() { |
| 235 | 0 | return 2; |
| 236 | |
} |
| 237 | |
|
| 238 | |
public String defaultDescription() { |
| 239 | 0 | return "The supplier for which these charges apply"; |
| 240 | |
} |
| 241 | |
|
| 242 | |
public boolean defaultIndexed() { |
| 243 | 0 | return true; |
| 244 | |
} |
| 245 | |
|
| 246 | |
public Object getRaw_unsafe(Persistent g) |
| 247 | |
throws AccessPoemException { |
| 248 | 0 | return ((DeliveryCharge)g).getSupplier_unsafe(); |
| 249 | |
} |
| 250 | |
|
| 251 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 252 | |
throws AccessPoemException { |
| 253 | 0 | ((DeliveryCharge)g).setSupplier_unsafe((Integer)raw); |
| 254 | 0 | } |
| 255 | |
|
| 256 | |
public Object getRaw(Persistent g) |
| 257 | |
throws AccessPoemException { |
| 258 | 0 | return ((DeliveryCharge)g).getSupplierTroid(); |
| 259 | |
} |
| 260 | |
|
| 261 | |
public void setRaw(Persistent g, Object raw) |
| 262 | |
throws AccessPoemException { |
| 263 | 0 | ((DeliveryCharge)g).setSupplierTroid((Integer)raw); |
| 264 | 0 | } |
| 265 | |
}); |
| 266 | |
|
| 267 | 2 | defineColumn(col_charge = |
| 268 | |
new Column<Double>(this, "charge", |
| 269 | |
new DoublePoemType(false), |
| 270 | 2 | DefinitionSource.dsd) { |
| 271 | |
public Object getCooked(Persistent g) |
| 272 | |
throws AccessPoemException, PoemException { |
| 273 | 0 | return ((DeliveryCharge)g).getCharge(); |
| 274 | |
} |
| 275 | |
|
| 276 | |
public void setCooked(Persistent g, Object cooked) |
| 277 | |
throws AccessPoemException, ValidationPoemException { |
| 278 | 0 | ((DeliveryCharge)g).setCharge((Double)cooked); |
| 279 | 0 | } |
| 280 | |
|
| 281 | |
public Field<Double> asField(Persistent g) { |
| 282 | 0 | return ((DeliveryCharge)g).getChargeField(); |
| 283 | |
} |
| 284 | |
|
| 285 | |
public DisplayLevel defaultDisplayLevel() { |
| 286 | 0 | return DisplayLevel.summary; |
| 287 | |
} |
| 288 | |
|
| 289 | |
public Searchability defaultSearchability() { |
| 290 | 0 | return Searchability.no; |
| 291 | |
} |
| 292 | |
|
| 293 | |
public String defaultDisplayName() { |
| 294 | 0 | return "Per Item Delivery Charge"; |
| 295 | |
} |
| 296 | |
|
| 297 | |
public int defaultDisplayOrder() { |
| 298 | 0 | return 3; |
| 299 | |
} |
| 300 | |
|
| 301 | |
public String defaultDescription() { |
| 302 | 0 | return "The cost for delivering each book to a coutry in this band"; |
| 303 | |
} |
| 304 | |
|
| 305 | |
public Object getRaw_unsafe(Persistent g) |
| 306 | |
throws AccessPoemException { |
| 307 | 0 | return ((DeliveryCharge)g).getCharge_unsafe(); |
| 308 | |
} |
| 309 | |
|
| 310 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 311 | |
throws AccessPoemException { |
| 312 | 0 | ((DeliveryCharge)g).setCharge_unsafe((Double)raw); |
| 313 | 0 | } |
| 314 | |
|
| 315 | |
public Object getRaw(Persistent g) |
| 316 | |
throws AccessPoemException { |
| 317 | 0 | return ((DeliveryCharge)g).getCharge(); |
| 318 | |
} |
| 319 | |
|
| 320 | |
public void setRaw(Persistent g, Object raw) |
| 321 | |
throws AccessPoemException { |
| 322 | 0 | ((DeliveryCharge)g).setCharge((Double)raw); |
| 323 | 0 | } |
| 324 | |
}); |
| 325 | |
|
| 326 | 2 | defineColumn(col_ordercharge = |
| 327 | |
new Column<Double>(this, "ordercharge", |
| 328 | |
new DoublePoemType(true), |
| 329 | 2 | DefinitionSource.dsd) { |
| 330 | |
public Object getCooked(Persistent g) |
| 331 | |
throws AccessPoemException, PoemException { |
| 332 | 0 | return ((DeliveryCharge)g).getOrdercharge(); |
| 333 | |
} |
| 334 | |
|
| 335 | |
public void setCooked(Persistent g, Object cooked) |
| 336 | |
throws AccessPoemException, ValidationPoemException { |
| 337 | 0 | ((DeliveryCharge)g).setOrdercharge((Double)cooked); |
| 338 | 0 | } |
| 339 | |
|
| 340 | |
public Field<Double> asField(Persistent g) { |
| 341 | 0 | return ((DeliveryCharge)g).getOrderchargeField(); |
| 342 | |
} |
| 343 | |
|
| 344 | |
public DisplayLevel defaultDisplayLevel() { |
| 345 | 0 | return DisplayLevel.summary; |
| 346 | |
} |
| 347 | |
|
| 348 | |
public Searchability defaultSearchability() { |
| 349 | 0 | return Searchability.no; |
| 350 | |
} |
| 351 | |
|
| 352 | |
public String defaultDisplayName() { |
| 353 | 0 | return "Order Delivery Charge"; |
| 354 | |
} |
| 355 | |
|
| 356 | |
public int defaultDisplayOrder() { |
| 357 | 0 | return 4; |
| 358 | |
} |
| 359 | |
|
| 360 | |
public String defaultDescription() { |
| 361 | 0 | return "The cost for delivering the order (added to the per item charge)"; |
| 362 | |
} |
| 363 | |
|
| 364 | |
public Object getRaw_unsafe(Persistent g) |
| 365 | |
throws AccessPoemException { |
| 366 | 0 | return ((DeliveryCharge)g).getOrdercharge_unsafe(); |
| 367 | |
} |
| 368 | |
|
| 369 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 370 | |
throws AccessPoemException { |
| 371 | 0 | ((DeliveryCharge)g).setOrdercharge_unsafe((Double)raw); |
| 372 | 0 | } |
| 373 | |
|
| 374 | |
public Object getRaw(Persistent g) |
| 375 | |
throws AccessPoemException { |
| 376 | 0 | return ((DeliveryCharge)g).getOrdercharge(); |
| 377 | |
} |
| 378 | |
|
| 379 | |
public void setRaw(Persistent g, Object raw) |
| 380 | |
throws AccessPoemException { |
| 381 | 0 | ((DeliveryCharge)g).setOrdercharge((Double)raw); |
| 382 | 0 | } |
| 383 | |
}); |
| 384 | 2 | } |
| 385 | |
|
| 386 | |
|
| 387 | |
|
| 388 | |
|
| 389 | |
|
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
public final Column<Integer> getIdColumn() { |
| 395 | 0 | return col_id; |
| 396 | |
} |
| 397 | |
|
| 398 | |
|
| 399 | |
|
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
public final Column<Integer> getBandColumn() { |
| 407 | 0 | return col_band; |
| 408 | |
} |
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
|
| 417 | |
|
| 418 | |
public final Column<Integer> getSupplierColumn() { |
| 419 | 0 | return col_supplier; |
| 420 | |
} |
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | |
|
| 425 | |
|
| 426 | |
|
| 427 | |
|
| 428 | |
|
| 429 | |
|
| 430 | |
public final Column<Double> getChargeColumn() { |
| 431 | 0 | return col_charge; |
| 432 | |
} |
| 433 | |
|
| 434 | |
|
| 435 | |
|
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | |
public final Column<Double> getOrderchargeColumn() { |
| 443 | 0 | return col_ordercharge; |
| 444 | |
} |
| 445 | |
|
| 446 | |
|
| 447 | |
|
| 448 | |
|
| 449 | |
|
| 450 | |
|
| 451 | |
|
| 452 | |
|
| 453 | |
|
| 454 | |
public DeliveryCharge getDeliveryChargeObject(Integer troid) { |
| 455 | 0 | return (DeliveryCharge)getObject(troid); |
| 456 | |
} |
| 457 | |
|
| 458 | |
|
| 459 | |
|
| 460 | |
|
| 461 | |
|
| 462 | |
|
| 463 | |
|
| 464 | |
|
| 465 | |
|
| 466 | |
public DeliveryCharge getDeliveryChargeObject(int troid) { |
| 467 | 0 | return (DeliveryCharge)getObject(troid); |
| 468 | |
} |
| 469 | |
|
| 470 | |
protected JdbcPersistent _newPersistent() { |
| 471 | 0 | return new DeliveryCharge(); |
| 472 | |
} |
| 473 | |
public String defaultDisplayName() { |
| 474 | 0 | return "Delivery Charge"; |
| 475 | |
} |
| 476 | |
|
| 477 | |
public String defaultDescription() { |
| 478 | 0 | return "A delivery charge"; |
| 479 | |
} |
| 480 | |
|
| 481 | |
public boolean defaultRememberAllTroids() { |
| 482 | 0 | return true; |
| 483 | |
} |
| 484 | |
|
| 485 | |
public Integer defaultCacheLimit() { |
| 486 | 0 | return new Integer(999999999); |
| 487 | |
} |
| 488 | |
|
| 489 | |
public String defaultCategory() { |
| 490 | 0 | return "Shop"; |
| 491 | |
} |
| 492 | |
|
| 493 | |
public int defaultDisplayOrder() { |
| 494 | 0 | return 1220; |
| 495 | |
} |
| 496 | |
} |
| 497 | |
|