View Javadoc

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