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