| 1 | |
|
| 2 | |
|
| 3 | |
package org.paneris.jammyjoes.model.generated; |
| 4 | |
|
| 5 | |
import org.melati.poem.AccessPoemException; |
| 6 | |
import org.melati.poem.BooleanPoemType; |
| 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.Field; |
| 12 | |
import org.melati.poem.IntegerPoemType; |
| 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.jammyjoes.model.DeliveryZone; |
| 21 | |
import org.paneris.jammyjoes.model.JammyjoesDatabaseTables; |
| 22 | |
import org.paneris.jammyjoes.model.JammyjoesTable; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
public class DeliveryZoneTableBase extends JammyjoesTable { |
| 33 | |
|
| 34 | 0 | private Column col_id = null; |
| 35 | 0 | private Column col_displayname = null; |
| 36 | 0 | private Column col_displayorder = null; |
| 37 | 0 | private Column col_chargeByValue = null; |
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
public DeliveryZoneTableBase( |
| 50 | |
Database database, String name, |
| 51 | |
DefinitionSource definitionSource) throws PoemException { |
| 52 | 0 | super(database, name, definitionSource); |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
public JammyjoesDatabaseTables getJammyjoesDatabaseTables() { |
| 63 | 0 | return (JammyjoesDatabaseTables)getDatabase(); |
| 64 | |
} |
| 65 | |
|
| 66 | |
public void init() throws PoemException { |
| 67 | 0 | super.init(); |
| 68 | 0 | defineColumn(col_id = |
| 69 | |
new Column(this, "id", |
| 70 | |
new TroidPoemType(), |
| 71 | |
DefinitionSource.dsd) { |
| 72 | |
public Object getCooked(Persistent g) |
| 73 | |
throws AccessPoemException, PoemException { |
| 74 | 0 | return ((DeliveryZone)g).getId(); |
| 75 | |
} |
| 76 | |
|
| 77 | |
public void setCooked(Persistent g, Object cooked) |
| 78 | |
throws AccessPoemException, ValidationPoemException { |
| 79 | 0 | ((DeliveryZone)g).setId((Integer)cooked); |
| 80 | 0 | } |
| 81 | |
|
| 82 | |
public Field asField(Persistent g) { |
| 83 | 0 | return ((DeliveryZone)g).getIdField(); |
| 84 | |
} |
| 85 | |
|
| 86 | |
protected boolean defaultUserEditable() { |
| 87 | 0 | return false; |
| 88 | |
} |
| 89 | |
|
| 90 | |
protected boolean defaultUserCreateable() { |
| 91 | 0 | return false; |
| 92 | |
} |
| 93 | |
|
| 94 | |
protected DisplayLevel defaultDisplayLevel() { |
| 95 | 0 | return DisplayLevel.record; |
| 96 | |
} |
| 97 | |
|
| 98 | |
protected int defaultDisplayOrder() { |
| 99 | 0 | return 0; |
| 100 | |
} |
| 101 | |
|
| 102 | |
public Object getRaw_unsafe(Persistent g) |
| 103 | |
throws AccessPoemException { |
| 104 | 0 | return ((DeliveryZone)g).getId_unsafe(); |
| 105 | |
} |
| 106 | |
|
| 107 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 108 | |
throws AccessPoemException { |
| 109 | 0 | ((DeliveryZone)g).setId_unsafe((Integer)raw); |
| 110 | 0 | } |
| 111 | |
|
| 112 | |
public Object getRaw(Persistent g) |
| 113 | |
throws AccessPoemException { |
| 114 | 0 | return ((DeliveryZone)g).getId(); |
| 115 | |
} |
| 116 | |
|
| 117 | 0 | public void setRaw(Persistent g, Object raw) |
| 118 | |
throws AccessPoemException { |
| 119 | 0 | ((DeliveryZone)g).setId((Integer)raw); |
| 120 | 0 | } |
| 121 | |
}); |
| 122 | |
|
| 123 | 0 | defineColumn(col_displayname = |
| 124 | |
new Column(this, "displayname", |
| 125 | |
new StringPoemType(false, -1), |
| 126 | |
DefinitionSource.dsd) { |
| 127 | |
public Object getCooked(Persistent g) |
| 128 | |
throws AccessPoemException, PoemException { |
| 129 | 0 | return ((DeliveryZone)g).getDisplayname(); |
| 130 | |
} |
| 131 | |
|
| 132 | |
public void setCooked(Persistent g, Object cooked) |
| 133 | |
throws AccessPoemException, ValidationPoemException { |
| 134 | 0 | ((DeliveryZone)g).setDisplayname((String)cooked); |
| 135 | 0 | } |
| 136 | |
|
| 137 | |
public Field asField(Persistent g) { |
| 138 | 0 | return ((DeliveryZone)g).getDisplaynameField(); |
| 139 | |
} |
| 140 | |
|
| 141 | |
protected DisplayLevel defaultDisplayLevel() { |
| 142 | 0 | return DisplayLevel.primary; |
| 143 | |
} |
| 144 | |
|
| 145 | |
protected Searchability defaultSearchability() { |
| 146 | 0 | return Searchability.primary; |
| 147 | |
} |
| 148 | |
|
| 149 | |
protected String defaultDisplayName() { |
| 150 | 0 | return "Display name"; |
| 151 | |
} |
| 152 | |
|
| 153 | |
protected int defaultDisplayOrder() { |
| 154 | 0 | return 1; |
| 155 | |
} |
| 156 | |
|
| 157 | |
protected String defaultDescription() { |
| 158 | 0 | return "The zone's name"; |
| 159 | |
} |
| 160 | |
|
| 161 | |
public Object getRaw_unsafe(Persistent g) |
| 162 | |
throws AccessPoemException { |
| 163 | 0 | return ((DeliveryZone)g).getDisplayname_unsafe(); |
| 164 | |
} |
| 165 | |
|
| 166 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 167 | |
throws AccessPoemException { |
| 168 | 0 | ((DeliveryZone)g).setDisplayname_unsafe((String)raw); |
| 169 | 0 | } |
| 170 | |
|
| 171 | |
public Object getRaw(Persistent g) |
| 172 | |
throws AccessPoemException { |
| 173 | 0 | return ((DeliveryZone)g).getDisplayname(); |
| 174 | |
} |
| 175 | |
|
| 176 | 0 | public void setRaw(Persistent g, Object raw) |
| 177 | |
throws AccessPoemException { |
| 178 | 0 | ((DeliveryZone)g).setDisplayname((String)raw); |
| 179 | 0 | } |
| 180 | |
}); |
| 181 | |
|
| 182 | 0 | defineColumn(col_displayorder = |
| 183 | |
new Column(this, "displayorder", |
| 184 | |
new IntegerPoemType(true), |
| 185 | |
DefinitionSource.dsd) { |
| 186 | |
public Object getCooked(Persistent g) |
| 187 | |
throws AccessPoemException, PoemException { |
| 188 | 0 | return ((DeliveryZone)g).getDisplayorder(); |
| 189 | |
} |
| 190 | |
|
| 191 | |
public void setCooked(Persistent g, Object cooked) |
| 192 | |
throws AccessPoemException, ValidationPoemException { |
| 193 | 0 | ((DeliveryZone)g).setDisplayorder((Integer)cooked); |
| 194 | 0 | } |
| 195 | |
|
| 196 | |
public Field asField(Persistent g) { |
| 197 | 0 | return ((DeliveryZone)g).getDisplayorderField(); |
| 198 | |
} |
| 199 | |
|
| 200 | |
protected DisplayLevel defaultDisplayLevel() { |
| 201 | 0 | return DisplayLevel.summary; |
| 202 | |
} |
| 203 | |
|
| 204 | |
protected Searchability defaultSearchability() { |
| 205 | 0 | return Searchability.no; |
| 206 | |
} |
| 207 | |
|
| 208 | |
protected Integer defaultDisplayOrderPriority() { |
| 209 | 0 | return new Integer(0); |
| 210 | |
} |
| 211 | |
|
| 212 | |
protected String defaultDisplayName() { |
| 213 | 0 | return "The order to display the zone"; |
| 214 | |
} |
| 215 | |
|
| 216 | |
protected int defaultDisplayOrder() { |
| 217 | 0 | return 2; |
| 218 | |
} |
| 219 | |
|
| 220 | |
public Object getRaw_unsafe(Persistent g) |
| 221 | |
throws AccessPoemException { |
| 222 | 0 | return ((DeliveryZone)g).getDisplayorder_unsafe(); |
| 223 | |
} |
| 224 | |
|
| 225 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 226 | |
throws AccessPoemException { |
| 227 | 0 | ((DeliveryZone)g).setDisplayorder_unsafe((Integer)raw); |
| 228 | 0 | } |
| 229 | |
|
| 230 | |
public Object getRaw(Persistent g) |
| 231 | |
throws AccessPoemException { |
| 232 | 0 | return ((DeliveryZone)g).getDisplayorder(); |
| 233 | |
} |
| 234 | |
|
| 235 | 0 | public void setRaw(Persistent g, Object raw) |
| 236 | |
throws AccessPoemException { |
| 237 | 0 | ((DeliveryZone)g).setDisplayorder((Integer)raw); |
| 238 | 0 | } |
| 239 | |
}); |
| 240 | |
|
| 241 | 0 | defineColumn(col_chargeByValue = |
| 242 | |
new Column(this, "chargeByValue", |
| 243 | |
new BooleanPoemType(false), |
| 244 | |
DefinitionSource.dsd) { |
| 245 | |
public Object getCooked(Persistent g) |
| 246 | |
throws AccessPoemException, PoemException { |
| 247 | 0 | return ((DeliveryZone)g).getChargeByValue(); |
| 248 | |
} |
| 249 | |
|
| 250 | |
public void setCooked(Persistent g, Object cooked) |
| 251 | |
throws AccessPoemException, ValidationPoemException { |
| 252 | 0 | ((DeliveryZone)g).setChargeByValue((Boolean)cooked); |
| 253 | 0 | } |
| 254 | |
|
| 255 | |
public Field asField(Persistent g) { |
| 256 | 0 | return ((DeliveryZone)g).getChargeByValueField(); |
| 257 | |
} |
| 258 | |
|
| 259 | |
protected DisplayLevel defaultDisplayLevel() { |
| 260 | 0 | return DisplayLevel.summary; |
| 261 | |
} |
| 262 | |
|
| 263 | |
protected Searchability defaultSearchability() { |
| 264 | 0 | return Searchability.no; |
| 265 | |
} |
| 266 | |
|
| 267 | |
protected String defaultDisplayName() { |
| 268 | 0 | return "Charge by Value?"; |
| 269 | |
} |
| 270 | |
|
| 271 | |
protected int defaultDisplayOrder() { |
| 272 | 0 | return 3; |
| 273 | |
} |
| 274 | |
|
| 275 | |
protected String defaultDescription() { |
| 276 | 0 | return "Charge by value for deliveries to this zone?"; |
| 277 | |
} |
| 278 | |
|
| 279 | |
public Object getRaw_unsafe(Persistent g) |
| 280 | |
throws AccessPoemException { |
| 281 | 0 | return ((DeliveryZone)g).getChargeByValue_unsafe(); |
| 282 | |
} |
| 283 | |
|
| 284 | |
public void setRaw_unsafe(Persistent g, Object raw) |
| 285 | |
throws AccessPoemException { |
| 286 | 0 | ((DeliveryZone)g).setChargeByValue_unsafe((Boolean)raw); |
| 287 | 0 | } |
| 288 | |
|
| 289 | |
public Object getRaw(Persistent g) |
| 290 | |
throws AccessPoemException { |
| 291 | 0 | return ((DeliveryZone)g).getChargeByValue(); |
| 292 | |
} |
| 293 | |
|
| 294 | 0 | public void setRaw(Persistent g, Object raw) |
| 295 | |
throws AccessPoemException { |
| 296 | 0 | ((DeliveryZone)g).setChargeByValue((Boolean)raw); |
| 297 | 0 | } |
| 298 | |
}); |
| 299 | 0 | } |
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
|
| 309 | |
public final Column getIdColumn() { |
| 310 | 0 | return col_id; |
| 311 | |
} |
| 312 | |
|
| 313 | |
|
| 314 | |
|
| 315 | |
|
| 316 | |
|
| 317 | |
|
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
public final Column getDisplaynameColumn() { |
| 322 | 0 | return col_displayname; |
| 323 | |
} |
| 324 | |
|
| 325 | |
|
| 326 | |
|
| 327 | |
|
| 328 | |
|
| 329 | |
|
| 330 | |
|
| 331 | |
|
| 332 | |
|
| 333 | |
public final Column getDisplayorderColumn() { |
| 334 | 0 | return col_displayorder; |
| 335 | |
} |
| 336 | |
|
| 337 | |
|
| 338 | |
|
| 339 | |
|
| 340 | |
|
| 341 | |
|
| 342 | |
|
| 343 | |
|
| 344 | |
|
| 345 | |
public final Column getChargeByValueColumn() { |
| 346 | 0 | return col_chargeByValue; |
| 347 | |
} |
| 348 | |
|
| 349 | |
|
| 350 | |
|
| 351 | |
|
| 352 | |
|
| 353 | |
|
| 354 | |
|
| 355 | |
|
| 356 | |
|
| 357 | |
public DeliveryZone getDeliveryZoneObject(Integer troid) { |
| 358 | 0 | return (DeliveryZone)getObject(troid); |
| 359 | |
} |
| 360 | |
|
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
public DeliveryZone getDeliveryZoneObject(int troid) { |
| 370 | 0 | return (DeliveryZone)getObject(troid); |
| 371 | |
} |
| 372 | |
|
| 373 | |
protected JdbcPersistent _newPersistent() { |
| 374 | 0 | return new DeliveryZone(); |
| 375 | |
} |
| 376 | |
protected String defaultDisplayName() { |
| 377 | 0 | return "Delivery Zone"; |
| 378 | |
} |
| 379 | |
|
| 380 | |
protected String defaultDescription() { |
| 381 | 0 | return "A delivery zone eg Europe"; |
| 382 | |
} |
| 383 | |
|
| 384 | |
protected boolean defaultRememberAllTroids() { |
| 385 | 0 | return true; |
| 386 | |
} |
| 387 | |
|
| 388 | |
protected String defaultCategory() { |
| 389 | 0 | return "Codes"; |
| 390 | |
} |
| 391 | |
|
| 392 | |
protected int defaultDisplayOrder() { |
| 393 | 0 | return 1030; |
| 394 | |
} |
| 395 | |
} |
| 396 | |
|