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.EverythingDatabaseTables;
12 import org.melati.poem.test.IntegerField;
13 import org.melati.poem.test.IntegerFieldTable;
14
15
16 /**
17 * Melati POEM generated abstract base class for a <code>Persistent</code>
18 * <code>IntegerField</code> Object.
19 *
20 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
21 */
22 public abstract class IntegerFieldBase 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>IntegerFieldTable</code> table
38 * which this <code>Persistent</code> is from.
39 *
40 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
41 * @return the IntegerFieldTable
42 */
43 @SuppressWarnings("unchecked")
44 public IntegerFieldTable<IntegerField> getIntegerFieldTable() {
45 return (IntegerFieldTable<IntegerField>)getTable();
46 }
47
48 @SuppressWarnings("unchecked")
49 private IntegerFieldTable<IntegerField> _getIntegerFieldTable() {
50 return (IntegerFieldTable<IntegerField>)getTable();
51 }
52
53 // Fields in this table
54 /**
55 * Id
56 */
57 protected Integer id;
58 /**
59 * Integer Field
60 */
61 protected Integer integerfield;
62
63
64 /**
65 * Retrieves the <code>Id</code> value, without locking,
66 * for this <code>IntegerField</code> <code>Persistent</code>.
67 *
68 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
69 * @return the Integer id
70 */
71 public Integer getId_unsafe() {
72 return id;
73 }
74
75
76 /**
77 * Sets the <code>Id</code> value directly, without checking,
78 * for this IntegerField <code>Persistent</code>.
79 *
80 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
81 * @param cooked the pre-validated value to set
82 */
83 public void setId_unsafe(Integer cooked) {
84 id = cooked;
85 }
86
87 /**
88 * Retrieves the Id value, with locking, for this
89 * <code>IntegerField</code> <code>Persistent</code>.
90 *
91 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
92 * @throws AccessPoemException
93 * if the current <code>AccessToken</code>
94 * does not confer write access rights
95 * @return the value of the field <code>Id</code> for this
96 * <code>IntegerField</code> <code>Persistent</code>
97 */
98
99 public Integer getId()
100 throws AccessPoemException {
101 readLock();
102 return getId_unsafe();
103 }
104
105
106 /**
107 * Sets the <code>Id</code> value, with checking, for this
108 * <code>IntegerField</code> <code>Persistent</code>.
109 *
110 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
111 * @param cooked a validated <code>int</code>
112 * @throws AccessPoemException
113 * if the current <code>AccessToken</code>
114 * does not confer write access rights
115 * @throws ValidationPoemException
116 * if the value is not valid
117 */
118 public void setId(Integer cooked)
119 throws AccessPoemException, ValidationPoemException {
120 _getIntegerFieldTable().getIdColumn().
121 getType().assertValidCooked(cooked);
122 writeLock();
123 setId_unsafe(cooked);
124 }
125
126 /**
127 * Sets the <code>Id</code> value, with checking, for this
128 * <code>IntegerField</code> <code>Persistent</code>.
129 *
130 * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
131 * @param cooked a validated <code>int</code>
132 * @throws AccessPoemException
133 * if the current <code>AccessToken</code>
134 * does not confer write access rights
135 * @throws ValidationPoemException
136 * if the value is not valid
137 */
138
139 public final void setId(int cooked)
140 throws AccessPoemException, ValidationPoemException {
141 setId(new Integer(cooked));
142 }
143
144
145 /**
146 * Retrieves the <code>Id</code> value as a <code>Field</code>
147 * from this <code>IntegerField</code> <code>Persistent</code>.
148 *
149 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
150 * @throws AccessPoemException
151 * if the current <code>AccessToken</code>
152 * does not confer write access rights
153 * @return the Integer id
154 */
155 public Field<Integer> getIdField() throws AccessPoemException {
156 Column<Integer> c = _getIntegerFieldTable().getIdColumn();
157 return new Field<Integer>((Integer)c.getRaw(this), c);
158 }
159
160
161 /**
162 * Retrieves the <code>Integerfield</code> value, without locking,
163 * for this <code>IntegerField</code> <code>Persistent</code>.
164 *
165 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
166 * @return the Integer integerfield
167 */
168 public Integer getIntegerfield_unsafe() {
169 return integerfield;
170 }
171
172
173 /**
174 * Sets the <code>Integerfield</code> value directly, without checking,
175 * for this IntegerField <code>Persistent</code>.
176 *
177 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
178 * @param cooked the pre-validated value to set
179 */
180 public void setIntegerfield_unsafe(Integer cooked) {
181 integerfield = cooked;
182 }
183
184 /**
185 * Retrieves the Integerfield value, with locking, for this
186 * <code>IntegerField</code> <code>Persistent</code>.
187 *
188 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
189 * @throws AccessPoemException
190 * if the current <code>AccessToken</code>
191 * does not confer write access rights
192 * @return the value of the field <code>Integerfield</code> for this
193 * <code>IntegerField</code> <code>Persistent</code>
194 */
195
196 public Integer getIntegerfield()
197 throws AccessPoemException {
198 readLock();
199 return getIntegerfield_unsafe();
200 }
201
202
203 /**
204 * Sets the <code>Integerfield</code> value, with checking, for this
205 * <code>IntegerField</code> <code>Persistent</code>.
206 *
207 * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
208 * @param cooked a validated <code>int</code>
209 * @throws AccessPoemException
210 * if the current <code>AccessToken</code>
211 * does not confer write access rights
212 * @throws ValidationPoemException
213 * if the value is not valid
214 */
215 public void setIntegerfield(Integer cooked)
216 throws AccessPoemException, ValidationPoemException {
217 _getIntegerFieldTable().getIntegerfieldColumn().
218 getType().assertValidCooked(cooked);
219 writeLock();
220 setIntegerfield_unsafe(cooked);
221 }
222
223 /**
224 * Sets the <code>Integerfield</code> value, with checking, for this
225 * <code>IntegerField</code> <code>Persistent</code>.
226 *
227 * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
228 * @param cooked a validated <code>int</code>
229 * @throws AccessPoemException
230 * if the current <code>AccessToken</code>
231 * does not confer write access rights
232 * @throws ValidationPoemException
233 * if the value is not valid
234 */
235
236 public final void setIntegerfield(int cooked)
237 throws AccessPoemException, ValidationPoemException {
238 setIntegerfield(new Integer(cooked));
239 }
240
241
242 /**
243 * Retrieves the <code>Integerfield</code> value as a <code>Field</code>
244 * from this <code>IntegerField</code> <code>Persistent</code>.
245 *
246 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
247 * @throws AccessPoemException
248 * if the current <code>AccessToken</code>
249 * does not confer write access rights
250 * @return the Integer integerfield
251 */
252 public Field<Integer> getIntegerfieldField() throws AccessPoemException {
253 Column<Integer> c = _getIntegerFieldTable().getIntegerfieldColumn();
254 return new Field<Integer>((Integer)c.getRaw(this), c);
255 }
256
257 }
258