View Javadoc

1   // Do not edit this file!  It was generated by Melati POEM's DSD preprocessor.
2   
3   package org.paneris.jammyjoes.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.jammyjoes.model.JammyjoesDatabaseTables;
12  import org.paneris.jammyjoes.model.OrderTypeTable;
13  
14  
15  /**
16   * Melati POEM generated abstract base class for a <code>Persistent</code> 
17   * <code>OrderType</code> Object.
18   *
19   * @generator org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
20   */
21  public abstract class OrderTypeBase extends JdbcPersistent {
22  
23  
24   /**
25    * Retrieves the Database object.
26    * 
27    * @generator org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
28    * @return the database
29    */
30    public JammyjoesDatabaseTables getJammyjoesDatabaseTables() {
31      return (JammyjoesDatabaseTables)getDatabase();
32    }
33  
34  
35   /**
36    * Retrieves the  <code>OrderTypeTable</code> table 
37    * which this <code>Persistent</code> is from.
38    * 
39    * @generator org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
40    * @return the OrderTypeTable
41    */
42    public OrderTypeTable getOrderTypeTable() {
43      return (OrderTypeTable)getTable();
44    }
45  
46    private OrderTypeTable _getOrderTypeTable() {
47      return (OrderTypeTable)getTable();
48    }
49  
50    // Fields in this table 
51   /**
52    * id 
53    */
54    protected Integer id;
55   /**
56    * Type 
57    */
58    protected String type;
59  
60  
61   /**
62    * Retrieves the <code>Id</code> value, without locking, 
63    * for this <code>OrderType</code> <code>Persistent</code>.
64    *
65    * @generator 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 OrderType <code>Persistent</code>.
76    * 
77    * @generator 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>OrderType</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>OrderType</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>OrderType</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     _getOrderTypeTable().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>OrderType</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>OrderType</code> <code>Persistent</code>.
145   * 
146   * @generator 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 = _getOrderTypeTable().getIdColumn();
154     return new Field(c.getRaw(this), c);
155   }
156 
157 
158  /**
159   * Retrieves the <code>Type</code> value, without locking, 
160   * for this <code>OrderType</code> <code>Persistent</code>.
161   *
162   * @generator org.melati.poem.prepro.FieldDef#generateBaseMethods 
163   * @return the String type
164   */
165   public String getType_unsafe() {
166     return type;
167   }
168 
169 
170  /**
171   * Sets the <code>Type</code> value directly, without checking, 
172   * for this OrderType <code>Persistent</code>.
173   * 
174   * @generator org.melati.poem.prepro.FieldDef#generateBaseMethods 
175   * @param cooked  the pre-validated value to set
176   */
177   public void setType_unsafe(String cooked) {
178     type = cooked;
179   }
180 
181  /**
182   * Retrieves the Type value, with locking, for this 
183   * <code>OrderType</code> <code>Persistent</code>.
184   * 
185   * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
186   * @throws AccessPoemException 
187   *         if the current <code>AccessToken</code> 
188   *         does not confer write access rights 
189   * @return the value of the field <code>Type</code> for this 
190   *         <code>OrderType</code> <code>Persistent</code>  
191   */
192 
193   public String getType()
194       throws AccessPoemException {
195     readLock();
196     return getType_unsafe();
197   }
198 
199 
200  /**
201   * Sets the <code>Type</code> value, with checking, for this 
202   * <code>OrderType</code> <code>Persistent</code>.
203   * 
204   * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
205   * @param cooked  a validated <code>int</code> 
206   * @throws AccessPoemException 
207   *         if the current <code>AccessToken</code> 
208   *         does not confer write access rights
209   * @throws ValidationPoemException 
210   *         if the value is not valid
211   */
212   public void setType(String cooked)
213       throws AccessPoemException, ValidationPoemException {
214     _getOrderTypeTable().getTypeColumn().
215       getType().assertValidCooked(cooked);
216     writeLock();
217     setType_unsafe(cooked);
218   }
219 
220 
221  /**
222   * Retrieves the <code>Type</code> value as a <code>Field</code>
223   * from this <code>OrderType</code> <code>Persistent</code>.
224   * 
225   * @generator org.melati.poem.prepro.FieldDef#generateFieldCreator 
226   * @throws AccessPoemException 
227   *         if the current <code>AccessToken</code> 
228   *         does not confer write access rights
229   * @return the String type
230   */
231   public Field getTypeField() throws AccessPoemException {
232     Column c = _getOrderTypeTable().getTypeColumn();
233     return new Field(c.getRaw(this), c);
234   }
235 }
236