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 org.melati.poem.AccessPoemException;
7   import org.melati.poem.Capability;
8   import org.melati.poem.Column;
9   import org.melati.poem.Field;
10  import org.melati.poem.JdbcPersistent;
11  import org.melati.poem.NoSuchRowPoemException;
12  import org.melati.poem.ValidationPoemException;
13  import org.melati.poem.test.EverythingDatabaseTables;
14  import org.melati.poem.test.Protected;
15  import org.melati.poem.test.ProtectedTable;
16  import org.melati.poem.test.User;
17  
18  
19  /**
20   * Melati POEM generated abstract base class for a <code>Persistent</code> 
21   * <code>Protected</code> Object.
22   *
23   * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
24   */
25  public abstract class ProtectedBase extends JdbcPersistent {
26  
27  
28   /**
29    * Retrieves the Database object.
30    * 
31    * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
32    * @return the database
33    */
34    public EverythingDatabaseTables getEverythingDatabaseTables() {
35      return (EverythingDatabaseTables)getDatabase();
36    }
37  
38  
39   /**
40    * Retrieves the  <code>ProtectedTable</code> table 
41    * which this <code>Persistent</code> is from.
42    * 
43    * See org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
44    * @return the ProtectedTable
45    */
46    @SuppressWarnings("unchecked")
47    public ProtectedTable<Protected> getProtectedTable() {
48      return (ProtectedTable<Protected>)getTable();
49    }
50  
51    @SuppressWarnings("unchecked")
52    private ProtectedTable<Protected> _getProtectedTable() {
53      return (ProtectedTable<Protected>)getTable();
54    }
55  
56    // Fields in this table 
57   /**
58    * id 
59    */
60    protected Integer id;
61   /**
62    * spy - Spy 
63    */
64    protected Integer spy;
65   /**
66    * mission - Secret mission 
67    */
68    protected String mission;
69   /**
70    * canRead - Capability required to read this row  
71    */
72    protected Integer canRead;
73   /**
74    * canWrite - Capability required to write this row  
75    */
76    protected Integer canWrite;
77   /**
78    * canDelete - Capability required to delete this row  
79    */
80    protected Integer canDelete;
81   /**
82    * canSelect - Capability required to select this row  
83    */
84    protected Integer canSelect;
85   /**
86    * deleted - Whether this record is existant  
87    */
88    protected Boolean deleted;
89  
90  
91   /**
92    * Retrieves the <code>Id</code> value, without locking, 
93    * for this <code>Protected</code> <code>Persistent</code>.
94    *
95    * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
96    * @return the Integer id
97    */
98    public Integer getId_unsafe() {
99      return id;
100   }
101 
102 
103  /**
104   * Sets the <code>Id</code> value directly, without checking, 
105   * for this Protected <code>Persistent</code>.
106   * 
107   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
108   * @param cooked  the pre-validated value to set
109   */
110   public void setId_unsafe(Integer cooked) {
111     id = cooked;
112   }
113 
114  /**
115   * Retrieves the Id value, with locking, for this 
116   * <code>Protected</code> <code>Persistent</code>.
117   * 
118   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
119   * @throws AccessPoemException 
120   *         if the current <code>AccessToken</code> 
121   *         does not confer write access rights 
122   * @return the value of the field <code>Id</code> for this 
123   *         <code>Protected</code> <code>Persistent</code>  
124   */
125 
126   public Integer getId()
127       throws AccessPoemException {
128     readLock();
129     return getId_unsafe();
130   }
131 
132 
133  /**
134   * Sets the <code>Id</code> value, with checking, for this 
135   * <code>Protected</code> <code>Persistent</code>.
136   * 
137   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
138   * @param cooked  a validated <code>int</code> 
139   * @throws AccessPoemException 
140   *         if the current <code>AccessToken</code> 
141   *         does not confer write access rights
142   * @throws ValidationPoemException 
143   *         if the value is not valid
144   */
145   public void setId(Integer cooked)
146       throws AccessPoemException, ValidationPoemException {
147     _getProtectedTable().getIdColumn().
148       getType().assertValidCooked(cooked);
149     writeLock();
150     setId_unsafe(cooked);
151   }
152 
153  /**
154   * Sets the <code>Id</code> value, with checking, for this 
155   * <code>Protected</code> <code>Persistent</code>.
156   * 
157   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
158   * @param cooked  a validated <code>int</code>
159   * @throws AccessPoemException 
160   *         if the current <code>AccessToken</code> 
161   *         does not confer write access rights
162   * @throws ValidationPoemException 
163   *         if the value is not valid
164   */
165 
166   public final void setId(int cooked)
167       throws AccessPoemException, ValidationPoemException {
168     setId(new Integer(cooked));
169   }
170 
171 
172  /**
173   * Retrieves the <code>Id</code> value as a <code>Field</code>
174   * from this <code>Protected</code> <code>Persistent</code>.
175   * 
176   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
177   * @throws AccessPoemException 
178   *         if the current <code>AccessToken</code> 
179   *         does not confer write access rights
180   * @return the Integer id
181   */
182   public Field<Integer> getIdField() throws AccessPoemException {
183     Column<Integer> c = _getProtectedTable().getIdColumn();
184     return new Field<Integer>((Integer)c.getRaw(this), c);
185   }
186 
187 
188  /**
189   * Retrieves the <code>Spy</code> value, without locking, 
190   * for this <code>Protected</code> <code>Persistent</code>.
191   *
192   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
193   * @return the Integer spy
194   */
195   public Integer getSpy_unsafe() {
196     return spy;
197   }
198 
199 
200  /**
201   * Sets the <code>Spy</code> value directly, without checking, 
202   * for this Protected <code>Persistent</code>.
203   * 
204   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
205   * @param cooked  the pre-validated value to set
206   */
207   public void setSpy_unsafe(Integer cooked) {
208     spy = cooked;
209   }
210 
211  /**
212   * Retrieves the Table Row Object ID. 
213   *
214   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
215   * @throws AccessPoemException  
216   *         if the current <code>AccessToken</code> 
217   *         does not confer read access rights 
218   * @return the TROID as an <code>Integer</code> 
219   */
220 
221   public Integer getSpyTroid()
222       throws AccessPoemException {
223     readLock();
224     return getSpy_unsafe();
225   }
226 
227 
228  /**
229   * Sets the Table Row Object ID. 
230   * 
231   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
232   * @param raw  a Table Row Object Id 
233   * @throws AccessPoemException  
234   *         if the current <code>AccessToken</code> 
235   *         does not confer write access rights
236   */
237   public void setSpyTroid(Integer raw)
238       throws AccessPoemException {
239     setSpy(raw == null ? null : 
240         (User)getEverythingDatabaseTables().getUserTable().getUserObject(raw));
241   }
242 
243 
244  /**
245   * Retrieves the <code>Spy</code> object referred to.
246   *  
247   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
248   * @throws AccessPoemException  
249   *         if the current <code>AccessToken</code> 
250   *         does not confer read access rights 
251   * @throws NoSuchRowPoemException  
252   *         if the <code>Persistent</code> has yet to be allocated a TROID 
253   * @return the <code>Spy</code> as a <code>User</code> 
254   */
255   public User getSpy()
256       throws AccessPoemException, NoSuchRowPoemException {
257     Integer troid = getSpyTroid();
258     return troid == null ? null :
259         (User)getEverythingDatabaseTables().getUserTable().getUserObject(troid);
260   }
261 
262 
263  /**
264   * Set the Spy.
265   * 
266   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
267   * @param cooked  a validated <code>User</code>
268   * @throws AccessPoemException  
269   *         if the current <code>AccessToken</code> 
270   *         does not confer write access rights 
271   */
272   public void setSpy(User cooked)
273       throws AccessPoemException {
274     _getProtectedTable().
275       getSpyColumn().
276         getType().assertValidCooked(cooked);
277     writeLock();
278     if (cooked == null)
279       setSpy_unsafe(null);
280     else {
281       cooked.existenceLock();
282       setSpy_unsafe(cooked.troid());
283     }
284   }
285 
286 
287  /**
288   * Retrieves the <code>Spy</code> value as a <code>Field</code>
289   * from this <code>Protected</code> <code>Persistent</code>.
290   * 
291   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
292   * @throws AccessPoemException 
293   *         if the current <code>AccessToken</code> 
294   *         does not confer write access rights
295   * @return the Integer spy
296   */
297   public Field<Integer> getSpyField() throws AccessPoemException {
298     Column<Integer> c = _getProtectedTable().getSpyColumn();
299     return new Field<Integer>((Integer)c.getRaw(this), c);
300   }
301 
302 
303  /**
304   * Retrieves the <code>Mission</code> value, without locking, 
305   * for this <code>Protected</code> <code>Persistent</code>.
306   *
307   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
308   * @return the String mission
309   */
310   public String getMission_unsafe() {
311     return mission;
312   }
313 
314 
315  /**
316   * Sets the <code>Mission</code> value directly, without checking, 
317   * for this Protected <code>Persistent</code>.
318   * 
319   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
320   * @param cooked  the pre-validated value to set
321   */
322   public void setMission_unsafe(String cooked) {
323     mission = cooked;
324   }
325 
326  /**
327   * Retrieves the Mission value, with locking, for this 
328   * <code>Protected</code> <code>Persistent</code>.
329   * Field description: 
330   *   Secret mission 
331   * 
332   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
333   * @throws AccessPoemException 
334   *         if the current <code>AccessToken</code> 
335   *         does not confer write access rights 
336   * @return the value of the field <code>Mission</code> for this 
337   *         <code>Protected</code> <code>Persistent</code>  
338   */
339 
340   public String getMission()
341       throws AccessPoemException {
342     readLock();
343     return getMission_unsafe();
344   }
345 
346 
347  /**
348   * Sets the <code>Mission</code> value, with checking, for this 
349   * <code>Protected</code> <code>Persistent</code>.
350   * Field description: 
351   *   Secret mission 
352   * 
353   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
354   * @param cooked  a validated <code>int</code> 
355   * @throws AccessPoemException 
356   *         if the current <code>AccessToken</code> 
357   *         does not confer write access rights
358   * @throws ValidationPoemException 
359   *         if the value is not valid
360   */
361   public void setMission(String cooked)
362       throws AccessPoemException, ValidationPoemException {
363     _getProtectedTable().getMissionColumn().
364       getType().assertValidCooked(cooked);
365     writeLock();
366     setMission_unsafe(cooked);
367   }
368 
369 
370  /**
371   * Retrieves the <code>Mission</code> value as a <code>Field</code>
372   * from this <code>Protected</code> <code>Persistent</code>.
373   * 
374   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
375   * @throws AccessPoemException 
376   *         if the current <code>AccessToken</code> 
377   *         does not confer write access rights
378   * @return the String mission
379   */
380   public Field<String> getMissionField() throws AccessPoemException {
381     Column<String> c = _getProtectedTable().getMissionColumn();
382     return new Field<String>((String)c.getRaw(this), c);
383   }
384 
385 
386  /**
387   * Retrieves the <code>CanRead</code> value, without locking, 
388   * for this <code>Protected</code> <code>Persistent</code>.
389   *
390   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
391   * @return the Integer canRead
392   */
393   public Integer getCanRead_unsafe() {
394     return canRead;
395   }
396 
397 
398  /**
399   * Sets the <code>CanRead</code> value directly, without checking, 
400   * for this Protected <code>Persistent</code>.
401   * 
402   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
403   * @param cooked  the pre-validated value to set
404   */
405   public void setCanRead_unsafe(Integer cooked) {
406     canRead = cooked;
407   }
408 
409  /**
410   * Retrieves the Table Row Object ID. 
411   *
412   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
413   * @throws AccessPoemException  
414   *         if the current <code>AccessToken</code> 
415   *         does not confer read access rights 
416   * @return the TROID as an <code>Integer</code> 
417   */
418 
419   public Integer getCanReadTroid()
420       throws AccessPoemException {
421     readLock();
422     return getCanRead_unsafe();
423   }
424 
425 
426  /**
427   * Sets the Table Row Object ID. 
428   * 
429   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
430   * @param raw  a Table Row Object Id 
431   * @throws AccessPoemException  
432   *         if the current <code>AccessToken</code> 
433   *         does not confer write access rights
434   */
435   public void setCanReadTroid(Integer raw)
436       throws AccessPoemException {
437     setCanRead(raw == null ? null : 
438         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(raw));
439   }
440 
441 
442  /**
443   * Retrieves the <code>CanRead</code> object referred to.
444   *  
445   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
446   * @throws AccessPoemException  
447   *         if the current <code>AccessToken</code> 
448   *         does not confer read access rights 
449   * @throws NoSuchRowPoemException  
450   *         if the <code>Persistent</code> has yet to be allocated a TROID 
451   * @return the <code>CanRead</code> as a <code>Capability</code> 
452   */
453   public Capability getCanRead()
454       throws AccessPoemException, NoSuchRowPoemException {
455     Integer troid = getCanReadTroid();
456     return troid == null ? null :
457         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(troid);
458   }
459 
460 
461  /**
462   * Set the CanRead.
463   * 
464   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
465   * @param cooked  a validated <code>Capability</code>
466   * @throws AccessPoemException  
467   *         if the current <code>AccessToken</code> 
468   *         does not confer write access rights 
469   */
470   public void setCanRead(Capability cooked)
471       throws AccessPoemException {
472     _getProtectedTable().
473       getCanReadColumn().
474         getType().assertValidCooked(cooked);
475     writeLock();
476     if (cooked == null)
477       setCanRead_unsafe(null);
478     else {
479       cooked.existenceLock();
480       setCanRead_unsafe(cooked.troid());
481     }
482   }
483 
484 
485  /**
486   * Retrieves the <code>CanRead</code> value as a <code>Field</code>
487   * from this <code>Protected</code> <code>Persistent</code>.
488   * 
489   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
490   * @throws AccessPoemException 
491   *         if the current <code>AccessToken</code> 
492   *         does not confer write access rights
493   * @return the Integer canRead
494   */
495   public Field<Integer> getCanReadField() throws AccessPoemException {
496     Column<Integer> c = _getProtectedTable().getCanReadColumn();
497     return new Field<Integer>((Integer)c.getRaw(this), c);
498   }
499 
500 
501  /**
502   * Retrieves the <code>CanWrite</code> value, without locking, 
503   * for this <code>Protected</code> <code>Persistent</code>.
504   *
505   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
506   * @return the Integer canWrite
507   */
508   public Integer getCanWrite_unsafe() {
509     return canWrite;
510   }
511 
512 
513  /**
514   * Sets the <code>CanWrite</code> value directly, without checking, 
515   * for this Protected <code>Persistent</code>.
516   * 
517   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
518   * @param cooked  the pre-validated value to set
519   */
520   public void setCanWrite_unsafe(Integer cooked) {
521     canWrite = cooked;
522   }
523 
524  /**
525   * Retrieves the Table Row Object ID. 
526   *
527   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
528   * @throws AccessPoemException  
529   *         if the current <code>AccessToken</code> 
530   *         does not confer read access rights 
531   * @return the TROID as an <code>Integer</code> 
532   */
533 
534   public Integer getCanWriteTroid()
535       throws AccessPoemException {
536     readLock();
537     return getCanWrite_unsafe();
538   }
539 
540 
541  /**
542   * Sets the Table Row Object ID. 
543   * 
544   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
545   * @param raw  a Table Row Object Id 
546   * @throws AccessPoemException  
547   *         if the current <code>AccessToken</code> 
548   *         does not confer write access rights
549   */
550   public void setCanWriteTroid(Integer raw)
551       throws AccessPoemException {
552     setCanWrite(raw == null ? null : 
553         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(raw));
554   }
555 
556 
557  /**
558   * Retrieves the <code>CanWrite</code> object referred to.
559   *  
560   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
561   * @throws AccessPoemException  
562   *         if the current <code>AccessToken</code> 
563   *         does not confer read access rights 
564   * @throws NoSuchRowPoemException  
565   *         if the <code>Persistent</code> has yet to be allocated a TROID 
566   * @return the <code>CanWrite</code> as a <code>Capability</code> 
567   */
568   public Capability getCanWrite()
569       throws AccessPoemException, NoSuchRowPoemException {
570     Integer troid = getCanWriteTroid();
571     return troid == null ? null :
572         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(troid);
573   }
574 
575 
576  /**
577   * Set the CanWrite.
578   * 
579   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
580   * @param cooked  a validated <code>Capability</code>
581   * @throws AccessPoemException  
582   *         if the current <code>AccessToken</code> 
583   *         does not confer write access rights 
584   */
585   public void setCanWrite(Capability cooked)
586       throws AccessPoemException {
587     _getProtectedTable().
588       getCanWriteColumn().
589         getType().assertValidCooked(cooked);
590     writeLock();
591     if (cooked == null)
592       setCanWrite_unsafe(null);
593     else {
594       cooked.existenceLock();
595       setCanWrite_unsafe(cooked.troid());
596     }
597   }
598 
599 
600  /**
601   * Retrieves the <code>CanWrite</code> value as a <code>Field</code>
602   * from this <code>Protected</code> <code>Persistent</code>.
603   * 
604   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
605   * @throws AccessPoemException 
606   *         if the current <code>AccessToken</code> 
607   *         does not confer write access rights
608   * @return the Integer canWrite
609   */
610   public Field<Integer> getCanWriteField() throws AccessPoemException {
611     Column<Integer> c = _getProtectedTable().getCanWriteColumn();
612     return new Field<Integer>((Integer)c.getRaw(this), c);
613   }
614 
615 
616  /**
617   * Retrieves the <code>CanDelete</code> value, without locking, 
618   * for this <code>Protected</code> <code>Persistent</code>.
619   *
620   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
621   * @return the Integer canDelete
622   */
623   public Integer getCanDelete_unsafe() {
624     return canDelete;
625   }
626 
627 
628  /**
629   * Sets the <code>CanDelete</code> value directly, without checking, 
630   * for this Protected <code>Persistent</code>.
631   * 
632   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
633   * @param cooked  the pre-validated value to set
634   */
635   public void setCanDelete_unsafe(Integer cooked) {
636     canDelete = cooked;
637   }
638 
639  /**
640   * Retrieves the Table Row Object ID. 
641   *
642   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
643   * @throws AccessPoemException  
644   *         if the current <code>AccessToken</code> 
645   *         does not confer read access rights 
646   * @return the TROID as an <code>Integer</code> 
647   */
648 
649   public Integer getCanDeleteTroid()
650       throws AccessPoemException {
651     readLock();
652     return getCanDelete_unsafe();
653   }
654 
655 
656  /**
657   * Sets the Table Row Object ID. 
658   * 
659   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
660   * @param raw  a Table Row Object Id 
661   * @throws AccessPoemException  
662   *         if the current <code>AccessToken</code> 
663   *         does not confer write access rights
664   */
665   public void setCanDeleteTroid(Integer raw)
666       throws AccessPoemException {
667     setCanDelete(raw == null ? null : 
668         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(raw));
669   }
670 
671 
672  /**
673   * Retrieves the <code>CanDelete</code> object referred to.
674   *  
675   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
676   * @throws AccessPoemException  
677   *         if the current <code>AccessToken</code> 
678   *         does not confer read access rights 
679   * @throws NoSuchRowPoemException  
680   *         if the <code>Persistent</code> has yet to be allocated a TROID 
681   * @return the <code>CanDelete</code> as a <code>Capability</code> 
682   */
683   public Capability getCanDelete()
684       throws AccessPoemException, NoSuchRowPoemException {
685     Integer troid = getCanDeleteTroid();
686     return troid == null ? null :
687         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(troid);
688   }
689 
690 
691  /**
692   * Set the CanDelete.
693   * 
694   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
695   * @param cooked  a validated <code>Capability</code>
696   * @throws AccessPoemException  
697   *         if the current <code>AccessToken</code> 
698   *         does not confer write access rights 
699   */
700   public void setCanDelete(Capability cooked)
701       throws AccessPoemException {
702     _getProtectedTable().
703       getCanDeleteColumn().
704         getType().assertValidCooked(cooked);
705     writeLock();
706     if (cooked == null)
707       setCanDelete_unsafe(null);
708     else {
709       cooked.existenceLock();
710       setCanDelete_unsafe(cooked.troid());
711     }
712   }
713 
714 
715  /**
716   * Retrieves the <code>CanDelete</code> value as a <code>Field</code>
717   * from this <code>Protected</code> <code>Persistent</code>.
718   * 
719   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
720   * @throws AccessPoemException 
721   *         if the current <code>AccessToken</code> 
722   *         does not confer write access rights
723   * @return the Integer canDelete
724   */
725   public Field<Integer> getCanDeleteField() throws AccessPoemException {
726     Column<Integer> c = _getProtectedTable().getCanDeleteColumn();
727     return new Field<Integer>((Integer)c.getRaw(this), c);
728   }
729 
730 
731  /**
732   * Retrieves the <code>CanSelect</code> value, without locking, 
733   * for this <code>Protected</code> <code>Persistent</code>.
734   *
735   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
736   * @return the Integer canSelect
737   */
738   public Integer getCanSelect_unsafe() {
739     return canSelect;
740   }
741 
742 
743  /**
744   * Sets the <code>CanSelect</code> value directly, without checking, 
745   * for this Protected <code>Persistent</code>.
746   * 
747   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
748   * @param cooked  the pre-validated value to set
749   */
750   public void setCanSelect_unsafe(Integer cooked) {
751     canSelect = cooked;
752   }
753 
754  /**
755   * Retrieves the Table Row Object ID. 
756   *
757   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
758   * @throws AccessPoemException  
759   *         if the current <code>AccessToken</code> 
760   *         does not confer read access rights 
761   * @return the TROID as an <code>Integer</code> 
762   */
763 
764   public Integer getCanSelectTroid()
765       throws AccessPoemException {
766     readLock();
767     return getCanSelect_unsafe();
768   }
769 
770 
771  /**
772   * Sets the Table Row Object ID. 
773   * 
774   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
775   * @param raw  a Table Row Object Id 
776   * @throws AccessPoemException  
777   *         if the current <code>AccessToken</code> 
778   *         does not confer write access rights
779   */
780   public void setCanSelectTroid(Integer raw)
781       throws AccessPoemException {
782     setCanSelect(raw == null ? null : 
783         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(raw));
784   }
785 
786 
787  /**
788   * Retrieves the <code>CanSelect</code> object referred to.
789   *  
790   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
791   * @throws AccessPoemException  
792   *         if the current <code>AccessToken</code> 
793   *         does not confer read access rights 
794   * @throws NoSuchRowPoemException  
795   *         if the <code>Persistent</code> has yet to be allocated a TROID 
796   * @return the <code>CanSelect</code> as a <code>Capability</code> 
797   */
798   public Capability getCanSelect()
799       throws AccessPoemException, NoSuchRowPoemException {
800     Integer troid = getCanSelectTroid();
801     return troid == null ? null :
802         getEverythingDatabaseTables().getCapabilityTable().getCapabilityObject(troid);
803   }
804 
805 
806  /**
807   * Set the CanSelect.
808   * 
809   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
810   * @param cooked  a validated <code>Capability</code>
811   * @throws AccessPoemException  
812   *         if the current <code>AccessToken</code> 
813   *         does not confer write access rights 
814   */
815   public void setCanSelect(Capability cooked)
816       throws AccessPoemException {
817     _getProtectedTable().
818       getCanSelectColumn().
819         getType().assertValidCooked(cooked);
820     writeLock();
821     if (cooked == null)
822       setCanSelect_unsafe(null);
823     else {
824       cooked.existenceLock();
825       setCanSelect_unsafe(cooked.troid());
826     }
827   }
828 
829 
830  /**
831   * Retrieves the <code>CanSelect</code> value as a <code>Field</code>
832   * from this <code>Protected</code> <code>Persistent</code>.
833   * 
834   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
835   * @throws AccessPoemException 
836   *         if the current <code>AccessToken</code> 
837   *         does not confer write access rights
838   * @return the Integer canSelect
839   */
840   public Field<Integer> getCanSelectField() throws AccessPoemException {
841     Column<Integer> c = _getProtectedTable().getCanSelectColumn();
842     return new Field<Integer>((Integer)c.getRaw(this), c);
843   }
844 
845 
846  /**
847   * Retrieves the <code>Deleted</code> value, without locking, 
848   * for this <code>Protected</code> <code>Persistent</code>.
849   *
850   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
851   * @return the Boolean deleted
852   */
853   public Boolean getDeleted_unsafe() {
854     return deleted;
855   }
856 
857 
858  /**
859   * Sets the <code>Deleted</code> value directly, without checking, 
860   * for this Protected <code>Persistent</code>.
861   * 
862   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
863   * @param cooked  the pre-validated value to set
864   */
865   public void setDeleted_unsafe(Boolean cooked) {
866     deleted = cooked;
867   }
868 
869  /**
870   * Retrieves the Deleted value, with locking, for this 
871   * <code>Protected</code> <code>Persistent</code>.
872   * Field description: 
873   *   Whether this record is existant  
874   * 
875   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
876   * @throws AccessPoemException 
877   *         if the current <code>AccessToken</code> 
878   *         does not confer write access rights 
879   * @return the value of the field <code>Deleted</code> for this 
880   *         <code>Protected</code> <code>Persistent</code>  
881   */
882 
883   public Boolean getDeleted()
884       throws AccessPoemException {
885     readLock();
886     return getDeleted_unsafe();
887   }
888 
889 
890  /**
891   * Sets the <code>Deleted</code> value, with checking, for this 
892   * <code>Protected</code> <code>Persistent</code>.
893   * Field description: 
894   *   Whether this record is existant  
895   * 
896   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
897   * @param cooked  a validated <code>int</code> 
898   * @throws AccessPoemException 
899   *         if the current <code>AccessToken</code> 
900   *         does not confer write access rights
901   * @throws ValidationPoemException 
902   *         if the value is not valid
903   */
904   public void setDeleted(Boolean cooked)
905       throws AccessPoemException, ValidationPoemException {
906     _getProtectedTable().getDeletedColumn().
907       getType().assertValidCooked(cooked);
908     writeLock();
909     setDeleted_unsafe(cooked);
910   }
911 
912  /**
913   * Sets the <code>Deleted</code> value, with checking, 
914   * from a <code>boolean</code>, for this 
915   * <code>Protected</code> <code>Persistent</code>.
916   * Field description: 
917   *   Whether this record is existant  
918   * 
919   * 
920   * Generated by org.melati.poem.prepro.BooleanFieldDef#generateBaseMethods 
921   * @param cooked  a <code>boolean</code> 
922   * @throws AccessPoemException 
923   *         if the current <code>AccessToken</code> 
924   *         does not confer write access rights
925   * @throws ValidationPoemException 
926   *         if the value is not valid
927   */
928 
929   public final void setDeleted(boolean cooked)
930       throws AccessPoemException, ValidationPoemException {
931     setDeleted(cooked ? Boolean.TRUE : Boolean.FALSE);
932   }
933 
934 
935  /**
936   * Retrieves the <code>Deleted</code> value as a <code>Field</code>
937   * from this <code>Protected</code> <code>Persistent</code>.
938   * 
939   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
940   * @throws AccessPoemException 
941   *         if the current <code>AccessToken</code> 
942   *         does not confer write access rights
943   * @return the Boolean deleted
944   */
945   public Field<Boolean> getDeletedField() throws AccessPoemException {
946     Column<Boolean> c = _getProtectedTable().getDeletedColumn();
947     return new Field<Boolean>((Boolean)c.getRaw(this), c);
948   }
949 
950 }
951