1 // Do not edit this file! It was generated by Melati POEM's DSD preprocessor.
2
3 package org.melati.poem.test.generated;
4
5
6 import org.melati.poem.AccessPoemException;
7 import org.melati.poem.Column;
8 import org.melati.poem.Field;
9 import org.melati.poem.JdbcPersistent;
10 import org.melati.poem.ValidationPoemException;
11 import org.melati.poem.test.BinaryField;
12 import org.melati.poem.test.BinaryFieldTable;
13 import org.melati.poem.test.EverythingDatabaseTables;
14
15
16 /**
17 * Melati POEM generated abstract base class for a <code>Persistent</code>
18 * <code>BinaryField</code> Object.
19 *
20 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
21 */
22 public abstract class BinaryFieldBase extends JdbcPersistent {
23
24
25 /**
26 * Retrieves the Database object.
27 *
28 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
29 * @return the database
30 */
31 public EverythingDatabaseTables getEverythingDatabaseTables() {
32 return (EverythingDatabaseTables)getDatabase();
33 }
34
35
36 /**
37 * Retrieves the <code>BinaryFieldTable</code> table
38 * which this <code>Persistent</code> is from.
39 *
40 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
41 * @return the BinaryFieldTable
42 */
43 @SuppressWarnings("unchecked")
44 public BinaryFieldTable<BinaryField> getBinaryFieldTable() {
45 return (BinaryFieldTable<BinaryField>)getTable();
46 }
47
48 @SuppressWarnings("unchecked")
49 private BinaryFieldTable<BinaryField> _getBinaryFieldTable() {
50 return (BinaryFieldTable<BinaryField>)getTable();
51 }
52
53 // Fields in this table
54 /**
55 * Id
56 */
57 protected Integer id;
58 /**
59 * Binaryfield
60 */
61 protected byte[] binaryfield;
62 /**
63 * Binaryfield
64 */
65 protected byte[] unlimited;
66
67
68 /**
69 * Retrieves the <code>Id</code> value, without locking,
70 * for this <code>BinaryField</code> <code>Persistent</code>.
71 *
72 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
73 * @return the Integer id
74 */
75 public Integer getId_unsafe() {
76 return id;
77 }
78
79
80 /**
81 * Sets the <code>Id</code> value directly, without checking,
82 * for this BinaryField <code>Persistent</code>.
83 *
84 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
85 * @param cooked the pre-validated value to set
86 */
87 public void setId_unsafe(Integer cooked) {
88 id = cooked;
89 }
90
91 /**
92 * Retrieves the Id value, with locking, for this
93 * <code>BinaryField</code> <code>Persistent</code>.
94 *
95 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
96 * @throws AccessPoemException
97 * if the current <code>AccessToken</code>
98 * does not confer write access rights
99 * @return the value of the field <code>Id</code> for this
100 * <code>BinaryField</code> <code>Persistent</code>
101 */
102
103 public Integer getId()
104 throws AccessPoemException {
105 readLock();
106 return getId_unsafe();
107 }
108
109
110 /**
111 * Sets the <code>Id</code> value, with checking, for this
112 * <code>BinaryField</code> <code>Persistent</code>.
113 *
114 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
115 * @param cooked a validated <code>int</code>
116 * @throws AccessPoemException
117 * if the current <code>AccessToken</code>
118 * does not confer write access rights
119 * @throws ValidationPoemException
120 * if the value is not valid
121 */
122 public void setId(Integer cooked)
123 throws AccessPoemException, ValidationPoemException {
124 _getBinaryFieldTable().getIdColumn().
125 getType().assertValidCooked(cooked);
126 writeLock();
127 setId_unsafe(cooked);
128 }
129
130 /**
131 * Sets the <code>Id</code> value, with checking, for this
132 * <code>BinaryField</code> <code>Persistent</code>.
133 *
134 * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
135 * @param cooked a validated <code>int</code>
136 * @throws AccessPoemException
137 * if the current <code>AccessToken</code>
138 * does not confer write access rights
139 * @throws ValidationPoemException
140 * if the value is not valid
141 */
142
143 public final void setId(int cooked)
144 throws AccessPoemException, ValidationPoemException {
145 setId(new Integer(cooked));
146 }
147
148
149 /**
150 * Retrieves the <code>Id</code> value as a <code>Field</code>
151 * from this <code>BinaryField</code> <code>Persistent</code>.
152 *
153 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
154 * @throws AccessPoemException
155 * if the current <code>AccessToken</code>
156 * does not confer write access rights
157 * @return the Integer id
158 */
159 public Field<Integer> getIdField() throws AccessPoemException {
160 Column<Integer> c = _getBinaryFieldTable().getIdColumn();
161 return new Field<Integer>((Integer)c.getRaw(this), c);
162 }
163
164
165 /**
166 * Retrieves the <code>Binaryfield</code> value, without locking,
167 * for this <code>BinaryField</code> <code>Persistent</code>.
168 *
169 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
170 * @return the byte[] binaryfield
171 */
172 public byte[] getBinaryfield_unsafe() {
173 return binaryfield;
174 }
175
176
177 /**
178 * Sets the <code>Binaryfield</code> value directly, without checking,
179 * for this BinaryField <code>Persistent</code>.
180 *
181 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
182 * @param cooked the pre-validated value to set
183 */
184 public void setBinaryfield_unsafe(byte[] cooked) {
185 binaryfield = cooked;
186 }
187
188 /**
189 * Retrieves the Binaryfield value, with locking, for this
190 * <code>BinaryField</code> <code>Persistent</code>.
191 *
192 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
193 * @throws AccessPoemException
194 * if the current <code>AccessToken</code>
195 * does not confer write access rights
196 * @return the value of the field <code>Binaryfield</code> for this
197 * <code>BinaryField</code> <code>Persistent</code>
198 */
199
200 public byte[] getBinaryfield()
201 throws AccessPoemException {
202 readLock();
203 return getBinaryfield_unsafe();
204 }
205
206
207 /**
208 * Sets the <code>Binaryfield</code> value, with checking, for this
209 * <code>BinaryField</code> <code>Persistent</code>.
210 *
211 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
212 * @param cooked a validated <code>int</code>
213 * @throws AccessPoemException
214 * if the current <code>AccessToken</code>
215 * does not confer write access rights
216 * @throws ValidationPoemException
217 * if the value is not valid
218 */
219 public void setBinaryfield(byte[] cooked)
220 throws AccessPoemException, ValidationPoemException {
221 _getBinaryFieldTable().getBinaryfieldColumn().
222 getType().assertValidCooked(cooked);
223 writeLock();
224 setBinaryfield_unsafe(cooked);
225 }
226
227
228 /**
229 * Retrieves the <code>Binaryfield</code> value as a <code>Field</code>
230 * from this <code>BinaryField</code> <code>Persistent</code>.
231 *
232 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
233 * @throws AccessPoemException
234 * if the current <code>AccessToken</code>
235 * does not confer write access rights
236 * @return the byte[] binaryfield
237 */
238 public Field<byte[]> getBinaryfieldField() throws AccessPoemException {
239 Column<byte[]> c = _getBinaryFieldTable().getBinaryfieldColumn();
240 return new Field<byte[]>((byte[])c.getRaw(this), c);
241 }
242
243
244 /**
245 * Retrieves the <code>Unlimited</code> value, without locking,
246 * for this <code>BinaryField</code> <code>Persistent</code>.
247 *
248 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
249 * @return the byte[] unlimited
250 */
251 public byte[] getUnlimited_unsafe() {
252 return unlimited;
253 }
254
255
256 /**
257 * Sets the <code>Unlimited</code> value directly, without checking,
258 * for this BinaryField <code>Persistent</code>.
259 *
260 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
261 * @param cooked the pre-validated value to set
262 */
263 public void setUnlimited_unsafe(byte[] cooked) {
264 unlimited = cooked;
265 }
266
267 /**
268 * Retrieves the Unlimited value, with locking, for this
269 * <code>BinaryField</code> <code>Persistent</code>.
270 *
271 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
272 * @throws AccessPoemException
273 * if the current <code>AccessToken</code>
274 * does not confer write access rights
275 * @return the value of the field <code>Unlimited</code> for this
276 * <code>BinaryField</code> <code>Persistent</code>
277 */
278
279 public byte[] getUnlimited()
280 throws AccessPoemException {
281 readLock();
282 return getUnlimited_unsafe();
283 }
284
285
286 /**
287 * Sets the <code>Unlimited</code> value, with checking, for this
288 * <code>BinaryField</code> <code>Persistent</code>.
289 *
290 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
291 * @param cooked a validated <code>int</code>
292 * @throws AccessPoemException
293 * if the current <code>AccessToken</code>
294 * does not confer write access rights
295 * @throws ValidationPoemException
296 * if the value is not valid
297 */
298 public void setUnlimited(byte[] cooked)
299 throws AccessPoemException, ValidationPoemException {
300 _getBinaryFieldTable().getUnlimitedColumn().
301 getType().assertValidCooked(cooked);
302 writeLock();
303 setUnlimited_unsafe(cooked);
304 }
305
306
307 /**
308 * Retrieves the <code>Unlimited</code> value as a <code>Field</code>
309 * from this <code>BinaryField</code> <code>Persistent</code>.
310 *
311 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
312 * @throws AccessPoemException
313 * if the current <code>AccessToken</code>
314 * does not confer write access rights
315 * @return the byte[] unlimited
316 */
317 public Field<byte[]> getUnlimitedField() throws AccessPoemException {
318 Column<byte[]> c = _getBinaryFieldTable().getUnlimitedColumn();
319 return new Field<byte[]>((byte[])c.getRaw(this), c);
320 }
321
322 }
323