View Javadoc
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.StringField;
13  import org.melati.poem.test.StringFieldTable;
14  
15  
16  /**
17   * Melati POEM generated abstract base class for a <code>Persistent</code> 
18   * <code>StringField</code> Object.
19   *
20   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
21   */
22  public abstract class StringFieldBase 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>StringFieldTable</code> table 
38    * which this <code>Persistent</code> is from.
39    * 
40    * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
41    * @return the StringFieldTable
42    */
43    @SuppressWarnings("unchecked")
44    public StringFieldTable<StringField> getStringFieldTable() {
45      return (StringFieldTable<StringField>)getTable();
46    }
47  
48    @SuppressWarnings("unchecked")
49    private StringFieldTable<StringField> _getStringFieldTable() {
50      return (StringFieldTable<StringField>)getTable();
51    }
52  
53    // Fields in this table 
54   /**
55    * Id 
56    */
57    protected Integer id;
58   /**
59    * String Field 
60    */
61    protected String stringfield;
62   /**
63    * Unlimited String Field 
64    */
65    protected String unlimited;
66  
67  
68   /**
69    * Retrieves the <code>Id</code> value, without locking, 
70    * for this <code>StringField</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 StringField <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>StringField</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>StringField</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>StringField</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     _getStringFieldTable().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>StringField</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>StringField</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 = _getStringFieldTable().getIdColumn();
161     return new Field<Integer>((Integer)c.getRaw(this), c);
162   }
163 
164 
165  /**
166   * Retrieves the <code>Stringfield</code> value, without locking, 
167   * for this <code>StringField</code> <code>Persistent</code>.
168   *
169   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
170   * @return the String stringfield
171   */
172   public String getStringfield_unsafe() {
173     return stringfield;
174   }
175 
176 
177  /**
178   * Sets the <code>Stringfield</code> value directly, without checking, 
179   * for this StringField <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 setStringfield_unsafe(String cooked) {
185     stringfield = cooked;
186   }
187 
188  /**
189   * Retrieves the Stringfield value, with locking, for this 
190   * <code>StringField</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>Stringfield</code> for this 
197   *         <code>StringField</code> <code>Persistent</code>  
198   */
199 
200   public String getStringfield()
201       throws AccessPoemException {
202     readLock();
203     return getStringfield_unsafe();
204   }
205 
206 
207  /**
208   * Sets the <code>Stringfield</code> value, with checking, for this 
209   * <code>StringField</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 setStringfield(String cooked)
220       throws AccessPoemException, ValidationPoemException {
221     _getStringFieldTable().getStringfieldColumn().
222       getType().assertValidCooked(cooked);
223     writeLock();
224     setStringfield_unsafe(cooked);
225   }
226 
227 
228  /**
229   * Retrieves the <code>Stringfield</code> value as a <code>Field</code>
230   * from this <code>StringField</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 String stringfield
237   */
238   public Field<String> getStringfieldField() throws AccessPoemException {
239     Column<String> c = _getStringFieldTable().getStringfieldColumn();
240     return new Field<String>((String)c.getRaw(this), c);
241   }
242 
243 
244  /**
245   * Retrieves the <code>Unlimited</code> value, without locking, 
246   * for this <code>StringField</code> <code>Persistent</code>.
247   *
248   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
249   * @return the String unlimited
250   */
251   public String getUnlimited_unsafe() {
252     return unlimited;
253   }
254 
255 
256  /**
257   * Sets the <code>Unlimited</code> value directly, without checking, 
258   * for this StringField <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(String cooked) {
264     unlimited = cooked;
265   }
266 
267  /**
268   * Retrieves the Unlimited value, with locking, for this 
269   * <code>StringField</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>StringField</code> <code>Persistent</code>  
277   */
278 
279   public String 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>StringField</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(String cooked)
299       throws AccessPoemException, ValidationPoemException {
300     _getStringFieldTable().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>StringField</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 String unlimited
316   */
317   public Field<String> getUnlimitedField() throws AccessPoemException {
318     Column<String> c = _getStringFieldTable().getUnlimitedColumn();
319     return new Field<String>((String)c.getRaw(this), c);
320   }
321 
322 }
323