1
2
3 package org.melati.poem.generated;
4
5
6 import java.util.Collections;
7 import java.util.Enumeration;
8 import java.util.List;
9 import org.melati.poem.AccessPoemException;
10 import org.melati.poem.CachedSelection;
11 import org.melati.poem.Capability;
12 import org.melati.poem.CapabilityTable;
13 import org.melati.poem.Column;
14 import org.melati.poem.Field;
15 import org.melati.poem.GroupCapability;
16 import org.melati.poem.JdbcPersistent;
17 import org.melati.poem.PoemDatabaseTables;
18 import org.melati.poem.TableInfo;
19 import org.melati.poem.ValidationPoemException;
20 import org.melati.poem.util.EmptyEnumeration;
21
22
23
24
25
26
27
28
29 public abstract class CapabilityBase extends JdbcPersistent {
30
31
32
33
34
35
36
37
38 public PoemDatabaseTables getPoemDatabaseTables() {
39 return (PoemDatabaseTables)getDatabase();
40 }
41
42
43
44
45
46
47
48
49
50 @SuppressWarnings("unchecked")
51 public CapabilityTable<Capability> getCapabilityTable() {
52 return (CapabilityTable<Capability>)getTable();
53 }
54
55 @SuppressWarnings("unchecked")
56 private CapabilityTable<Capability> _getCapabilityTable() {
57 return (CapabilityTable<Capability>)getTable();
58 }
59
60
61
62
63
64 protected Integer id;
65
66
67
68 protected String name;
69
70
71
72
73
74
75
76
77
78 public Integer getId_unsafe() {
79 return id;
80 }
81
82
83
84
85
86
87
88
89
90 public void setId_unsafe(Integer cooked) {
91 id = cooked;
92 }
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 public Integer getId()
109 throws AccessPoemException {
110 readLock();
111 return getId_unsafe();
112 }
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129 public void setId(Integer cooked)
130 throws AccessPoemException, ValidationPoemException {
131 _getCapabilityTable().getIdColumn().
132 getType().assertValidCooked(cooked);
133 writeLock();
134 setId_unsafe(cooked);
135 }
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 public final void setId(int cooked)
154 throws AccessPoemException, ValidationPoemException {
155 setId(new Integer(cooked));
156 }
157
158
159
160
161
162
163
164
165
166
167
168
169 public Field<Integer> getIdField() throws AccessPoemException {
170 Column<Integer> c = _getCapabilityTable().getIdColumn();
171 return new Field<Integer>((Integer)c.getRaw(this), c);
172 }
173
174
175
176
177
178
179
180
181
182 public String getName_unsafe() {
183 return name;
184 }
185
186
187
188
189
190
191
192
193
194 public void setName_unsafe(String cooked) {
195 name = cooked;
196 }
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212 public String getName()
213 throws AccessPoemException {
214 readLock();
215 return getName_unsafe();
216 }
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233 public void setName(String cooked)
234 throws AccessPoemException, ValidationPoemException {
235 _getCapabilityTable().getNameColumn().
236 getType().assertValidCooked(cooked);
237 writeLock();
238 setName_unsafe(cooked);
239 }
240
241
242
243
244
245
246
247
248
249
250
251
252 public Field<String> getNameField() throws AccessPoemException {
253 Column<String> c = _getCapabilityTable().getNameColumn();
254 return new Field<String>((String)c.getRaw(this), c);
255 }
256
257 private CachedSelection<GroupCapability> capabilityGroupCapabilitys = null;
258
259 @SuppressWarnings("unchecked")
260 public Enumeration<GroupCapability> getCapabilityGroupCapabilitys() {
261 if (getTroid() == null)
262 return new EmptyEnumeration<GroupCapability>();
263 else {
264 if (capabilityGroupCapabilitys == null)
265 capabilityGroupCapabilitys =
266 getPoemDatabaseTables().getGroupCapabilityTable().getCapabilityColumn().cachedSelectionWhereEq(getTroid());
267 return capabilityGroupCapabilitys.objects();
268 }
269 }
270
271
272
273 public List<GroupCapability> getCapabilityGroupCapabilityList() {
274 return Collections.list(getCapabilityGroupCapabilitys());
275 }
276
277
278
279 private CachedSelection<TableInfo> defaultcanreadTableInfos = null;
280
281 @SuppressWarnings("unchecked")
282 public Enumeration<TableInfo> getDefaultcanreadTableInfos() {
283 if (getTroid() == null)
284 return new EmptyEnumeration<TableInfo>();
285 else {
286 if (defaultcanreadTableInfos == null)
287 defaultcanreadTableInfos =
288 getPoemDatabaseTables().getTableInfoTable().getDefaultcanreadColumn().cachedSelectionWhereEq(getTroid());
289 return defaultcanreadTableInfos.objects();
290 }
291 }
292
293
294
295 public List<TableInfo> getDefaultcanreadTableInfoList() {
296 return Collections.list(getDefaultcanreadTableInfos());
297 }
298
299
300
301 private CachedSelection<TableInfo> defaultcanwriteTableInfos = null;
302
303 @SuppressWarnings("unchecked")
304 public Enumeration<TableInfo> getDefaultcanwriteTableInfos() {
305 if (getTroid() == null)
306 return new EmptyEnumeration<TableInfo>();
307 else {
308 if (defaultcanwriteTableInfos == null)
309 defaultcanwriteTableInfos =
310 getPoemDatabaseTables().getTableInfoTable().getDefaultcanwriteColumn().cachedSelectionWhereEq(getTroid());
311 return defaultcanwriteTableInfos.objects();
312 }
313 }
314
315
316
317 public List<TableInfo> getDefaultcanwriteTableInfoList() {
318 return Collections.list(getDefaultcanwriteTableInfos());
319 }
320
321
322
323 private CachedSelection<TableInfo> defaultcandeleteTableInfos = null;
324
325 @SuppressWarnings("unchecked")
326 public Enumeration<TableInfo> getDefaultcandeleteTableInfos() {
327 if (getTroid() == null)
328 return new EmptyEnumeration<TableInfo>();
329 else {
330 if (defaultcandeleteTableInfos == null)
331 defaultcandeleteTableInfos =
332 getPoemDatabaseTables().getTableInfoTable().getDefaultcandeleteColumn().cachedSelectionWhereEq(getTroid());
333 return defaultcandeleteTableInfos.objects();
334 }
335 }
336
337
338
339 public List<TableInfo> getDefaultcandeleteTableInfoList() {
340 return Collections.list(getDefaultcandeleteTableInfos());
341 }
342
343
344
345 private CachedSelection<TableInfo> cancreateTableInfos = null;
346
347 @SuppressWarnings("unchecked")
348 public Enumeration<TableInfo> getCancreateTableInfos() {
349 if (getTroid() == null)
350 return new EmptyEnumeration<TableInfo>();
351 else {
352 if (cancreateTableInfos == null)
353 cancreateTableInfos =
354 getPoemDatabaseTables().getTableInfoTable().getCancreateColumn().cachedSelectionWhereEq(getTroid());
355 return cancreateTableInfos.objects();
356 }
357 }
358
359
360
361 public List<TableInfo> getCancreateTableInfoList() {
362 return Collections.list(getCancreateTableInfos());
363 }
364
365
366
367 }
368