1
2
3 package org.melati.poem.test.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.Column;
12 import org.melati.poem.Field;
13 import org.melati.poem.GroupMembership;
14
15 import org.melati.poem.User;
16 import org.melati.poem.ValidationPoemException;
17 import org.melati.poem.test.Account;
18 import org.melati.poem.test.EverythingDatabaseTables;
19 import org.melati.poem.test.Protected;
20
21
22
23
24 import org.melati.poem.util.EmptyEnumeration;
25
26
27
28
29
30
31
32
33 public abstract class UserBase extends org.melati.poem.User {
34
35
36
37
38
39
40
41
42 public EverythingDatabaseTables getEverythingDatabaseTables() {
43 return (EverythingDatabaseTables)getDatabase();
44 }
45
46
47
48
49
50
51
52
53
54 @SuppressWarnings("unchecked")
55 public org.melati.poem.UserTable<org.melati.poem.User> getUserTable() {
56 return (org.melati.poem.UserTable<org.melati.poem.User>)getTable();
57 }
58
59 @SuppressWarnings("unchecked")
60 private org.melati.poem.test.UserTable<org.melati.poem.test.User> _getUserTable() {
61 return (org.melati.poem.test.UserTable<org.melati.poem.test.User>)getTable();
62 }
63
64
65
66
67
68 protected String email;
69
70
71
72
73
74
75
76
77
78 public String getEmail_unsafe() {
79 return email;
80 }
81
82
83
84
85
86
87
88
89
90 public void setEmail_unsafe(String cooked) {
91 email = cooked;
92 }
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 public String getEmail()
109 throws AccessPoemException {
110 readLock();
111 return getEmail_unsafe();
112 }
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129 public void setEmail(String cooked)
130 throws AccessPoemException, ValidationPoemException {
131 _getUserTable().getEmailColumn().
132 getType().assertValidCooked(cooked);
133 writeLock();
134 setEmail_unsafe(cooked);
135 }
136
137
138
139
140
141
142
143
144
145
146
147
148 public Field<String> getEmailField() throws AccessPoemException {
149 Column<String> c = _getUserTable().getEmailColumn();
150 return new Field<String>((String)c.getRaw(this), c);
151 }
152
153 private CachedSelection<GroupMembership> userGroupMemberships = null;
154
155 @SuppressWarnings("unchecked")
156 public Enumeration<GroupMembership> getUserGroupMemberships() {
157 if (getTroid() == null)
158 return new EmptyEnumeration<GroupMembership>();
159 else {
160 if (userGroupMemberships == null)
161 userGroupMemberships =
162 getEverythingDatabaseTables().getGroupMembershipTable().getUserColumn().cachedSelectionWhereEq(getTroid());
163 return userGroupMemberships.objects();
164 }
165 }
166
167
168
169 public List<GroupMembership> getUserGroupMembershipList() {
170 return Collections.list(getUserGroupMemberships());
171 }
172
173
174
175 private CachedSelection<Protected> spyProtecteds = null;
176
177 @SuppressWarnings("unchecked")
178 public Enumeration<Protected> getSpyProtecteds() {
179 if (getTroid() == null)
180 return new EmptyEnumeration<Protected>();
181 else {
182 if (spyProtecteds == null)
183 spyProtecteds =
184 getEverythingDatabaseTables().getProtectedTable().getSpyColumn().cachedSelectionWhereEq(getTroid());
185 return spyProtecteds.objects();
186 }
187 }
188
189
190
191 public List<Protected> getSpyProtectedList() {
192 return Collections.list(getSpyProtecteds());
193 }
194
195
196
197 private CachedSelection<Account> userAccounts = null;
198
199 @SuppressWarnings("unchecked")
200 public Enumeration<Account> getUserAccounts() {
201 if (getTroid() == null)
202 return new EmptyEnumeration<Account>();
203 else {
204 if (userAccounts == null)
205 userAccounts =
206 getEverythingDatabaseTables().getAccountTable().getUserColumn().cachedSelectionWhereEq(getTroid());
207 return userAccounts.objects();
208 }
209 }
210
211
212
213 public List<Account> getUserAccountList() {
214 return Collections.list(getUserAccounts());
215 }
216
217
218
219 }
220