1
2
3 package org.melati.admin.test.generated;
4
5
6 import org.melati.admin.test.AdminTestDatabaseTables;
7 import org.melati.admin.test.AdminTestTable;
8 import org.melati.admin.test.Markup;
9 import org.melati.poem.AccessPoemException;
10 import org.melati.poem.Column;
11 import org.melati.poem.Database;
12 import org.melati.poem.DefinitionSource;
13 import org.melati.poem.DisplayLevel;
14 import org.melati.poem.Field;
15 import org.melati.poem.JdbcPersistent;
16 import org.melati.poem.Persistent;
17 import org.melati.poem.PoemException;
18 import org.melati.poem.Searchability;
19 import org.melati.poem.StringPoemType;
20 import org.melati.poem.TroidPoemType;
21 import org.melati.poem.ValidationPoemException;
22
23
24
25
26
27
28
29
30 public class MarkupTableBase<T extends Markup> extends AdminTestTable<T> {
31
32 private Column<Integer> col_id = null;
33 private Column<String> col_text = null;
34
35
36
37
38
39
40
41
42
43
44
45 public MarkupTableBase(
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 AdminTestDatabaseTables getAdminTestDatabaseTables() {
59 return (AdminTestDatabaseTables)getDatabase();
60 }
61
62 public void init() throws PoemException {
63 super.init();
64 defineColumn(col_id =
65 new Column<Integer>(this, "id",
66 new TroidPoemType(),
67 DefinitionSource.dsd) {
68 public Object getCooked(Persistent g)
69 throws AccessPoemException, PoemException {
70 return ((Markup)g).getId();
71 }
72
73 public void setCooked(Persistent g, Object cooked)
74 throws AccessPoemException, ValidationPoemException {
75 ((Markup)g).setId((Integer)cooked);
76 }
77
78 public Field<Integer> asField(Persistent g) {
79 return ((Markup)g).getIdField();
80 }
81
82 public boolean defaultUserEditable() {
83 return false;
84 }
85
86 public boolean defaultUserCreateable() {
87 return false;
88 }
89
90 public DisplayLevel defaultDisplayLevel() {
91 return DisplayLevel.summary;
92 }
93
94 public boolean defaultSortDescending() {
95 return true;
96 }
97
98 public int defaultDisplayOrder() {
99 return 0;
100 }
101
102 public Object getRaw_unsafe(Persistent g)
103 throws AccessPoemException {
104 return ((Markup)g).getId_unsafe();
105 }
106
107 public void setRaw_unsafe(Persistent g, Object raw)
108 throws AccessPoemException {
109 ((Markup)g).setId_unsafe((Integer)raw);
110 }
111
112 public Object getRaw(Persistent g)
113 throws AccessPoemException {
114 return ((Markup)g).getId();
115 }
116
117 public void setRaw(Persistent g, Object raw)
118 throws AccessPoemException {
119 ((Markup)g).setId((Integer)raw);
120 }
121 });
122
123 defineColumn(col_text =
124 new Column<String>(this, "text",
125 new StringPoemType(false, -1),
126 DefinitionSource.dsd) {
127 public Object getCooked(Persistent g)
128 throws AccessPoemException, PoemException {
129 return ((Markup)g).getText();
130 }
131
132 public void setCooked(Persistent g, Object cooked)
133 throws AccessPoemException, ValidationPoemException {
134 ((Markup)g).setText((String)cooked);
135 }
136
137 public Field<String> asField(Persistent g) {
138 return ((Markup)g).getTextField();
139 }
140
141 public DisplayLevel defaultDisplayLevel() {
142 return DisplayLevel.primary;
143 }
144
145 public Searchability defaultSearchability() {
146 return Searchability.yes;
147 }
148
149 public Integer defaultDisplayOrderPriority() {
150 return new Integer(0);
151 }
152
153 public int defaultDisplayOrder() {
154 return 1;
155 }
156
157 public String defaultDescription() {
158 return "The text";
159 }
160
161 public int defaultWidth() {
162 return 40;
163 }
164
165 public Object getRaw_unsafe(Persistent g)
166 throws AccessPoemException {
167 return ((Markup)g).getText_unsafe();
168 }
169
170 public void setRaw_unsafe(Persistent g, Object raw)
171 throws AccessPoemException {
172 ((Markup)g).setText_unsafe((String)raw);
173 }
174
175 public Object getRaw(Persistent g)
176 throws AccessPoemException {
177 return ((Markup)g).getText();
178 }
179
180 public void setRaw(Persistent g, Object raw)
181 throws AccessPoemException {
182 ((Markup)g).setText((String)raw);
183 }
184 });
185 }
186
187
188
189
190
191
192
193
194
195 public final Column<Integer> getIdColumn() {
196 return col_id;
197 }
198
199
200
201
202
203
204
205
206
207 public final Column<String> getTextColumn() {
208 return col_text;
209 }
210
211
212
213
214
215
216
217
218
219 public Markup getMarkupObject(Integer troid) {
220 return (Markup)getObject(troid);
221 }
222
223
224
225
226
227
228
229
230
231 public Markup getMarkupObject(int troid) {
232 return (Markup)getObject(troid);
233 }
234
235 protected JdbcPersistent _newPersistent() {
236 return new Markup();
237 }
238 public String defaultDisplayName() {
239 return "Markup";
240 }
241
242 public String defaultDescription() {
243 return "An HTML markup fragment";
244 }
245
246 public boolean defaultRememberAllTroids() {
247 return true;
248 }
249
250 public Integer defaultCacheLimit() {
251 return new Integer(999999999);
252 }
253
254 public String defaultCategory() {
255 return "Data";
256 }
257
258 public int defaultDisplayOrder() {
259 return 5;
260 }
261 }
262