1
2
3 package org.melati.poem.generated;
4
5
6 import org.melati.poem.AccessPoemException;
7 import org.melati.poem.Capability;
8 import org.melati.poem.Column;
9 import org.melati.poem.Database;
10 import org.melati.poem.DefinitionSource;
11 import org.melati.poem.DisplayLevel;
12 import org.melati.poem.Field;
13 import org.melati.poem.Group;
14 import org.melati.poem.GroupCapability;
15 import org.melati.poem.JdbcPersistent;
16 import org.melati.poem.Persistent;
17 import org.melati.poem.PoemDatabaseTables;
18 import org.melati.poem.PoemException;
19 import org.melati.poem.PoemTable;
20 import org.melati.poem.ReferencePoemType;
21 import org.melati.poem.Searchability;
22 import org.melati.poem.TroidPoemType;
23 import org.melati.poem.ValidationPoemException;
24
25
26
27
28
29
30
31
32 public class GroupCapabilityTableBase<T extends GroupCapability> extends PoemTable<T> {
33
34 private Column<Integer> col_id = null;
35 private Column<Integer> col_group = null;
36 private Column<Integer> col_capability = null;
37
38
39
40
41
42
43
44
45
46
47
48 public GroupCapabilityTableBase(
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 PoemDatabaseTables getPoemDatabaseTables() {
62 return (PoemDatabaseTables)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 ((GroupCapability)g).getId();
80 }
81
82 public void setCooked(Persistent g, Object cooked)
83 throws AccessPoemException, ValidationPoemException {
84 ((GroupCapability)g).setId((Integer)cooked);
85 }
86
87 public Field<Integer> asField(Persistent g) {
88 return ((GroupCapability)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.detail;
101 }
102
103 public int defaultDisplayOrder() {
104 return 0;
105 }
106
107 public String defaultDescription() {
108 return "The Table Row Object ID";
109 }
110
111 public Object getRaw_unsafe(Persistent g)
112 throws AccessPoemException {
113 return ((GroupCapability)g).getId_unsafe();
114 }
115
116 public void setRaw_unsafe(Persistent g, Object raw)
117 throws AccessPoemException {
118 ((GroupCapability)g).setId_unsafe((Integer)raw);
119 }
120
121 public Object getRaw(Persistent g)
122 throws AccessPoemException {
123 return ((GroupCapability)g).getId();
124 }
125
126 public void setRaw(Persistent g, Object raw)
127 throws AccessPoemException {
128 ((GroupCapability)g).setId((Integer)raw);
129 }
130 });
131
132 defineColumn(col_group =
133 new Column<Integer>(this, "group",
134 new ReferencePoemType(getPoemDatabaseTables().
135 getGroupTable(), false),
136 DefinitionSource.dsd) {
137 public Object getCooked(Persistent g)
138 throws AccessPoemException, PoemException {
139 return ((GroupCapability)g).getGroup();
140 }
141
142 public void setCooked(Persistent g, Object cooked)
143 throws AccessPoemException, ValidationPoemException {
144 ((GroupCapability)g).setGroup((Group)cooked);
145 }
146
147 public Field<Integer> asField(Persistent g) {
148 return ((GroupCapability)g).getGroupField();
149 }
150
151 public Searchability defaultSearchability() {
152 return Searchability.primary;
153 }
154
155 public Integer defaultDisplayOrderPriority() {
156 return new Integer(0);
157 }
158
159 public int defaultDisplayOrder() {
160 return 1;
161 }
162
163 public String defaultDescription() {
164 return "The Group which has the capability";
165 }
166
167 public Object getRaw_unsafe(Persistent g)
168 throws AccessPoemException {
169 return ((GroupCapability)g).getGroup_unsafe();
170 }
171
172 public void setRaw_unsafe(Persistent g, Object raw)
173 throws AccessPoemException {
174 ((GroupCapability)g).setGroup_unsafe((Integer)raw);
175 }
176
177 public Object getRaw(Persistent g)
178 throws AccessPoemException {
179 return ((GroupCapability)g).getGroupTroid();
180 }
181
182 public void setRaw(Persistent g, Object raw)
183 throws AccessPoemException {
184 ((GroupCapability)g).setGroupTroid((Integer)raw);
185 }
186 });
187
188 defineColumn(col_capability =
189 new Column<Integer>(this, "capability",
190 new ReferencePoemType(getPoemDatabaseTables().
191 getCapabilityTable(), false),
192 DefinitionSource.dsd) {
193 public Object getCooked(Persistent g)
194 throws AccessPoemException, PoemException {
195 return ((GroupCapability)g).getCapability();
196 }
197
198 public void setCooked(Persistent g, Object cooked)
199 throws AccessPoemException, ValidationPoemException {
200 ((GroupCapability)g).setCapability((Capability)cooked);
201 }
202
203 public Field<Integer> asField(Persistent g) {
204 return ((GroupCapability)g).getCapabilityField();
205 }
206
207 public Integer defaultDisplayOrderPriority() {
208 return new Integer(1);
209 }
210
211 public int defaultDisplayOrder() {
212 return 2;
213 }
214
215 public String defaultDescription() {
216 return "The capability";
217 }
218
219 public Object getRaw_unsafe(Persistent g)
220 throws AccessPoemException {
221 return ((GroupCapability)g).getCapability_unsafe();
222 }
223
224 public void setRaw_unsafe(Persistent g, Object raw)
225 throws AccessPoemException {
226 ((GroupCapability)g).setCapability_unsafe((Integer)raw);
227 }
228
229 public Object getRaw(Persistent g)
230 throws AccessPoemException {
231 return ((GroupCapability)g).getCapabilityTroid();
232 }
233
234 public void setRaw(Persistent g, Object raw)
235 throws AccessPoemException {
236 ((GroupCapability)g).setCapabilityTroid((Integer)raw);
237 }
238 });
239 }
240
241
242
243
244
245
246
247
248
249 public final Column<Integer> getIdColumn() {
250 return col_id;
251 }
252
253
254
255
256
257
258
259
260
261 public final Column<Integer> getGroupColumn() {
262 return col_group;
263 }
264
265
266
267
268
269
270
271
272
273 public final Column<Integer> getCapabilityColumn() {
274 return col_capability;
275 }
276
277
278
279
280
281
282
283
284
285 public GroupCapability getGroupCapabilityObject(Integer troid) {
286 return (GroupCapability)getObject(troid);
287 }
288
289
290
291
292
293
294
295
296
297 public GroupCapability getGroupCapabilityObject(int troid) {
298 return (GroupCapability)getObject(troid);
299 }
300
301 protected JdbcPersistent _newPersistent() {
302 return new GroupCapability();
303 }
304 public String defaultDisplayName() {
305 return "Group capability";
306 }
307
308 public String defaultDescription() {
309 return "A record that Users belonging to a given Group possess a given Capability";
310 }
311
312 public String defaultCategory() {
313 return "User";
314 }
315
316 public int defaultDisplayOrder() {
317 return 2050;
318 }
319 }
320