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.BibliomaniaDatabaseTables; |
20 | |
import org.paneris.bibliomania.BibliomaniaTable; |
21 | |
import org.paneris.bibliomania.Download; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class DownloadTableBase<T extends Download> extends BibliomaniaTable<T> { |
31 | |
|
32 | 2 | private Column<Integer> col_id = null; |
33 | 2 | private Column<String> col_filename = null; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
public DownloadTableBase( |
46 | |
Database database, String name, |
47 | |
DefinitionSource definitionSource) throws PoemException { |
48 | 2 | super(database, name, definitionSource); |
49 | 2 | } |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
public BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() { |
59 | 0 | return (BibliomaniaDatabaseTables)getDatabase(); |
60 | |
} |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
public void init() throws PoemException { |
69 | 2 | super.init(); |
70 | 2 | defineColumn(col_id = |
71 | |
new Column<Integer>(this, "id", |
72 | |
new TroidPoemType(), |
73 | 2 | DefinitionSource.dsd) { |
74 | |
public Object getCooked(Persistent g) |
75 | |
throws AccessPoemException, PoemException { |
76 | 0 | return ((Download)g).getId(); |
77 | |
} |
78 | |
|
79 | |
public void setCooked(Persistent g, Object cooked) |
80 | |
throws AccessPoemException, ValidationPoemException { |
81 | 0 | ((Download)g).setId((Integer)cooked); |
82 | 0 | } |
83 | |
|
84 | |
public Field<Integer> asField(Persistent g) { |
85 | 0 | return ((Download)g).getIdField(); |
86 | |
} |
87 | |
|
88 | |
public boolean defaultUserEditable() { |
89 | 0 | return false; |
90 | |
} |
91 | |
|
92 | |
public boolean defaultUserCreateable() { |
93 | 0 | return false; |
94 | |
} |
95 | |
|
96 | |
public DisplayLevel defaultDisplayLevel() { |
97 | 0 | return DisplayLevel.summary; |
98 | |
} |
99 | |
|
100 | |
public Searchability defaultSearchability() { |
101 | 0 | return Searchability.no; |
102 | |
} |
103 | |
|
104 | |
public int defaultDisplayOrder() { |
105 | 0 | return 0; |
106 | |
} |
107 | |
|
108 | |
public Object getRaw_unsafe(Persistent g) |
109 | |
throws AccessPoemException { |
110 | 0 | return ((Download)g).getId_unsafe(); |
111 | |
} |
112 | |
|
113 | |
public void setRaw_unsafe(Persistent g, Object raw) |
114 | |
throws AccessPoemException { |
115 | 0 | ((Download)g).setId_unsafe((Integer)raw); |
116 | 0 | } |
117 | |
|
118 | |
public Object getRaw(Persistent g) |
119 | |
throws AccessPoemException { |
120 | 0 | return ((Download)g).getId(); |
121 | |
} |
122 | |
|
123 | |
public void setRaw(Persistent g, Object raw) |
124 | |
throws AccessPoemException { |
125 | 0 | ((Download)g).setId((Integer)raw); |
126 | 0 | } |
127 | |
}); |
128 | |
|
129 | 2 | defineColumn(col_filename = |
130 | |
new Column<String>(this, "filename", |
131 | |
new StringPoemType(true, -1), |
132 | 2 | DefinitionSource.dsd) { |
133 | |
public Object getCooked(Persistent g) |
134 | |
throws AccessPoemException, PoemException { |
135 | 0 | return ((Download)g).getFilename(); |
136 | |
} |
137 | |
|
138 | |
public void setCooked(Persistent g, Object cooked) |
139 | |
throws AccessPoemException, ValidationPoemException { |
140 | 0 | ((Download)g).setFilename((String)cooked); |
141 | 0 | } |
142 | |
|
143 | |
public Field<String> asField(Persistent g) { |
144 | 0 | return ((Download)g).getFilenameField(); |
145 | |
} |
146 | |
|
147 | |
public DisplayLevel defaultDisplayLevel() { |
148 | 0 | return DisplayLevel.primary; |
149 | |
} |
150 | |
|
151 | |
public Searchability defaultSearchability() { |
152 | 0 | return Searchability.yes; |
153 | |
} |
154 | |
|
155 | |
public String defaultDisplayName() { |
156 | 0 | return "File Name"; |
157 | |
} |
158 | |
|
159 | |
public int defaultDisplayOrder() { |
160 | 0 | return 1; |
161 | |
} |
162 | |
|
163 | |
public String defaultDescription() { |
164 | 0 | return "A file which can be downloaded"; |
165 | |
} |
166 | |
|
167 | |
public int defaultWidth() { |
168 | 0 | return 40; |
169 | |
} |
170 | |
|
171 | |
public Object getRaw_unsafe(Persistent g) |
172 | |
throws AccessPoemException { |
173 | 0 | return ((Download)g).getFilename_unsafe(); |
174 | |
} |
175 | |
|
176 | |
public void setRaw_unsafe(Persistent g, Object raw) |
177 | |
throws AccessPoemException { |
178 | 0 | ((Download)g).setFilename_unsafe((String)raw); |
179 | 0 | } |
180 | |
|
181 | |
public Object getRaw(Persistent g) |
182 | |
throws AccessPoemException { |
183 | 0 | return ((Download)g).getFilename(); |
184 | |
} |
185 | |
|
186 | |
public void setRaw(Persistent g, Object raw) |
187 | |
throws AccessPoemException { |
188 | 0 | ((Download)g).setFilename((String)raw); |
189 | 0 | } |
190 | |
}); |
191 | 2 | } |
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
|
201 | |
public final Column<Integer> getIdColumn() { |
202 | 0 | return col_id; |
203 | |
} |
204 | |
|
205 | |
|
206 | |
|
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
|
212 | |
|
213 | |
public final Column<String> getFilenameColumn() { |
214 | 0 | return col_filename; |
215 | |
} |
216 | |
|
217 | |
|
218 | |
|
219 | |
|
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
|
225 | |
public Download getDownloadObject(Integer troid) { |
226 | 0 | return (Download)getObject(troid); |
227 | |
} |
228 | |
|
229 | |
|
230 | |
|
231 | |
|
232 | |
|
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
public Download getDownloadObject(int troid) { |
238 | 0 | return (Download)getObject(troid); |
239 | |
} |
240 | |
|
241 | |
protected JdbcPersistent _newPersistent() { |
242 | 0 | return new Download(); |
243 | |
} |
244 | |
public String defaultDisplayName() { |
245 | 0 | return "Download"; |
246 | |
} |
247 | |
|
248 | |
public String defaultDescription() { |
249 | 0 | return "A downloadable file"; |
250 | |
} |
251 | |
|
252 | |
public Integer defaultCacheLimit() { |
253 | 0 | return new Integer(999999999); |
254 | |
} |
255 | |
|
256 | |
public String defaultCategory() { |
257 | 0 | return "Shop"; |
258 | |
} |
259 | |
|
260 | |
public int defaultDisplayOrder() { |
261 | 0 | return 1240; |
262 | |
} |
263 | |
} |
264 | |
|