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.BooleanField;
12 import org.melati.poem.test.BooleanFieldTable;
13 import org.melati.poem.test.EverythingDatabaseTables;
14
15
16 /**
17 * Melati POEM generated abstract base class for a <code>Persistent</code>
18 * <code>BooleanField</code> Object.
19 *
20 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
21 */
22 public abstract class BooleanFieldBase 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>BooleanFieldTable</code> table
38 * which this <code>Persistent</code> is from.
39 *
40 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
41 * @return the BooleanFieldTable
42 */
43 @SuppressWarnings("unchecked")
44 public BooleanFieldTable<BooleanField> getBooleanFieldTable() {
45 return (BooleanFieldTable<BooleanField>)getTable();
46 }
47
48 @SuppressWarnings("unchecked")
49 private BooleanFieldTable<BooleanField> _getBooleanFieldTable() {
50 return (BooleanFieldTable<BooleanField>)getTable();
51 }
52
53 // Fields in this table
54 /**
55 * Id
56 */
57 protected Integer id;
58 /**
59 * Boolean Field
60 */
61 protected Boolean booleanfield;
62
63
64 /**
65 * Retrieves the <code>Id</code> value, without locking,
66 * for this <code>BooleanField</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 BooleanField <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>BooleanField</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>BooleanField</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>BooleanField</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 _getBooleanFieldTable().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>BooleanField</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>BooleanField</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 = _getBooleanFieldTable().getIdColumn();
157 return new Field<Integer>((Integer)c.getRaw(this), c);
158 }
159
160
161 /**
162 * Retrieves the <code>Booleanfield</code> value, without locking,
163 * for this <code>BooleanField</code> <code>Persistent</code>.
164 *
165 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
166 * @return the Boolean booleanfield
167 */
168 public Boolean getBooleanfield_unsafe() {
169 return booleanfield;
170 }
171
172
173 /**
174 * Sets the <code>Booleanfield</code> value directly, without checking,
175 * for this BooleanField <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 setBooleanfield_unsafe(Boolean cooked) {
181 booleanfield = cooked;
182 }
183
184 /**
185 * Retrieves the Booleanfield value, with locking, for this
186 * <code>BooleanField</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>Booleanfield</code> for this
193 * <code>BooleanField</code> <code>Persistent</code>
194 */
195
196 public Boolean getBooleanfield()
197 throws AccessPoemException {
198 readLock();
199 return getBooleanfield_unsafe();
200 }
201
202
203 /**
204 * Sets the <code>Booleanfield</code> value, with checking, for this
205 * <code>BooleanField</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 setBooleanfield(Boolean cooked)
216 throws AccessPoemException, ValidationPoemException {
217 _getBooleanFieldTable().getBooleanfieldColumn().
218 getType().assertValidCooked(cooked);
219 writeLock();
220 setBooleanfield_unsafe(cooked);
221 }
222
223 /**
224 * Sets the <code>Booleanfield</code> value, with checking,
225 * from a <code>boolean</code>, for this
226 * <code>BooleanField</code> <code>Persistent</code>.
227 *
228 * Generated by org.melati.poem.prepro.BooleanFieldDef#generateBaseMethods
229 * @param cooked a <code>boolean</code>
230 * @throws AccessPoemException
231 * if the current <code>AccessToken</code>
232 * does not confer write access rights
233 * @throws ValidationPoemException
234 * if the value is not valid
235 */
236
237 public final void setBooleanfield(boolean cooked)
238 throws AccessPoemException, ValidationPoemException {
239 setBooleanfield(cooked ? Boolean.TRUE : Boolean.FALSE);
240 }
241
242
243 /**
244 * Retrieves the <code>Booleanfield</code> value as a <code>Field</code>
245 * from this <code>BooleanField</code> <code>Persistent</code>.
246 *
247 * see org.melati.poem.prepro.FieldDef#generateFieldCreator
248 * @throws AccessPoemException
249 * if the current <code>AccessToken</code>
250 * does not confer write access rights
251 * @return the Boolean booleanfield
252 */
253 public Field<Boolean> getBooleanfieldField() throws AccessPoemException {
254 Column<Boolean> c = _getBooleanFieldTable().getBooleanfieldColumn();
255 return new Field<Boolean>((Boolean)c.getRaw(this), c);
256 }
257
258 }
259