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.NoSuchRowPoemException;
11  import org.melati.poem.ValidationPoemException;
12  import org.paneris.bibliomania.BibliomaniaDatabaseTables;
13  import org.paneris.bibliomania.DeliveryCharge;
14  import org.paneris.bibliomania.DeliveryChargeBand;
15  import org.paneris.bibliomania.DeliveryChargeTable;
16  import org.paneris.bibliomania.Supplier;
17  
18  
19  /**
20   * Melati POEM generated abstract base class for a <code>Persistent</code> 
21   * <code>DeliveryCharge</code> Object.
22   *
23   * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
24   */
25  public abstract class DeliveryChargeBase 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 BibliomaniaDatabaseTables getBibliomaniaDatabaseTables() {
35      return (BibliomaniaDatabaseTables)getDatabase();
36    }
37  
38  
39   /**
40    * Retrieves the  <code>DeliveryChargeTable</code> table 
41    * which this <code>Persistent</code> is from.
42    * 
43    * see org.melati.poem.prepro.TableDef#generatePersistentBaseJava 
44    * @return the DeliveryChargeTable
45    */
46    @SuppressWarnings("unchecked")
47    public DeliveryChargeTable<DeliveryCharge> getDeliveryChargeTable() {
48      return (DeliveryChargeTable<DeliveryCharge>)getTable();
49    }
50  
51    @SuppressWarnings("unchecked")
52    private DeliveryChargeTable<DeliveryCharge> _getDeliveryChargeTable() {
53      return (DeliveryChargeTable<DeliveryCharge>)getTable();
54    }
55  
56    // Fields in this table 
57   /**
58    * id 
59    */
60    protected Integer id;
61   /**
62    * Delivery Charge Band - The name of area for this delivery charge 
63    */
64    protected Integer band;
65   /**
66    * Supplier - The supplier for which these charges apply 
67    */
68    protected Integer supplier;
69   /**
70    * Per Item Delivery Charge - The cost for delivering each book to a coutry 
71    * in this band 
72    */
73    protected Double charge;
74   /**
75    * Order Delivery Charge - The cost for delivering the order (added to the 
76    * per item charge) 
77    */
78    protected Double ordercharge;
79  
80  
81   /**
82    * Retrieves the <code>Id</code> value, without locking, 
83    * for this <code>DeliveryCharge</code> <code>Persistent</code>.
84    *
85    * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
86    * @return the Integer id
87    */
88    public Integer getId_unsafe() {
89      return id;
90    }
91  
92  
93   /**
94    * Sets the <code>Id</code> value directly, without checking, 
95    * for this DeliveryCharge <code>Persistent</code>.
96    * 
97    * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
98    * @param cooked  the pre-validated value to set
99    */
100   public void setId_unsafe(Integer cooked) {
101     id = cooked;
102   }
103 
104  /**
105   * Retrieves the Id value, with locking, for this 
106   * <code>DeliveryCharge</code> <code>Persistent</code>.
107   * 
108   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
109   * @throws AccessPoemException 
110   *         if the current <code>AccessToken</code> 
111   *         does not confer write access rights 
112   * @return the value of the field <code>Id</code> for this 
113   *         <code>DeliveryCharge</code> <code>Persistent</code>  
114   */
115 
116   public Integer getId()
117       throws AccessPoemException {
118     readLock();
119     return getId_unsafe();
120   }
121 
122 
123  /**
124   * Sets the <code>Id</code> value, with checking, for this 
125   * <code>DeliveryCharge</code> <code>Persistent</code>.
126   * 
127   * Generated by org.melati.poem.prepro.AtomFieldDef#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   public void setId(Integer cooked)
136       throws AccessPoemException, ValidationPoemException {
137     _getDeliveryChargeTable().getIdColumn().
138       getType().assertValidCooked(cooked);
139     writeLock();
140     setId_unsafe(cooked);
141   }
142 
143  /**
144   * Sets the <code>Id</code> value, with checking, for this 
145   * <code>DeliveryCharge</code> <code>Persistent</code>.
146   * 
147   * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods 
148   * @param cooked  a validated <code>int</code>
149   * @throws AccessPoemException 
150   *         if the current <code>AccessToken</code> 
151   *         does not confer write access rights
152   * @throws ValidationPoemException 
153   *         if the value is not valid
154   */
155 
156   public final void setId(int cooked)
157       throws AccessPoemException, ValidationPoemException {
158     setId(new Integer(cooked));
159   }
160 
161 
162  /**
163   * Retrieves the <code>Id</code> value as a <code>Field</code>
164   * from this <code>DeliveryCharge</code> <code>Persistent</code>.
165   * 
166   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
167   * @throws AccessPoemException 
168   *         if the current <code>AccessToken</code> 
169   *         does not confer write access rights
170   * @return the Integer id
171   */
172   public Field<Integer> getIdField() throws AccessPoemException {
173     Column<Integer> c = _getDeliveryChargeTable().getIdColumn();
174     return new Field<Integer>((Integer)c.getRaw(this), c);
175   }
176 
177 
178  /**
179   * Retrieves the <code>Band</code> value, without locking, 
180   * for this <code>DeliveryCharge</code> <code>Persistent</code>.
181   *
182   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
183   * @return the Integer band
184   */
185   public Integer getBand_unsafe() {
186     return band;
187   }
188 
189 
190  /**
191   * Sets the <code>Band</code> value directly, without checking, 
192   * for this DeliveryCharge <code>Persistent</code>.
193   * 
194   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
195   * @param cooked  the pre-validated value to set
196   */
197   public void setBand_unsafe(Integer cooked) {
198     band = cooked;
199   }
200 
201  /**
202   * Retrieves the Table Row Object ID. 
203   *
204   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
205   * @throws AccessPoemException  
206   *         if the current <code>AccessToken</code> 
207   *         does not confer read access rights 
208   * @return the TROID as an <code>Integer</code> 
209   */
210 
211   public Integer getBandTroid()
212       throws AccessPoemException {
213     readLock();
214     return getBand_unsafe();
215   }
216 
217 
218  /**
219   * Sets the Table Row Object ID. 
220   * 
221   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
222   * @param raw  a Table Row Object Id 
223   * @throws AccessPoemException  
224   *         if the current <code>AccessToken</code> 
225   *         does not confer write access rights
226   */
227   public void setBandTroid(Integer raw)
228       throws AccessPoemException {
229     setBand(raw == null ? null : 
230         getBibliomaniaDatabaseTables().getDeliveryChargeBandTable().getDeliveryChargeBandObject(raw));
231   }
232 
233 
234  /**
235   * Retrieves the <code>Band</code> object referred to.
236   *  
237   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
238   * @throws AccessPoemException  
239   *         if the current <code>AccessToken</code> 
240   *         does not confer read access rights 
241   * @throws NoSuchRowPoemException  
242   *         if the <code>Persistent</code> has yet to be allocated a TROID 
243   * @return the <code>Band</code> as a <code>DeliveryChargeBand</code> 
244   */
245   public DeliveryChargeBand getBand()
246       throws AccessPoemException, NoSuchRowPoemException {
247     Integer troid = getBandTroid();
248     return troid == null ? null :
249         getBibliomaniaDatabaseTables().getDeliveryChargeBandTable().getDeliveryChargeBandObject(troid);
250   }
251 
252 
253  /**
254   * Set the Band.
255   * 
256   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
257   * @param cooked  a validated <code>DeliveryChargeBand</code>
258   * @throws AccessPoemException  
259   *         if the current <code>AccessToken</code> 
260   *         does not confer write access rights 
261   */
262   public void setBand(DeliveryChargeBand cooked)
263       throws AccessPoemException {
264     _getDeliveryChargeTable().
265       getBandColumn().
266         getType().assertValidCooked(cooked);
267     writeLock();
268     if (cooked == null)
269       setBand_unsafe(null);
270     else {
271       cooked.existenceLock();
272       setBand_unsafe(cooked.troid());
273     }
274   }
275 
276 
277  /**
278   * Retrieves the <code>Band</code> value as a <code>Field</code>
279   * from this <code>DeliveryCharge</code> <code>Persistent</code>.
280   * 
281   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
282   * @throws AccessPoemException 
283   *         if the current <code>AccessToken</code> 
284   *         does not confer write access rights
285   * @return the Integer band
286   */
287   public Field<Integer> getBandField() throws AccessPoemException {
288     Column<Integer> c = _getDeliveryChargeTable().getBandColumn();
289     return new Field<Integer>((Integer)c.getRaw(this), c);
290   }
291 
292 
293  /**
294   * Retrieves the <code>Supplier</code> value, without locking, 
295   * for this <code>DeliveryCharge</code> <code>Persistent</code>.
296   *
297   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
298   * @return the Integer supplier
299   */
300   public Integer getSupplier_unsafe() {
301     return supplier;
302   }
303 
304 
305  /**
306   * Sets the <code>Supplier</code> value directly, without checking, 
307   * for this DeliveryCharge <code>Persistent</code>.
308   * 
309   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
310   * @param cooked  the pre-validated value to set
311   */
312   public void setSupplier_unsafe(Integer cooked) {
313     supplier = cooked;
314   }
315 
316  /**
317   * Retrieves the Table Row Object ID. 
318   *
319   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
320   * @throws AccessPoemException  
321   *         if the current <code>AccessToken</code> 
322   *         does not confer read access rights 
323   * @return the TROID as an <code>Integer</code> 
324   */
325 
326   public Integer getSupplierTroid()
327       throws AccessPoemException {
328     readLock();
329     return getSupplier_unsafe();
330   }
331 
332 
333  /**
334   * Sets the Table Row Object ID. 
335   * 
336   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
337   * @param raw  a Table Row Object Id 
338   * @throws AccessPoemException  
339   *         if the current <code>AccessToken</code> 
340   *         does not confer write access rights
341   */
342   public void setSupplierTroid(Integer raw)
343       throws AccessPoemException {
344     setSupplier(raw == null ? null : 
345         getBibliomaniaDatabaseTables().getSupplierTable().getSupplierObject(raw));
346   }
347 
348 
349  /**
350   * Retrieves the <code>Supplier</code> object referred to.
351   *  
352   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
353   * @throws AccessPoemException  
354   *         if the current <code>AccessToken</code> 
355   *         does not confer read access rights 
356   * @throws NoSuchRowPoemException  
357   *         if the <code>Persistent</code> has yet to be allocated a TROID 
358   * @return the <code>Supplier</code> as a <code>Supplier</code> 
359   */
360   public Supplier getSupplier()
361       throws AccessPoemException, NoSuchRowPoemException {
362     Integer troid = getSupplierTroid();
363     return troid == null ? null :
364         getBibliomaniaDatabaseTables().getSupplierTable().getSupplierObject(troid);
365   }
366 
367 
368  /**
369   * Set the Supplier.
370   * 
371   * Generated by org.melati.poem.prepro.ReferenceFieldDef#generateBaseMethods 
372   * @param cooked  a validated <code>Supplier</code>
373   * @throws AccessPoemException  
374   *         if the current <code>AccessToken</code> 
375   *         does not confer write access rights 
376   */
377   public void setSupplier(Supplier cooked)
378       throws AccessPoemException {
379     _getDeliveryChargeTable().
380       getSupplierColumn().
381         getType().assertValidCooked(cooked);
382     writeLock();
383     if (cooked == null)
384       setSupplier_unsafe(null);
385     else {
386       cooked.existenceLock();
387       setSupplier_unsafe(cooked.troid());
388     }
389   }
390 
391 
392  /**
393   * Retrieves the <code>Supplier</code> value as a <code>Field</code>
394   * from this <code>DeliveryCharge</code> <code>Persistent</code>.
395   * 
396   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
397   * @throws AccessPoemException 
398   *         if the current <code>AccessToken</code> 
399   *         does not confer write access rights
400   * @return the Integer supplier
401   */
402   public Field<Integer> getSupplierField() throws AccessPoemException {
403     Column<Integer> c = _getDeliveryChargeTable().getSupplierColumn();
404     return new Field<Integer>((Integer)c.getRaw(this), c);
405   }
406 
407 
408  /**
409   * Retrieves the <code>Charge</code> value, without locking, 
410   * for this <code>DeliveryCharge</code> <code>Persistent</code>.
411   *
412   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
413   * @return the Double charge
414   */
415   public Double getCharge_unsafe() {
416     return charge;
417   }
418 
419 
420  /**
421   * Sets the <code>Charge</code> value directly, without checking, 
422   * for this DeliveryCharge <code>Persistent</code>.
423   * 
424   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
425   * @param cooked  the pre-validated value to set
426   */
427   public void setCharge_unsafe(Double cooked) {
428     charge = cooked;
429   }
430 
431  /**
432   * Retrieves the Charge value, with locking, for this 
433   * <code>DeliveryCharge</code> <code>Persistent</code>.
434   * Field description: 
435   *   The cost for delivering each book to a coutry in this band 
436   * 
437   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
438   * @throws AccessPoemException 
439   *         if the current <code>AccessToken</code> 
440   *         does not confer write access rights 
441   * @return the value of the field <code>Charge</code> for this 
442   *         <code>DeliveryCharge</code> <code>Persistent</code>  
443   */
444 
445   public Double getCharge()
446       throws AccessPoemException {
447     readLock();
448     return getCharge_unsafe();
449   }
450 
451 
452  /**
453   * Sets the <code>Charge</code> value, with checking, for this 
454   * <code>DeliveryCharge</code> <code>Persistent</code>.
455   * Field description: 
456   *   The cost for delivering each book to a coutry in this band 
457   * 
458   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
459   * @param cooked  a validated <code>int</code> 
460   * @throws AccessPoemException 
461   *         if the current <code>AccessToken</code> 
462   *         does not confer write access rights
463   * @throws ValidationPoemException 
464   *         if the value is not valid
465   */
466   public void setCharge(Double cooked)
467       throws AccessPoemException, ValidationPoemException {
468     _getDeliveryChargeTable().getChargeColumn().
469       getType().assertValidCooked(cooked);
470     writeLock();
471     setCharge_unsafe(cooked);
472   }
473 
474  /**
475   * Sets the <code>Charge</code> value, with checking, for this <code>DeliveryCharge</code> <code>Persistent</code>.
476   * Field description: 
477   *   The cost for delivering each book to a coutry in this band 
478   * 
479   * 
480   * Generated by org.melati.poem.prepro.DoubleFieldDef#generateBaseMethods 
481   * @param cooked  a validated <code>int</code> 
482   * @throws AccessPoemException 
483   *         if the current <code>AccessToken</code> 
484   *         does not confer write access rights
485   * @throws ValidationPoemException 
486   *         if the value is not valid
487   */
488 
489   public final void setCharge(double cooked)
490       throws AccessPoemException, ValidationPoemException {
491     setCharge(new Double(cooked));
492   }
493 
494 
495  /**
496   * Retrieves the <code>Charge</code> value as a <code>Field</code>
497   * from this <code>DeliveryCharge</code> <code>Persistent</code>.
498   * 
499   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
500   * @throws AccessPoemException 
501   *         if the current <code>AccessToken</code> 
502   *         does not confer write access rights
503   * @return the Double charge
504   */
505   public Field<Double> getChargeField() throws AccessPoemException {
506     Column<Double> c = _getDeliveryChargeTable().getChargeColumn();
507     return new Field<Double>((Double)c.getRaw(this), c);
508   }
509 
510 
511  /**
512   * Retrieves the <code>Ordercharge</code> value, without locking, 
513   * for this <code>DeliveryCharge</code> <code>Persistent</code>.
514   *
515   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
516   * @return the Double ordercharge
517   */
518   public Double getOrdercharge_unsafe() {
519     return ordercharge;
520   }
521 
522 
523  /**
524   * Sets the <code>Ordercharge</code> value directly, without checking, 
525   * for this DeliveryCharge <code>Persistent</code>.
526   * 
527   * see org.melati.poem.prepro.FieldDef#generateBaseMethods 
528   * @param cooked  the pre-validated value to set
529   */
530   public void setOrdercharge_unsafe(Double cooked) {
531     ordercharge = cooked;
532   }
533 
534  /**
535   * Retrieves the Ordercharge value, with locking, for this 
536   * <code>DeliveryCharge</code> <code>Persistent</code>.
537   * Field description: 
538   *   The cost for delivering the order (added to the per item charge) 
539   * 
540   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods 
541   * @throws AccessPoemException 
542   *         if the current <code>AccessToken</code> 
543   *         does not confer write access rights 
544   * @return the value of the field <code>Ordercharge</code> for this 
545   *         <code>DeliveryCharge</code> <code>Persistent</code>  
546   */
547 
548   public Double getOrdercharge()
549       throws AccessPoemException {
550     readLock();
551     return getOrdercharge_unsafe();
552   }
553 
554 
555  /**
556   * Sets the <code>Ordercharge</code> value, with checking, for this 
557   * <code>DeliveryCharge</code> <code>Persistent</code>.
558   * Field description: 
559   *   The cost for delivering the order (added to the per item charge) 
560   * 
561   * Generated by org.melati.poem.prepro.AtomFieldDef#generateBaseMethods  
562   * @param cooked  a validated <code>int</code> 
563   * @throws AccessPoemException 
564   *         if the current <code>AccessToken</code> 
565   *         does not confer write access rights
566   * @throws ValidationPoemException 
567   *         if the value is not valid
568   */
569   public void setOrdercharge(Double cooked)
570       throws AccessPoemException, ValidationPoemException {
571     _getDeliveryChargeTable().getOrderchargeColumn().
572       getType().assertValidCooked(cooked);
573     writeLock();
574     setOrdercharge_unsafe(cooked);
575   }
576 
577  /**
578   * Sets the <code>Ordercharge</code> value, with checking, for this <code>DeliveryCharge</code> <code>Persistent</code>.
579   * Field description: 
580   *   The cost for delivering the order (added to the per item charge) 
581   * 
582   * 
583   * Generated by org.melati.poem.prepro.DoubleFieldDef#generateBaseMethods 
584   * @param cooked  a validated <code>int</code> 
585   * @throws AccessPoemException 
586   *         if the current <code>AccessToken</code> 
587   *         does not confer write access rights
588   * @throws ValidationPoemException 
589   *         if the value is not valid
590   */
591 
592   public final void setOrdercharge(double cooked)
593       throws AccessPoemException, ValidationPoemException {
594     setOrdercharge(new Double(cooked));
595   }
596 
597 
598  /**
599   * Retrieves the <code>Ordercharge</code> value as a <code>Field</code>
600   * from this <code>DeliveryCharge</code> <code>Persistent</code>.
601   * 
602   * see org.melati.poem.prepro.FieldDef#generateFieldCreator 
603   * @throws AccessPoemException 
604   *         if the current <code>AccessToken</code> 
605   *         does not confer write access rights
606   * @return the Double ordercharge
607   */
608   public Field<Double> getOrderchargeField() throws AccessPoemException {
609     Column<Double> c = _getDeliveryChargeTable().getOrderchargeColumn();
610     return new Field<Double>((Double)c.getRaw(this), c);
611   }
612 
613 }
614