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