1 | |
|
2 | |
|
3 | |
package org.paneris.rimauresq.model.generated; |
4 | |
|
5 | |
import org.melati.poem.AccessPoemException; |
6 | |
import org.melati.poem.Column; |
7 | |
import org.melati.poem.Database; |
8 | |
import org.melati.poem.DefinitionSource; |
9 | |
import org.melati.poem.DisplayLevel; |
10 | |
import org.melati.poem.DoublePoemType; |
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.ReferencePoemType; |
17 | |
import org.melati.poem.Searchability; |
18 | |
import org.melati.poem.TroidPoemType; |
19 | |
import org.melati.poem.ValidationPoemException; |
20 | |
import org.paneris.rimauresq.model.Product; |
21 | |
import org.paneris.rimauresq.model.RimauresqDatabaseTables; |
22 | |
import org.paneris.rimauresq.model.RimauresqTable; |
23 | |
import org.paneris.rimauresq.model.ShopOrder; |
24 | |
import org.paneris.rimauresq.model.ShopOrderItem; |
25 | |
import org.paneris.rimauresq.model.User; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
public class ShopOrderItemTableBase extends RimauresqTable { |
36 | |
|
37 | 4 | private Column col_id = null; |
38 | 4 | private Column col_user = null; |
39 | 4 | private Column col_product = null; |
40 | 4 | private Column col_quantity = null; |
41 | 4 | private Column col_order = null; |
42 | 4 | private Column col_amount = null; |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
public ShopOrderItemTableBase( |
55 | |
Database database, String name, |
56 | |
DefinitionSource definitionSource) throws PoemException { |
57 | 4 | super(database, name, definitionSource); |
58 | 4 | } |
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
public RimauresqDatabaseTables getRimauresqDatabaseTables() { |
68 | 12 | return (RimauresqDatabaseTables)getDatabase(); |
69 | |
} |
70 | |
|
71 | |
public void init() throws PoemException { |
72 | 4 | super.init(); |
73 | 4 | defineColumn(col_id = |
74 | |
new Column(this, "id", |
75 | |
new TroidPoemType(), |
76 | |
DefinitionSource.dsd) { |
77 | |
public Object getCooked(Persistent g) |
78 | |
throws AccessPoemException, PoemException { |
79 | 0 | return ((ShopOrderItem)g).getId(); |
80 | |
} |
81 | |
|
82 | |
public void setCooked(Persistent g, Object cooked) |
83 | |
throws AccessPoemException, ValidationPoemException { |
84 | 0 | ((ShopOrderItem)g).setId((Integer)cooked); |
85 | 0 | } |
86 | |
|
87 | |
public Field asField(Persistent g) { |
88 | 0 | return ((ShopOrderItem)g).getIdField(); |
89 | |
} |
90 | |
|
91 | |
protected boolean defaultUserEditable() { |
92 | 4 | return false; |
93 | |
} |
94 | |
|
95 | |
protected boolean defaultUserCreateable() { |
96 | 4 | return false; |
97 | |
} |
98 | |
|
99 | |
protected DisplayLevel defaultDisplayLevel() { |
100 | 8 | return DisplayLevel.record; |
101 | |
} |
102 | |
|
103 | |
protected Searchability defaultSearchability() { |
104 | 8 | return Searchability.no; |
105 | |
} |
106 | |
|
107 | |
protected int defaultDisplayOrder() { |
108 | 4 | return 0; |
109 | |
} |
110 | |
|
111 | |
public Object getRaw_unsafe(Persistent g) |
112 | |
throws AccessPoemException { |
113 | 0 | return ((ShopOrderItem)g).getId_unsafe(); |
114 | |
} |
115 | |
|
116 | |
public void setRaw_unsafe(Persistent g, Object raw) |
117 | |
throws AccessPoemException { |
118 | 0 | ((ShopOrderItem)g).setId_unsafe((Integer)raw); |
119 | 0 | } |
120 | |
|
121 | |
public Object getRaw(Persistent g) |
122 | |
throws AccessPoemException { |
123 | 0 | return ((ShopOrderItem)g).getId(); |
124 | |
} |
125 | |
|
126 | 4 | public void setRaw(Persistent g, Object raw) |
127 | |
throws AccessPoemException { |
128 | 0 | ((ShopOrderItem)g).setId((Integer)raw); |
129 | 0 | } |
130 | |
}); |
131 | |
|
132 | 4 | defineColumn(col_user = |
133 | |
new Column(this, "user", |
134 | |
new ReferencePoemType(getRimauresqDatabaseTables(). |
135 | |
getUserTable(), false), |
136 | |
DefinitionSource.dsd) { |
137 | |
public Object getCooked(Persistent g) |
138 | |
throws AccessPoemException, PoemException { |
139 | 0 | return ((ShopOrderItem)g).getUser(); |
140 | |
} |
141 | |
|
142 | |
public void setCooked(Persistent g, Object cooked) |
143 | |
throws AccessPoemException, ValidationPoemException { |
144 | 0 | ((ShopOrderItem)g).setUser((User)cooked); |
145 | 0 | } |
146 | |
|
147 | |
public Field asField(Persistent g) { |
148 | 0 | return ((ShopOrderItem)g).getUserField(); |
149 | |
} |
150 | |
|
151 | |
protected DisplayLevel defaultDisplayLevel() { |
152 | 8 | return DisplayLevel.summary; |
153 | |
} |
154 | |
|
155 | |
protected Searchability defaultSearchability() { |
156 | 8 | return Searchability.primary; |
157 | |
} |
158 | |
|
159 | |
protected Integer defaultDisplayOrderPriority() { |
160 | 4 | return new Integer(0); |
161 | |
} |
162 | |
|
163 | |
protected String defaultDisplayName() { |
164 | 4 | return "User"; |
165 | |
} |
166 | |
|
167 | |
protected int defaultDisplayOrder() { |
168 | 4 | return 1; |
169 | |
} |
170 | |
|
171 | |
protected boolean defaultIndexed() { |
172 | 4 | return true; |
173 | |
} |
174 | |
|
175 | |
protected String defaultRenderinfo() { |
176 | 4 | return "SelectionWindow"; |
177 | |
} |
178 | |
|
179 | |
public Object getRaw_unsafe(Persistent g) |
180 | |
throws AccessPoemException { |
181 | 0 | return ((ShopOrderItem)g).getUser_unsafe(); |
182 | |
} |
183 | |
|
184 | |
public void setRaw_unsafe(Persistent g, Object raw) |
185 | |
throws AccessPoemException { |
186 | 0 | ((ShopOrderItem)g).setUser_unsafe((Integer)raw); |
187 | 0 | } |
188 | |
|
189 | |
public Object getRaw(Persistent g) |
190 | |
throws AccessPoemException { |
191 | 0 | return ((ShopOrderItem)g).getUserTroid(); |
192 | |
} |
193 | |
|
194 | 4 | public void setRaw(Persistent g, Object raw) |
195 | |
throws AccessPoemException { |
196 | 0 | ((ShopOrderItem)g).setUserTroid((Integer)raw); |
197 | 0 | } |
198 | |
}); |
199 | |
|
200 | 4 | defineColumn(col_product = |
201 | |
new Column(this, "product", |
202 | |
new ReferencePoemType(getRimauresqDatabaseTables(). |
203 | |
getProductTable(), false), |
204 | |
DefinitionSource.dsd) { |
205 | |
public Object getCooked(Persistent g) |
206 | |
throws AccessPoemException, PoemException { |
207 | 0 | return ((ShopOrderItem)g).getProduct(); |
208 | |
} |
209 | |
|
210 | |
public void setCooked(Persistent g, Object cooked) |
211 | |
throws AccessPoemException, ValidationPoemException { |
212 | 0 | ((ShopOrderItem)g).setProduct((Product)cooked); |
213 | 0 | } |
214 | |
|
215 | |
public Field asField(Persistent g) { |
216 | 0 | return ((ShopOrderItem)g).getProductField(); |
217 | |
} |
218 | |
|
219 | |
protected DisplayLevel defaultDisplayLevel() { |
220 | 8 | return DisplayLevel.summary; |
221 | |
} |
222 | |
|
223 | |
protected Searchability defaultSearchability() { |
224 | 8 | return Searchability.yes; |
225 | |
} |
226 | |
|
227 | |
protected Integer defaultDisplayOrderPriority() { |
228 | 4 | return new Integer(1); |
229 | |
} |
230 | |
|
231 | |
protected String defaultDisplayName() { |
232 | 4 | return "Product"; |
233 | |
} |
234 | |
|
235 | |
protected int defaultDisplayOrder() { |
236 | 4 | return 2; |
237 | |
} |
238 | |
|
239 | |
protected boolean defaultIndexed() { |
240 | 4 | return true; |
241 | |
} |
242 | |
|
243 | |
protected String defaultRenderinfo() { |
244 | 4 | return "SelectionWindow"; |
245 | |
} |
246 | |
|
247 | |
public Object getRaw_unsafe(Persistent g) |
248 | |
throws AccessPoemException { |
249 | 0 | return ((ShopOrderItem)g).getProduct_unsafe(); |
250 | |
} |
251 | |
|
252 | |
public void setRaw_unsafe(Persistent g, Object raw) |
253 | |
throws AccessPoemException { |
254 | 0 | ((ShopOrderItem)g).setProduct_unsafe((Integer)raw); |
255 | 0 | } |
256 | |
|
257 | |
public Object getRaw(Persistent g) |
258 | |
throws AccessPoemException { |
259 | 0 | return ((ShopOrderItem)g).getProductTroid(); |
260 | |
} |
261 | |
|
262 | 4 | public void setRaw(Persistent g, Object raw) |
263 | |
throws AccessPoemException { |
264 | 0 | ((ShopOrderItem)g).setProductTroid((Integer)raw); |
265 | 0 | } |
266 | |
}); |
267 | |
|
268 | 4 | defineColumn(col_quantity = |
269 | |
new Column(this, "quantity", |
270 | |
new IntegerPoemType(false), |
271 | |
DefinitionSource.dsd) { |
272 | |
public Object getCooked(Persistent g) |
273 | |
throws AccessPoemException, PoemException { |
274 | 0 | return ((ShopOrderItem)g).getQuantity(); |
275 | |
} |
276 | |
|
277 | |
public void setCooked(Persistent g, Object cooked) |
278 | |
throws AccessPoemException, ValidationPoemException { |
279 | 0 | ((ShopOrderItem)g).setQuantity((Integer)cooked); |
280 | 0 | } |
281 | |
|
282 | |
public Field asField(Persistent g) { |
283 | 0 | return ((ShopOrderItem)g).getQuantityField(); |
284 | |
} |
285 | |
|
286 | |
protected DisplayLevel defaultDisplayLevel() { |
287 | 8 | return DisplayLevel.summary; |
288 | |
} |
289 | |
|
290 | |
protected Searchability defaultSearchability() { |
291 | 8 | return Searchability.yes; |
292 | |
} |
293 | |
|
294 | |
protected String defaultDisplayName() { |
295 | 4 | return "Quantity"; |
296 | |
} |
297 | |
|
298 | |
protected int defaultDisplayOrder() { |
299 | 4 | return 3; |
300 | |
} |
301 | |
|
302 | |
public Object getRaw_unsafe(Persistent g) |
303 | |
throws AccessPoemException { |
304 | 0 | return ((ShopOrderItem)g).getQuantity_unsafe(); |
305 | |
} |
306 | |
|
307 | |
public void setRaw_unsafe(Persistent g, Object raw) |
308 | |
throws AccessPoemException { |
309 | 0 | ((ShopOrderItem)g).setQuantity_unsafe((Integer)raw); |
310 | 0 | } |
311 | |
|
312 | |
public Object getRaw(Persistent g) |
313 | |
throws AccessPoemException { |
314 | 0 | return ((ShopOrderItem)g).getQuantity(); |
315 | |
} |
316 | |
|
317 | 4 | public void setRaw(Persistent g, Object raw) |
318 | |
throws AccessPoemException { |
319 | 0 | ((ShopOrderItem)g).setQuantity((Integer)raw); |
320 | 0 | } |
321 | |
}); |
322 | |
|
323 | 4 | defineColumn(col_order = |
324 | |
new Column(this, "order", |
325 | |
new ReferencePoemType(getRimauresqDatabaseTables(). |
326 | |
getShopOrderTable(), false), |
327 | |
DefinitionSource.dsd) { |
328 | |
public Object getCooked(Persistent g) |
329 | |
throws AccessPoemException, PoemException { |
330 | 0 | return ((ShopOrderItem)g).getOrder(); |
331 | |
} |
332 | |
|
333 | |
public void setCooked(Persistent g, Object cooked) |
334 | |
throws AccessPoemException, ValidationPoemException { |
335 | 0 | ((ShopOrderItem)g).setOrder((ShopOrder)cooked); |
336 | 0 | } |
337 | |
|
338 | |
public Field asField(Persistent g) { |
339 | 0 | return ((ShopOrderItem)g).getOrderField(); |
340 | |
} |
341 | |
|
342 | |
protected DisplayLevel defaultDisplayLevel() { |
343 | 8 | return DisplayLevel.record; |
344 | |
} |
345 | |
|
346 | |
protected Searchability defaultSearchability() { |
347 | 8 | return Searchability.yes; |
348 | |
} |
349 | |
|
350 | |
protected String defaultDisplayName() { |
351 | 4 | return "Order Number"; |
352 | |
} |
353 | |
|
354 | |
protected int defaultDisplayOrder() { |
355 | 4 | return 4; |
356 | |
} |
357 | |
|
358 | |
protected String defaultDescription() { |
359 | 4 | return "The order number for this pruchase"; |
360 | |
} |
361 | |
|
362 | |
public Object getRaw_unsafe(Persistent g) |
363 | |
throws AccessPoemException { |
364 | 0 | return ((ShopOrderItem)g).getOrder_unsafe(); |
365 | |
} |
366 | |
|
367 | |
public void setRaw_unsafe(Persistent g, Object raw) |
368 | |
throws AccessPoemException { |
369 | 0 | ((ShopOrderItem)g).setOrder_unsafe((Integer)raw); |
370 | 0 | } |
371 | |
|
372 | |
public Object getRaw(Persistent g) |
373 | |
throws AccessPoemException { |
374 | 0 | return ((ShopOrderItem)g).getOrderTroid(); |
375 | |
} |
376 | |
|
377 | 4 | public void setRaw(Persistent g, Object raw) |
378 | |
throws AccessPoemException { |
379 | 0 | ((ShopOrderItem)g).setOrderTroid((Integer)raw); |
380 | 0 | } |
381 | |
}); |
382 | |
|
383 | 4 | defineColumn(col_amount = |
384 | |
new Column(this, "amount", |
385 | |
new DoublePoemType(false), |
386 | |
DefinitionSource.dsd) { |
387 | |
public Object getCooked(Persistent g) |
388 | |
throws AccessPoemException, PoemException { |
389 | 0 | return ((ShopOrderItem)g).getAmount(); |
390 | |
} |
391 | |
|
392 | |
public void setCooked(Persistent g, Object cooked) |
393 | |
throws AccessPoemException, ValidationPoemException { |
394 | 0 | ((ShopOrderItem)g).setAmount((Double)cooked); |
395 | 0 | } |
396 | |
|
397 | |
public Field asField(Persistent g) { |
398 | 0 | return ((ShopOrderItem)g).getAmountField(); |
399 | |
} |
400 | |
|
401 | |
protected DisplayLevel defaultDisplayLevel() { |
402 | 8 | return DisplayLevel.record; |
403 | |
} |
404 | |
|
405 | |
protected Searchability defaultSearchability() { |
406 | 8 | return Searchability.no; |
407 | |
} |
408 | |
|
409 | |
protected String defaultDisplayName() { |
410 | 4 | return "Amount (in GBP)"; |
411 | |
} |
412 | |
|
413 | |
protected int defaultDisplayOrder() { |
414 | 4 | return 5; |
415 | |
} |
416 | |
|
417 | |
protected String defaultDescription() { |
418 | 4 | return "The amount of this line (in GBP)"; |
419 | |
} |
420 | |
|
421 | |
public Object getRaw_unsafe(Persistent g) |
422 | |
throws AccessPoemException { |
423 | 0 | return ((ShopOrderItem)g).getAmount_unsafe(); |
424 | |
} |
425 | |
|
426 | |
public void setRaw_unsafe(Persistent g, Object raw) |
427 | |
throws AccessPoemException { |
428 | 0 | ((ShopOrderItem)g).setAmount_unsafe((Double)raw); |
429 | 0 | } |
430 | |
|
431 | |
public Object getRaw(Persistent g) |
432 | |
throws AccessPoemException { |
433 | 0 | return ((ShopOrderItem)g).getAmount(); |
434 | |
} |
435 | |
|
436 | 4 | public void setRaw(Persistent g, Object raw) |
437 | |
throws AccessPoemException { |
438 | 0 | ((ShopOrderItem)g).setAmount((Double)raw); |
439 | 0 | } |
440 | |
}); |
441 | 4 | } |
442 | |
|
443 | |
|
444 | |
|
445 | |
|
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
|
451 | |
public final Column getIdColumn() { |
452 | 0 | return col_id; |
453 | |
} |
454 | |
|
455 | |
|
456 | |
|
457 | |
|
458 | |
|
459 | |
|
460 | |
|
461 | |
|
462 | |
|
463 | |
public final Column getUserColumn() { |
464 | 0 | return col_user; |
465 | |
} |
466 | |
|
467 | |
|
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
|
474 | |
|
475 | |
public final Column getProductColumn() { |
476 | 0 | return col_product; |
477 | |
} |
478 | |
|
479 | |
|
480 | |
|
481 | |
|
482 | |
|
483 | |
|
484 | |
|
485 | |
|
486 | |
|
487 | |
public final Column getQuantityColumn() { |
488 | 0 | return col_quantity; |
489 | |
} |
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
|
497 | |
|
498 | |
|
499 | |
public final Column getOrderColumn() { |
500 | 0 | return col_order; |
501 | |
} |
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
|
507 | |
|
508 | |
|
509 | |
|
510 | |
|
511 | |
public final Column getAmountColumn() { |
512 | 0 | return col_amount; |
513 | |
} |
514 | |
|
515 | |
|
516 | |
|
517 | |
|
518 | |
|
519 | |
|
520 | |
|
521 | |
|
522 | |
|
523 | |
public ShopOrderItem getShopOrderItemObject(Integer troid) { |
524 | 0 | return (ShopOrderItem)getObject(troid); |
525 | |
} |
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
|
531 | |
|
532 | |
|
533 | |
|
534 | |
|
535 | |
public ShopOrderItem getShopOrderItemObject(int troid) { |
536 | 0 | return (ShopOrderItem)getObject(troid); |
537 | |
} |
538 | |
|
539 | |
protected JdbcPersistent _newPersistent() { |
540 | 0 | return new ShopOrderItem(); |
541 | |
} |
542 | |
protected String defaultDisplayName() { |
543 | 4 | return "Order Item"; |
544 | |
} |
545 | |
|
546 | |
protected String defaultDescription() { |
547 | 4 | return "Order Item"; |
548 | |
} |
549 | |
|
550 | |
protected String defaultCategory() { |
551 | 4 | return "Data"; |
552 | |
} |
553 | |
|
554 | |
protected int defaultDisplayOrder() { |
555 | 4 | return 70; |
556 | |
} |
557 | |
} |
558 | |
|