1
2
3 package org.paneris.jammyjoes.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.Field;
11 import org.melati.poem.IntegerPoemType;
12 import org.melati.poem.JdbcPersistent;
13 import org.melati.poem.Persistent;
14 import org.melati.poem.PoemException;
15 import org.melati.poem.Searchability;
16 import org.melati.poem.StringPoemType;
17 import org.melati.poem.TroidPoemType;
18 import org.melati.poem.ValidationPoemException;
19 import org.paneris.jammyjoes.model.JammyjoesDatabaseTables;
20 import org.paneris.jammyjoes.model.JammyjoesTable;
21 import org.paneris.jammyjoes.model.Wrapping;
22
23
24 /**
25 * Melati POEM generated base class for
26 <code>Table</code> <code>Wrapping</code>.
27 *
28 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
29 */
30
31 public class WrappingTableBase extends JammyjoesTable {
32
33 private Column col_id = null;
34 private Column col_wrapping = null;
35 private Column col_displayPositon = null;
36
37 /**
38 * Constructor.
39 *
40 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
41 * @param database the POEM database we are using
42 * @param name the name of this <code>Table</code>
43 * @param definitionSource which definition is being used
44 * @throws PoemException if anything goes wrong
45 */
46
47 public WrappingTableBase(
48 Database database, String name,
49 DefinitionSource definitionSource) throws PoemException {
50 super(database, name, definitionSource);
51 }
52
53
54 /**
55 * Get the database tables.
56 *
57 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
58 * @return the database tables
59 */
60 public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
61 return (JammyjoesDatabaseTables)getDatabase();
62 }
63
64 public void init() throws PoemException {
65 super.init();
66 defineColumn(col_id =
67 new Column(this, "id",
68 new TroidPoemType(),
69 DefinitionSource.dsd) {
70 public Object getCooked(Persistent g)
71 throws AccessPoemException, PoemException {
72 return ((Wrapping)g).getId();
73 }
74
75 public void setCooked(Persistent g, Object cooked)
76 throws AccessPoemException, ValidationPoemException {
77 ((Wrapping)g).setId((Integer)cooked);
78 }
79
80 public Field asField(Persistent g) {
81 return ((Wrapping)g).getIdField();
82 }
83
84 protected boolean defaultUserEditable() {
85 return false;
86 }
87
88 protected boolean defaultUserCreateable() {
89 return false;
90 }
91
92 protected DisplayLevel defaultDisplayLevel() {
93 return DisplayLevel.record;
94 }
95
96 protected Searchability defaultSearchability() {
97 return Searchability.no;
98 }
99
100 protected int defaultDisplayOrder() {
101 return 0;
102 }
103
104 public Object getRaw_unsafe(Persistent g)
105 throws AccessPoemException {
106 return ((Wrapping)g).getId_unsafe();
107 }
108
109 public void setRaw_unsafe(Persistent g, Object raw)
110 throws AccessPoemException {
111 ((Wrapping)g).setId_unsafe((Integer)raw);
112 }
113
114 public Object getRaw(Persistent g)
115 throws AccessPoemException {
116 return ((Wrapping)g).getId();
117 }
118
119 public void setRaw(Persistent g, Object raw)
120 throws AccessPoemException {
121 ((Wrapping)g).setId((Integer)raw);
122 }
123 });
124
125 defineColumn(col_wrapping =
126 new Column(this, "wrapping",
127 new StringPoemType(false, -1),
128 DefinitionSource.dsd) {
129 public Object getCooked(Persistent g)
130 throws AccessPoemException, PoemException {
131 return ((Wrapping)g).getWrapping();
132 }
133
134 public void setCooked(Persistent g, Object cooked)
135 throws AccessPoemException, ValidationPoemException {
136 ((Wrapping)g).setWrapping((String)cooked);
137 }
138
139 public Field asField(Persistent g) {
140 return ((Wrapping)g).getWrappingField();
141 }
142
143 protected DisplayLevel defaultDisplayLevel() {
144 return DisplayLevel.primary;
145 }
146
147 protected Searchability defaultSearchability() {
148 return Searchability.yes;
149 }
150
151 protected String defaultDisplayName() {
152 return "Wrapping";
153 }
154
155 protected int defaultDisplayOrder() {
156 return 1;
157 }
158
159 protected boolean defaultUnique() {
160 return true;
161 }
162
163 protected int defaultWidth() {
164 return 20;
165 }
166
167 public Object getRaw_unsafe(Persistent g)
168 throws AccessPoemException {
169 return ((Wrapping)g).getWrapping_unsafe();
170 }
171
172 public void setRaw_unsafe(Persistent g, Object raw)
173 throws AccessPoemException {
174 ((Wrapping)g).setWrapping_unsafe((String)raw);
175 }
176
177 public Object getRaw(Persistent g)
178 throws AccessPoemException {
179 return ((Wrapping)g).getWrapping();
180 }
181
182 public void setRaw(Persistent g, Object raw)
183 throws AccessPoemException {
184 ((Wrapping)g).setWrapping((String)raw);
185 }
186 });
187
188 defineColumn(col_displayPositon =
189 new Column(this, "displayPositon",
190 new IntegerPoemType(false),
191 DefinitionSource.dsd) {
192 public Object getCooked(Persistent g)
193 throws AccessPoemException, PoemException {
194 return ((Wrapping)g).getDisplayPositon();
195 }
196
197 public void setCooked(Persistent g, Object cooked)
198 throws AccessPoemException, ValidationPoemException {
199 ((Wrapping)g).setDisplayPositon((Integer)cooked);
200 }
201
202 public Field asField(Persistent g) {
203 return ((Wrapping)g).getDisplayPositonField();
204 }
205
206 protected DisplayLevel defaultDisplayLevel() {
207 return DisplayLevel.record;
208 }
209
210 protected Searchability defaultSearchability() {
211 return Searchability.no;
212 }
213
214 protected Integer defaultDisplayOrderPriority() {
215 return new Integer(0);
216 }
217
218 protected int defaultDisplayOrder() {
219 return 2;
220 }
221
222 public Object getRaw_unsafe(Persistent g)
223 throws AccessPoemException {
224 return ((Wrapping)g).getDisplayPositon_unsafe();
225 }
226
227 public void setRaw_unsafe(Persistent g, Object raw)
228 throws AccessPoemException {
229 ((Wrapping)g).setDisplayPositon_unsafe((Integer)raw);
230 }
231
232 public Object getRaw(Persistent g)
233 throws AccessPoemException {
234 return ((Wrapping)g).getDisplayPositon();
235 }
236
237 public void setRaw(Persistent g, Object raw)
238 throws AccessPoemException {
239 ((Wrapping)g).setDisplayPositon((Integer)raw);
240 }
241 });
242 }
243
244
245 /**
246 * Retrieves the <code>Id</code> <code>Column</code> for this
247 * <code>Wrapping</code> <code>Table</code>.
248 *
249 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
250 * @return the id <code>Column</code>
251 */
252 public final Column getIdColumn() {
253 return col_id;
254 }
255
256
257 /**
258 * Retrieves the <code>Wrapping</code> <code>Column</code> for this
259 * <code>Wrapping</code> <code>Table</code>.
260 *
261 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
262 * @return the wrapping <code>Column</code>
263 */
264 public final Column getWrappingColumn() {
265 return col_wrapping;
266 }
267
268
269 /**
270 * Retrieves the <code>DisplayPositon</code> <code>Column</code> for this
271 * <code>Wrapping</code> <code>Table</code>.
272 *
273 * @generator org.melati.poem.prepro.FieldDef#generateColAccessor
274 * @return the displayPositon <code>Column</code>
275 */
276 public final Column getDisplayPositonColumn() {
277 return col_displayPositon;
278 }
279
280
281 /**
282 * Retrieve the <code>Wrapping</code> as a <code>Wrapping</code>.
283 *
284 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
285 * @param troid a Table Row Oject ID
286 * @return the <code>Persistent</code> identified by the <code>troid</code>
287 */
288 public Wrapping getWrappingObject(Integer troid) {
289 return (Wrapping)getObject(troid);
290 }
291
292
293 /**
294 * Retrieve the <code>Wrapping</code>
295 * as a <code>Wrapping</code>.
296 *
297 * @generator org.melati.poem.prepro.TableDef#generateTableBaseJava
298 * @param troid a Table Row Object ID
299 * @return the <code>Persistent</code> identified */
300 public Wrapping getWrappingObject(int troid) {
301 return (Wrapping)getObject(troid);
302 }
303
304 protected JdbcPersistent _newPersistent() {
305 return new Wrapping();
306 }
307 protected String defaultDisplayName() {
308 return "Wrapping";
309 }
310
311 protected String defaultDescription() {
312 return "Wrapping";
313 }
314
315 protected boolean defaultRememberAllTroids() {
316 return true;
317 }
318
319 protected String defaultCategory() {
320 return "Codes";
321 }
322
323 protected int defaultDisplayOrder() {
324 return 1070;
325 }
326 }
327