View Javadoc

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