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.sql.Timestamp;
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.EverythingDatabaseTables;
13 import org.melati.poem.test.TimestampField;
14 import org.melati.poem.test.TimestampFieldTable;
15
16
17 /**
18 * Melati POEM generated abstract base class for a <code>Persistent</code>
19 * <code>TimestampField</code> Object.
20 *
21 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
22 */
23 public abstract class TimestampFieldBase 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>TimestampFieldTable</code> table
39 * which this <code>Persistent</code> is from.
40 *
41 * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava
42 * @return the TimestampFieldTable
43 */
44 @SuppressWarnings("unchecked")
45 public TimestampFieldTable<TimestampField> getTimestampFieldTable() {
46 return (TimestampFieldTable<TimestampField>)getTable();
47 }
48
49 @SuppressWarnings("unchecked")
50 private TimestampFieldTable<TimestampField> _getTimestampFieldTable() {
51 return (TimestampFieldTable<TimestampField>)getTable();
52 }
53
54 // Fields in this table
55 /**
56 * Id
57 */
58 protected Integer id;
59 /**
60 * Timestamp Field
61 */
62 protected Timestamp timestampfield;
63
64
65 /**
66 * Retrieves the <code>Id</code> value, without locking,
67 * for this <code>TimestampField</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 TimestampField <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>TimestampField</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>TimestampField</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>TimestampField</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 _getTimestampFieldTable().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>TimestampField</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>TimestampField</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 = _getTimestampFieldTable().getIdColumn();
158 return new Field<Integer>((Integer)c.getRaw(this), c);
159 }
160
161
162 /**
163 * Retrieves the <code>Timestampfield</code> value, without locking,
164 * for this <code>TimestampField</code> <code>Persistent</code>.
165 *
166 * see org.melati.poem.prepro.FieldDef#generateBaseMethods
167 * @return the Timestamp timestampfield
168 */
169 public Timestamp getTimestampfield_unsafe() {
170 return timestampfield;
171 }
172
173
174 /**
175 * Sets the <code>Timestampfield</code> value directly, without checking,
176 * for this TimestampField <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 setTimestampfield_unsafe(Timestamp cooked) {
182 timestampfield = cooked;
183 }
184
185 /**
186 * Retrieves the Timestampfield value, with locking, for this
187 * <code>TimestampField</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>Timestampfield</code> for this
194 * <code>TimestampField</code> <code>Persistent</code>
195 */
196
197 public Timestamp getTimestampfield()
198 throws AccessPoemException {
199 readLock();
200 return getTimestampfield_unsafe();
201 }
202
203
204 /**
205 * Sets the <code>Timestampfield</code> value, with checking, for this
206 * <code>TimestampField</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 setTimestampfield(Timestamp cooked)
217 throws AccessPoemException, ValidationPoemException {
218 _getTimestampFieldTable().getTimestampfieldColumn().
219 getType().assertValidCooked(cooked);
220 writeLock();
221 setTimestampfield_unsafe(cooked);
222 }
223
224
225 /**
226 * Retrieves the <code>Timestampfield</code> value as a <code>Field</code>
227 * from this <code>TimestampField</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 Timestamp timestampfield
234 */
235 public Field<Timestamp> getTimestampfieldField() throws AccessPoemException {
236 Column<Timestamp> c = _getTimestampFieldTable().getTimestampfieldColumn();
237 return new Field<Timestamp>((Timestamp)c.getRaw(this), c);
238 }
239
240 }
241