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.Field;
12 import org.melati.poem.JdbcPersistent;
13 import org.melati.poem.Persistent;
14 import org.melati.poem.PoemException;
15 import org.melati.poem.ReferencePoemType;
16 import org.melati.poem.Searchability;
17 import org.melati.poem.TroidPoemType;
18 import org.melati.poem.ValidationPoemException;
19 import org.paneris.bibliomania.BibliomaniaDatabaseTables;
20 import org.paneris.bibliomania.BibliomaniaTable;
21 import org.paneris.bibliomania.Product;
22 import org.paneris.bibliomania.Supplier;
23 import org.paneris.bibliomania.SupplierProduct;
24
25
26
27
28
29
30
31
32 public class SupplierProductTableBase<T extends SupplierProduct> extends BibliomaniaTable<T> {
33
34 private Column<Integer> col_id = null;
35 private Column<Integer> col_supplier = null;
36 private Column<Integer> col_product = null;
37
38
39
40
41
42
43
44
45
46
47
48 public SupplierProductTableBase(
49 Database database, String name,
50 DefinitionSource definitionSource) throws PoemException {
51 super(database, name, definitionSource);
52 }
53
54
55
56
57
58
59
60
61 public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
62 return (BibliomaniaDatabaseTables)getDatabase();
63 }
64
65
66
67
68
69
70
71 public void init() throws PoemException {
72 super.init();
73 defineColumn(col_id =
74 new Column<Integer>(this, "id",
75 new TroidPoemType(),
76 DefinitionSource.dsd) {
77 public Object getCooked(Persistent g)
78 throws AccessPoemException, PoemException {
79 return ((SupplierProduct)g).getId();
80 }
81
82 public void setCooked(Persistent g, Object cooked)
83 throws AccessPoemException, ValidationPoemException {
84 ((SupplierProduct)g).setId((Integer)cooked);
85 }
86
87 public Field<Integer> asField(Persistent g) {
88 return ((SupplierProduct)g).getIdField();
89 }
90
91 public boolean defaultUserEditable() {
92 return false;
93 }
94
95 public boolean defaultUserCreateable() {
96 return false;
97 }
98
99 public DisplayLevel defaultDisplayLevel() {
100 return DisplayLevel.record;
101 }
102
103 public int defaultDisplayOrder() {
104 return 0;
105 }
106
107 public Object getRaw_unsafe(Persistent g)
108 throws AccessPoemException {
109 return ((SupplierProduct)g).getId_unsafe();
110 }
111
112 public void setRaw_unsafe(Persistent g, Object raw)
113 throws AccessPoemException {
114 ((SupplierProduct)g).setId_unsafe((Integer)raw);
115 }
116
117 public Object getRaw(Persistent g)
118 throws AccessPoemException {
119 return ((SupplierProduct)g).getId();
120 }
121
122 public void setRaw(Persistent g, Object raw)
123 throws AccessPoemException {
124 ((SupplierProduct)g).setId((Integer)raw);
125 }
126 });
127
128 defineColumn(col_supplier =
129 new Column<Integer>(this, "supplier",
130 new ReferencePoemType(getBibliomaniaDatabaseTables().
131 getSupplierTable(), false),
132 DefinitionSource.dsd) {
133 public Object getCooked(Persistent g)
134 throws AccessPoemException, PoemException {
135 return ((SupplierProduct)g).getSupplier();
136 }
137
138 public void setCooked(Persistent g, Object cooked)
139 throws AccessPoemException, ValidationPoemException {
140 ((SupplierProduct)g).setSupplier((Supplier)cooked);
141 }
142
143 public Field<Integer> asField(Persistent g) {
144 return ((SupplierProduct)g).getSupplierField();
145 }
146
147 public DisplayLevel defaultDisplayLevel() {
148 return DisplayLevel.summary;
149 }
150
151 public Searchability defaultSearchability() {
152 return Searchability.yes;
153 }
154
155 public Integer defaultDisplayOrderPriority() {
156 return new Integer(1);
157 }
158
159 public String defaultDisplayName() {
160 return "Supplier";
161 }
162
163 public int defaultDisplayOrder() {
164 return 1;
165 }
166
167 public String defaultDescription() {
168 return "A supplier for this product";
169 }
170
171 public boolean defaultIndexed() {
172 return true;
173 }
174
175 public Object getRaw_unsafe(Persistent g)
176 throws AccessPoemException {
177 return ((SupplierProduct)g).getSupplier_unsafe();
178 }
179
180 public void setRaw_unsafe(Persistent g, Object raw)
181 throws AccessPoemException {
182 ((SupplierProduct)g).setSupplier_unsafe((Integer)raw);
183 }
184
185 public Object getRaw(Persistent g)
186 throws AccessPoemException {
187 return ((SupplierProduct)g).getSupplierTroid();
188 }
189
190 public void setRaw(Persistent g, Object raw)
191 throws AccessPoemException {
192 ((SupplierProduct)g).setSupplierTroid((Integer)raw);
193 }
194 });
195
196 defineColumn(col_product =
197 new Column<Integer>(this, "product",
198 new ReferencePoemType(getBibliomaniaDatabaseTables().
199 getProductTable(), false),
200 DefinitionSource.dsd) {
201 public Object getCooked(Persistent g)
202 throws AccessPoemException, PoemException {
203 return ((SupplierProduct)g).getProduct();
204 }
205
206 public void setCooked(Persistent g, Object cooked)
207 throws AccessPoemException, ValidationPoemException {
208 ((SupplierProduct)g).setProduct((Product)cooked);
209 }
210
211 public Field<Integer> asField(Persistent g) {
212 return ((SupplierProduct)g).getProductField();
213 }
214
215 public DisplayLevel defaultDisplayLevel() {
216 return DisplayLevel.summary;
217 }
218
219 public Searchability defaultSearchability() {
220 return Searchability.yes;
221 }
222
223 public Integer defaultDisplayOrderPriority() {
224 return new Integer(2);
225 }
226
227 public String defaultDisplayName() {
228 return "Product";
229 }
230
231 public int defaultDisplayOrder() {
232 return 2;
233 }
234
235 public String defaultDescription() {
236 return "A product for this supplier";
237 }
238
239 public boolean defaultIndexed() {
240 return true;
241 }
242
243 public Object getRaw_unsafe(Persistent g)
244 throws AccessPoemException {
245 return ((SupplierProduct)g).getProduct_unsafe();
246 }
247
248 public void setRaw_unsafe(Persistent g, Object raw)
249 throws AccessPoemException {
250 ((SupplierProduct)g).setProduct_unsafe((Integer)raw);
251 }
252
253 public Object getRaw(Persistent g)
254 throws AccessPoemException {
255 return ((SupplierProduct)g).getProductTroid();
256 }
257
258 public void setRaw(Persistent g, Object raw)
259 throws AccessPoemException {
260 ((SupplierProduct)g).setProductTroid((Integer)raw);
261 }
262 });
263 }
264
265
266
267
268
269
270
271
272
273 public final Column<Integer> getIdColumn() {
274 return col_id;
275 }
276
277
278
279
280
281
282
283
284
285 public final Column<Integer> getSupplierColumn() {
286 return col_supplier;
287 }
288
289
290
291
292
293
294
295
296
297 public final Column<Integer> getProductColumn() {
298 return col_product;
299 }
300
301
302
303
304
305
306
307
308
309 public SupplierProduct getSupplierProductObject(Integer troid) {
310 return (SupplierProduct)getObject(troid);
311 }
312
313
314
315
316
317
318
319
320
321 public SupplierProduct getSupplierProductObject(int troid) {
322 return (SupplierProduct)getObject(troid);
323 }
324
325 protected JdbcPersistent _newPersistent() {
326 return new SupplierProduct();
327 }
328 public String defaultDisplayName() {
329 return "Supplier's Products";
330 }
331
332 public String defaultDescription() {
333 return "A record that a product is supplied by the given supplier";
334 }
335
336 public boolean defaultRememberAllTroids() {
337 return true;
338 }
339
340 public Integer defaultCacheLimit() {
341 return new Integer(999999999);
342 }
343
344 public String defaultCategory() {
345 return "Shop";
346 }
347
348 public int defaultDisplayOrder() {
349 return 1220;
350 }
351 }
352