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