1
2
3 package org.melati.poem.test.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.LongPoemType;
14 import org.melati.poem.Persistent;
15 import org.melati.poem.PoemException;
16 import org.melati.poem.Searchability;
17 import org.melati.poem.TroidPoemType;
18 import org.melati.poem.ValidationPoemException;
19 import org.melati.poem.test.EverythingDatabaseTables;
20 import org.melati.poem.test.EverythingTable;
21 import org.melati.poem.test.LongField;
22
23
24
25
26
27
28
29
30 public class LongFieldTableBase<T extends LongField> extends EverythingTable<T> {
31
32 private Column<Integer> col_id = null;
33 private Column<Long> col_longfield = null;
34
35
36
37
38
39
40
41
42
43
44
45 public LongFieldTableBase(
46 Database database, String name,
47 DefinitionSource definitionSource) throws PoemException {
48 super(database, name, definitionSource);
49 }
50
51
52
53
54
55
56
57
58 public EverythingDatabaseTables getEverythingDatabaseTables() {
59 return (EverythingDatabaseTables)getDatabase();
60 }
61
62
63
64
65
66
67
68 public void init() throws PoemException {
69 super.init();
70 defineColumn(col_id =
71 new Column<Integer>(this, "id",
72 new TroidPoemType(),
73 DefinitionSource.dsd) {
74 public Object getCooked(Persistent g)
75 throws AccessPoemException, PoemException {
76 return ((LongField)g).getId();
77 }
78
79 public void setCooked(Persistent g, Object cooked)
80 throws AccessPoemException, ValidationPoemException {
81 ((LongField)g).setId((Integer)cooked);
82 }
83
84 public Field<Integer> asField(Persistent g) {
85 return ((LongField)g).getIdField();
86 }
87
88 public boolean defaultUserEditable() {
89 return false;
90 }
91
92 public boolean defaultUserCreateable() {
93 return false;
94 }
95
96 public DisplayLevel defaultDisplayLevel() {
97 return DisplayLevel.summary;
98 }
99
100 public Searchability defaultSearchability() {
101 return Searchability.yes;
102 }
103
104 public String defaultDisplayName() {
105 return "Id";
106 }
107
108 public int defaultDisplayOrder() {
109 return 0;
110 }
111
112 public boolean defaultIndexed() {
113 return true;
114 }
115
116 public boolean defaultUnique() {
117 return true;
118 }
119
120 public int defaultWidth() {
121 return 20;
122 }
123
124 public int defaultHeight() {
125 return 1;
126 }
127
128 public Object getRaw_unsafe(Persistent g)
129 throws AccessPoemException {
130 return ((LongField)g).getId_unsafe();
131 }
132
133 public void setRaw_unsafe(Persistent g, Object raw)
134 throws AccessPoemException {
135 ((LongField)g).setId_unsafe((Integer)raw);
136 }
137
138 public Object getRaw(Persistent g)
139 throws AccessPoemException {
140 return ((LongField)g).getId();
141 }
142
143 public void setRaw(Persistent g, Object raw)
144 throws AccessPoemException {
145 ((LongField)g).setId((Integer)raw);
146 }
147 });
148
149 defineColumn(col_longfield =
150 new Column<Long>(this, "longfield",
151 new LongPoemType(true),
152 DefinitionSource.dsd) {
153 public Object getCooked(Persistent g)
154 throws AccessPoemException, PoemException {
155 return ((LongField)g).getLongfield();
156 }
157
158 public void setCooked(Persistent g, Object cooked)
159 throws AccessPoemException, ValidationPoemException {
160 ((LongField)g).setLongfield((Long)cooked);
161 }
162
163 public Field<Long> asField(Persistent g) {
164 return ((LongField)g).getLongfieldField();
165 }
166
167 public DisplayLevel defaultDisplayLevel() {
168 return DisplayLevel.summary;
169 }
170
171 public Searchability defaultSearchability() {
172 return Searchability.yes;
173 }
174
175 public String defaultDisplayName() {
176 return "Long Field";
177 }
178
179 public int defaultDisplayOrder() {
180 return 8;
181 }
182
183 public int defaultWidth() {
184 return 20;
185 }
186
187 public int defaultHeight() {
188 return 1;
189 }
190
191 public Object getRaw_unsafe(Persistent g)
192 throws AccessPoemException {
193 return ((LongField)g).getLongfield_unsafe();
194 }
195
196 public void setRaw_unsafe(Persistent g, Object raw)
197 throws AccessPoemException {
198 ((LongField)g).setLongfield_unsafe((Long)raw);
199 }
200
201 public Object getRaw(Persistent g)
202 throws AccessPoemException {
203 return ((LongField)g).getLongfield();
204 }
205
206 public void setRaw(Persistent g, Object raw)
207 throws AccessPoemException {
208 ((LongField)g).setLongfield((Long)raw);
209 }
210 });
211 }
212
213
214
215
216
217
218
219
220
221 public final Column<Integer> getIdColumn() {
222 return col_id;
223 }
224
225
226
227
228
229
230
231
232
233 public final Column<Long> getLongfieldColumn() {
234 return col_longfield;
235 }
236
237
238
239
240
241
242
243
244
245 public LongField getLongFieldObject(Integer troid) {
246 return (LongField)getObject(troid);
247 }
248
249
250
251
252
253
254
255
256
257 public LongField getLongFieldObject(int troid) {
258 return (LongField)getObject(troid);
259 }
260
261 protected JdbcPersistent _newPersistent() {
262 return new LongField();
263 }
264 public String defaultDisplayName() {
265 return "Long Field";
266 }
267
268 public String defaultDescription() {
269 return "A table with only a long field in it";
270 }
271
272 public Integer defaultCacheLimit() {
273 return new Integer(100);
274 }
275
276 public String defaultCategory() {
277 return "Normal";
278 }
279
280 public int defaultDisplayOrder() {
281 return 28;
282 }
283 }
284