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.JdbcPersistent;
10  import org.melati.poem.ValidationPoemException;
11  import org.paneris.melati.site.model.SiteDatabaseTables;
12  import org.paneris.melati.site.model.StyleTable;
13  
14  
15  /**
16   * Melati POEM generated abstract base class for a <code>Persistent</code> 
17   * <code>Style</code> Object.
18   *
19   * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
20   */
21  public abstract class StyleBase extends JdbcPersistent {
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>StyleTable</code> table 
37    * which this <code>Persistent</code> is from.
38    * 
39    * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
40    * @return the StyleTable
41    */
42    public StyleTable getStyleTable() {
43      return (StyleTable)getTable();
44    }
45  
46    private StyleTable _getStyleTable() {
47      return (StyleTable)getTable();
48    }
49  
50    // Fields in this table 
51   /**
52    * id 
53    */
54    protected Integer id;
55   /**
56    * Name - The Class id 
57    */
58    protected String name;
59  
60  
61   /**
62    * Retrieves the <code>Id</code> value, without locking, 
63    * for this <code>Style</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 Style <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>Style</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>Style</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>Style</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     _getStyleTable().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>Style</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>Style</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 = _getStyleTable().getIdColumn();
154     return new Field(c.getRaw(this), c);
155   }
156 
157 
158  /**
159   * Retrieves the <code>Name</code> value, without locking, 
160   * for this <code>Style</code> <code>Persistent</code>.
161   *
162   * @see org.melati.poem.prepro.FieldDef#generateBaseMethods 
163   * @return the String name
164   */
165   public String getName_unsafe() {
166     return name;
167   }
168 
169 
170  /**
171   * Sets the <code>Name</code> value directly, without checking, 
172   * for this Style <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 setName_unsafe(String cooked) {
178     name = cooked;
179   }
180 
181  /**
182   * Retrieves the Name value, with locking, for this 
183   * <code>Style</code> <code>Persistent</code>.
184   * Field description: 
185   *   The Class id 
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>Name</code> for this 
192   *         <code>Style</code> <code>Persistent</code>  
193   */
194 
195   public String getName()
196       throws AccessPoemException {
197     readLock();
198     return getName_unsafe();
199   }
200 
201 
202  /**
203   * Sets the <code>Name</code> value, with checking, for this 
204   * <code>Style</code> <code>Persistent</code>.
205   * Field description: 
206   *   The Class id 
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 setName(String cooked)
217       throws AccessPoemException, ValidationPoemException {
218     _getStyleTable().getNameColumn().
219       getType().assertValidCooked(cooked);
220     writeLock();
221     setName_unsafe(cooked);
222   }
223 
224 
225  /**
226   * Retrieves the <code>Name</code> value as a <code>Field</code>
227   * from this <code>Style</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 name
234   */
235   public Field getNameField() throws AccessPoemException {
236     Column c = _getStyleTable().getNameColumn();
237     return new Field(c.getRaw(this), c);
238   }
239 }
240