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.Searchability; |
16 | |
import org.melati.poem.StringPoemType; |
17 | |
import org.melati.poem.TroidPoemType; |
18 | |
import org.melati.poem.ValidationPoemException; |
19 | |
import org.paneris.bibliomania.Advert; |
20 | |
import org.paneris.bibliomania.BibliomaniaDatabaseTables; |
21 | |
import org.paneris.bibliomania.BibliomaniaTable; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class AdvertTableBase<T extends Advert> extends BibliomaniaTable<T> { |
31 | |
|
32 | 2 | private Column<Integer> col_id = null; |
33 | 2 | private Column<String> col_displayname = null; |
34 | 2 | private Column<String> col_html = null; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
public AdvertTableBase( |
47 | |
Database database, String name, |
48 | |
DefinitionSource definitionSource) throws PoemException { |
49 | 2 | super(database, name, definitionSource); |
50 | 2 | } |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
60 | 0 | return (BibliomaniaDatabaseTables)getDatabase(); |
61 | |
} |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
public void init() throws PoemException { |
70 | 2 | super.init(); |
71 | 2 | defineColumn(col_id = |
72 | |
new Column<Integer>(this, "id", |
73 | |
new TroidPoemType(), |
74 | 2 | DefinitionSource.dsd) { |
75 | |
public Object getCooked(Persistent g) |
76 | |
throws AccessPoemException, PoemException { |
77 | 0 | return ((Advert)g).getId(); |
78 | |
} |
79 | |
|
80 | |
public void setCooked(Persistent g, Object cooked) |
81 | |
throws AccessPoemException, ValidationPoemException { |
82 | 0 | ((Advert)g).setId((Integer)cooked); |
83 | 0 | } |
84 | |
|
85 | |
public Field<Integer> asField(Persistent g) { |
86 | 0 | return ((Advert)g).getIdField(); |
87 | |
} |
88 | |
|
89 | |
public boolean defaultUserEditable() { |
90 | 0 | return false; |
91 | |
} |
92 | |
|
93 | |
public boolean defaultUserCreateable() { |
94 | 0 | return false; |
95 | |
} |
96 | |
|
97 | |
public DisplayLevel defaultDisplayLevel() { |
98 | 0 | return DisplayLevel.record; |
99 | |
} |
100 | |
|
101 | |
public int defaultDisplayOrder() { |
102 | 0 | return 0; |
103 | |
} |
104 | |
|
105 | |
public Object getRaw_unsafe(Persistent g) |
106 | |
throws AccessPoemException { |
107 | 0 | return ((Advert)g).getId_unsafe(); |
108 | |
} |
109 | |
|
110 | |
public void setRaw_unsafe(Persistent g, Object raw) |
111 | |
throws AccessPoemException { |
112 | 0 | ((Advert)g).setId_unsafe((Integer)raw); |
113 | 0 | } |
114 | |
|
115 | |
public Object getRaw(Persistent g) |
116 | |
throws AccessPoemException { |
117 | 0 | return ((Advert)g).getId(); |
118 | |
} |
119 | |
|
120 | |
public void setRaw(Persistent g, Object raw) |
121 | |
throws AccessPoemException { |
122 | 0 | ((Advert)g).setId((Integer)raw); |
123 | 0 | } |
124 | |
}); |
125 | |
|
126 | 2 | defineColumn(col_displayname = |
127 | |
new Column<String>(this, "displayname", |
128 | |
new StringPoemType(false, -1), |
129 | 2 | DefinitionSource.dsd) { |
130 | |
public Object getCooked(Persistent g) |
131 | |
throws AccessPoemException, PoemException { |
132 | 0 | return ((Advert)g).getDisplayname(); |
133 | |
} |
134 | |
|
135 | |
public void setCooked(Persistent g, Object cooked) |
136 | |
throws AccessPoemException, ValidationPoemException { |
137 | 0 | ((Advert)g).setDisplayname((String)cooked); |
138 | 0 | } |
139 | |
|
140 | |
public Field<String> asField(Persistent g) { |
141 | 0 | return ((Advert)g).getDisplaynameField(); |
142 | |
} |
143 | |
|
144 | |
public DisplayLevel defaultDisplayLevel() { |
145 | 0 | return DisplayLevel.primary; |
146 | |
} |
147 | |
|
148 | |
public Searchability defaultSearchability() { |
149 | 0 | return Searchability.primary; |
150 | |
} |
151 | |
|
152 | |
public String defaultDisplayName() { |
153 | 0 | return "Display name"; |
154 | |
} |
155 | |
|
156 | |
public int defaultDisplayOrder() { |
157 | 0 | return 1; |
158 | |
} |
159 | |
|
160 | |
public String defaultDescription() { |
161 | 0 | return "The advert's name"; |
162 | |
} |
163 | |
|
164 | |
public int defaultWidth() { |
165 | 0 | return 15; |
166 | |
} |
167 | |
|
168 | |
public Object getRaw_unsafe(Persistent g) |
169 | |
throws AccessPoemException { |
170 | 0 | return ((Advert)g).getDisplayname_unsafe(); |
171 | |
} |
172 | |
|
173 | |
public void setRaw_unsafe(Persistent g, Object raw) |
174 | |
throws AccessPoemException { |
175 | 0 | ((Advert)g).setDisplayname_unsafe((String)raw); |
176 | 0 | } |
177 | |
|
178 | |
public Object getRaw(Persistent g) |
179 | |
throws AccessPoemException { |
180 | 0 | return ((Advert)g).getDisplayname(); |
181 | |
} |
182 | |
|
183 | |
public void setRaw(Persistent g, Object raw) |
184 | |
throws AccessPoemException { |
185 | 0 | ((Advert)g).setDisplayname((String)raw); |
186 | 0 | } |
187 | |
}); |
188 | |
|
189 | 2 | defineColumn(col_html = |
190 | |
new Column<String>(this, "html", |
191 | |
new StringPoemType(true, -1), |
192 | 2 | DefinitionSource.dsd) { |
193 | |
public Object getCooked(Persistent g) |
194 | |
throws AccessPoemException, PoemException { |
195 | 0 | return ((Advert)g).getHtml(); |
196 | |
} |
197 | |
|
198 | |
public void setCooked(Persistent g, Object cooked) |
199 | |
throws AccessPoemException, ValidationPoemException { |
200 | 0 | ((Advert)g).setHtml((String)cooked); |
201 | 0 | } |
202 | |
|
203 | |
public Field<String> asField(Persistent g) { |
204 | 0 | return ((Advert)g).getHtmlField(); |
205 | |
} |
206 | |
|
207 | |
public DisplayLevel defaultDisplayLevel() { |
208 | 0 | return DisplayLevel.record; |
209 | |
} |
210 | |
|
211 | |
public Searchability defaultSearchability() { |
212 | 0 | return Searchability.no; |
213 | |
} |
214 | |
|
215 | |
public int defaultDisplayOrder() { |
216 | 0 | return 2; |
217 | |
} |
218 | |
|
219 | |
public String defaultDescription() { |
220 | 0 | return "A fragment of HTML pointing to the advert"; |
221 | |
} |
222 | |
|
223 | |
public int defaultWidth() { |
224 | 0 | return 80; |
225 | |
} |
226 | |
|
227 | |
public int defaultHeight() { |
228 | 0 | return 20; |
229 | |
} |
230 | |
|
231 | |
public Object getRaw_unsafe(Persistent g) |
232 | |
throws AccessPoemException { |
233 | 0 | return ((Advert)g).getHtml_unsafe(); |
234 | |
} |
235 | |
|
236 | |
public void setRaw_unsafe(Persistent g, Object raw) |
237 | |
throws AccessPoemException { |
238 | 0 | ((Advert)g).setHtml_unsafe((String)raw); |
239 | 0 | } |
240 | |
|
241 | |
public Object getRaw(Persistent g) |
242 | |
throws AccessPoemException { |
243 | 0 | return ((Advert)g).getHtml(); |
244 | |
} |
245 | |
|
246 | |
public void setRaw(Persistent g, Object raw) |
247 | |
throws AccessPoemException { |
248 | 0 | ((Advert)g).setHtml((String)raw); |
249 | 0 | } |
250 | |
}); |
251 | 2 | } |
252 | |
|
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
|
259 | |
|
260 | |
|
261 | |
public final Column<Integer> getIdColumn() { |
262 | 0 | return col_id; |
263 | |
} |
264 | |
|
265 | |
|
266 | |
|
267 | |
|
268 | |
|
269 | |
|
270 | |
|
271 | |
|
272 | |
|
273 | |
public final Column<String> getDisplaynameColumn() { |
274 | 0 | return col_displayname; |
275 | |
} |
276 | |
|
277 | |
|
278 | |
|
279 | |
|
280 | |
|
281 | |
|
282 | |
|
283 | |
|
284 | |
|
285 | |
public final Column<String> getHtmlColumn() { |
286 | 0 | return col_html; |
287 | |
} |
288 | |
|
289 | |
|
290 | |
|
291 | |
|
292 | |
|
293 | |
|
294 | |
|
295 | |
|
296 | |
|
297 | |
public Advert getAdvertObject(Integer troid) { |
298 | 0 | return (Advert)getObject(troid); |
299 | |
} |
300 | |
|
301 | |
|
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
public Advert getAdvertObject(int troid) { |
310 | 0 | return (Advert)getObject(troid); |
311 | |
} |
312 | |
|
313 | |
protected JdbcPersistent _newPersistent() { |
314 | 0 | return new Advert(); |
315 | |
} |
316 | |
public String defaultDescription() { |
317 | 0 | return "A banner advert"; |
318 | |
} |
319 | |
|
320 | |
public boolean defaultRememberAllTroids() { |
321 | 0 | return true; |
322 | |
} |
323 | |
|
324 | |
public int defaultDisplayOrder() { |
325 | 0 | return 700; |
326 | |
} |
327 | |
} |
328 | |
|