KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > campware > cream > om > BaseShipment


1 package org.campware.cream.om;
2
3
4 import java.math.BigDecimal JavaDoc;
5 import java.sql.Connection JavaDoc;
6 import java.util.ArrayList JavaDoc;
7 import java.util.Collections JavaDoc;
8 import java.util.Date JavaDoc;
9 import java.util.List JavaDoc;
10
11 import org.apache.commons.lang.ObjectUtils;
12 import org.apache.turbine.om.Retrievable;
13 import org.apache.torque.TorqueException;
14 import org.apache.torque.om.BaseObject;
15 import org.apache.torque.om.ComboKey;
16 import org.apache.torque.om.DateKey;
17 import org.apache.torque.om.NumberKey;
18 import org.apache.torque.om.ObjectKey;
19 import org.apache.torque.om.SimpleKey;
20 import org.apache.torque.om.StringKey;
21 import org.apache.torque.om.Persistent;
22 import org.apache.torque.util.Criteria;
23 import org.apache.torque.util.Transaction;
24
25   
26     
27     
28     
29     
30   
31 /**
32  * This class was autogenerated by Torque on:
33  *
34  * [Wed May 04 09:10:56 CEST 2005]
35  *
36  * You should not use this class directly. It should not even be
37  * extended all references should be to Shipment
38  */

39 public abstract class BaseShipment extends BaseObject
40     implements org.apache.turbine.om.Retrievable
41 {
42     /** The Peer class */
43     private static final ShipmentPeer peer =
44         new ShipmentPeer();
45
46         
47     /** The value for the shipmentId field */
48     private int shipmentId;
49                                                 
50     /** The value for the shipmentCode field */
51     private String JavaDoc shipmentCode = "AUTO";
52                                           
53     /** The value for the status field */
54     private int status = 30;
55                                           
56     /** The value for the priority field */
57     private int priority = 30;
58       
59     /** The value for the issuedDate field */
60     private Date JavaDoc issuedDate;
61       
62     /** The value for the closedDate field */
63     private Date JavaDoc closedDate;
64                                           
65     /** The value for the customerId field */
66     private int customerId = 1000;
67                                           
68     /** The value for the recipientId field */
69     private int recipientId = 1000;
70                                           
71     /** The value for the projectId field */
72     private int projectId = 1000;
73                                           
74     /** The value for the sorderId field */
75     private int sorderId = 1000;
76       
77     /** The value for the invoiceCode field */
78     private String JavaDoc invoiceCode;
79                                           
80     /** The value for the carrierId field */
81     private int carrierId = 1000;
82                                                 
83     /** The value for the subject field */
84     private String JavaDoc subject = "---";
85       
86     /** The value for the notes field */
87     private String JavaDoc notes;
88       
89     /** The value for the created field */
90     private Date JavaDoc created;
91       
92     /** The value for the modified field */
93     private Date JavaDoc modified;
94       
95     /** The value for the createdBy field */
96     private String JavaDoc createdBy;
97       
98     /** The value for the modifiedBy field */
99     private String JavaDoc modifiedBy;
100   
101     
102     /**
103      * Get the ShipmentId
104      *
105      * @return int
106      */

107     public int getShipmentId()
108     {
109         return shipmentId;
110     }
111
112                                               
113     /**
114      * Set the value of ShipmentId
115      *
116      * @param v new value
117      */

118     public void setShipmentId(int v) throws TorqueException
119     {
120     
121                   if (this.shipmentId != v)
122               {
123             this.shipmentId = v;
124             setModified(true);
125         }
126     
127           
128                                   
129                   // update associated ShipmentItem
130
if (collShipmentItems != null)
131         {
132             for (int i = 0; i < collShipmentItems.size(); i++)
133             {
134                 ((ShipmentItem) collShipmentItems.get(i))
135                     .setShipmentId(v);
136             }
137         }
138                                 }
139   
140     /**
141      * Get the ShipmentCode
142      *
143      * @return String
144      */

145     public String JavaDoc getShipmentCode()
146     {
147         return shipmentCode;
148     }
149
150                         
151     /**
152      * Set the value of ShipmentCode
153      *
154      * @param v new value
155      */

156     public void setShipmentCode(String JavaDoc v)
157     {
158     
159                   if (!ObjectUtils.equals(this.shipmentCode, v))
160               {
161             this.shipmentCode = v;
162             setModified(true);
163         }
164     
165           
166               }
167   
168     /**
169      * Get the Status
170      *
171      * @return int
172      */

173     public int getStatus()
174     {
175         return status;
176     }
177
178                         
179     /**
180      * Set the value of Status
181      *
182      * @param v new value
183      */

184     public void setStatus(int v)
185     {
186     
187                   if (this.status != v)
188               {
189             this.status = v;
190             setModified(true);
191         }
192     
193           
194               }
195   
196     /**
197      * Get the Priority
198      *
199      * @return int
200      */

201     public int getPriority()
202     {
203         return priority;
204     }
205
206                         
207     /**
208      * Set the value of Priority
209      *
210      * @param v new value
211      */

212     public void setPriority(int v)
213     {
214     
215                   if (this.priority != v)
216               {
217             this.priority = v;
218             setModified(true);
219         }
220     
221           
222               }
223   
224     /**
225      * Get the IssuedDate
226      *
227      * @return Date
228      */

229     public Date JavaDoc getIssuedDate()
230     {
231         return issuedDate;
232     }
233
234                         
235     /**
236      * Set the value of IssuedDate
237      *
238      * @param v new value
239      */

240     public void setIssuedDate(Date JavaDoc v)
241     {
242     
243                   if (!ObjectUtils.equals(this.issuedDate, v))
244               {
245             this.issuedDate = v;
246             setModified(true);
247         }
248     
249           
250               }
251   
252     /**
253      * Get the ClosedDate
254      *
255      * @return Date
256      */

257     public Date JavaDoc getClosedDate()
258     {
259         return closedDate;
260     }
261
262                         
263     /**
264      * Set the value of ClosedDate
265      *
266      * @param v new value
267      */

268     public void setClosedDate(Date JavaDoc v)
269     {
270     
271                   if (!ObjectUtils.equals(this.closedDate, v))
272               {
273             this.closedDate = v;
274             setModified(true);
275         }
276     
277           
278               }
279   
280     /**
281      * Get the CustomerId
282      *
283      * @return int
284      */

285     public int getCustomerId()
286     {
287         return customerId;
288     }
289
290                               
291     /**
292      * Set the value of CustomerId
293      *
294      * @param v new value
295      */

296     public void setCustomerId(int v) throws TorqueException
297     {
298     
299                   if (this.customerId != v)
300               {
301             this.customerId = v;
302             setModified(true);
303         }
304     
305                                                                   
306                 if (aCustomerRelatedByCustomerId != null && !(aCustomerRelatedByCustomerId.getCustomerId() == v))
307                 {
308             aCustomerRelatedByCustomerId = null;
309         }
310       
311               }
312   
313     /**
314      * Get the RecipientId
315      *
316      * @return int
317      */

318     public int getRecipientId()
319     {
320         return recipientId;
321     }
322
323                               
324     /**
325      * Set the value of RecipientId
326      *
327      * @param v new value
328      */

329     public void setRecipientId(int v) throws TorqueException
330     {
331     
332                   if (this.recipientId != v)
333               {
334             this.recipientId = v;
335             setModified(true);
336         }
337     
338                                                                   
339                 if (aCustomerRelatedByRecipientId != null && !(aCustomerRelatedByRecipientId.getCustomerId() == v))
340                 {
341             aCustomerRelatedByRecipientId = null;
342         }
343       
344               }
345   
346     /**
347      * Get the ProjectId
348      *
349      * @return int
350      */

351     public int getProjectId()
352     {
353         return projectId;
354     }
355
356                               
357     /**
358      * Set the value of ProjectId
359      *
360      * @param v new value
361      */

362     public void setProjectId(int v) throws TorqueException
363     {
364     
365                   if (this.projectId != v)
366               {
367             this.projectId = v;
368             setModified(true);
369         }
370     
371                           
372                 if (aProject != null && !(aProject.getProjectId() == v))
373                 {
374             aProject = null;
375         }
376       
377               }
378   
379     /**
380      * Get the SorderId
381      *
382      * @return int
383      */

384     public int getSorderId()
385     {
386         return sorderId;
387     }
388
389                               
390     /**
391      * Set the value of SorderId
392      *
393      * @param v new value
394      */

395     public void setSorderId(int v) throws TorqueException
396     {
397     
398                   if (this.sorderId != v)
399               {
400             this.sorderId = v;
401             setModified(true);
402         }
403     
404                           
405                 if (aSorder != null && !(aSorder.getSorderId() == v))
406                 {
407             aSorder = null;
408         }
409       
410               }
411   
412     /**
413      * Get the InvoiceCode
414      *
415      * @return String
416      */

417     public String JavaDoc getInvoiceCode()
418     {
419         return invoiceCode;
420     }
421
422                         
423     /**
424      * Set the value of InvoiceCode
425      *
426      * @param v new value
427      */

428     public void setInvoiceCode(String JavaDoc v)
429     {
430     
431                   if (!ObjectUtils.equals(this.invoiceCode, v))
432               {
433             this.invoiceCode = v;
434             setModified(true);
435         }
436     
437           
438               }
439   
440     /**
441      * Get the CarrierId
442      *
443      * @return int
444      */

445     public int getCarrierId()
446     {
447         return carrierId;
448     }
449
450                               
451     /**
452      * Set the value of CarrierId
453      *
454      * @param v new value
455      */

456     public void setCarrierId(int v) throws TorqueException
457     {
458     
459                   if (this.carrierId != v)
460               {
461             this.carrierId = v;
462             setModified(true);
463         }
464     
465                           
466                 if (aCarrier != null && !(aCarrier.getCarrierId() == v))
467                 {
468             aCarrier = null;
469         }
470       
471               }
472   
473     /**
474      * Get the Subject
475      *
476      * @return String
477      */

478     public String JavaDoc getSubject()
479     {
480         return subject;
481     }
482
483                         
484     /**
485      * Set the value of Subject
486      *
487      * @param v new value
488      */

489     public void setSubject(String JavaDoc v)
490     {
491     
492                   if (!ObjectUtils.equals(this.subject, v))
493               {
494             this.subject = v;
495             setModified(true);
496         }
497     
498           
499               }
500   
501     /**
502      * Get the Notes
503      *
504      * @return String
505      */

506     public String JavaDoc getNotes()
507     {
508         return notes;
509     }
510
511                         
512     /**
513      * Set the value of Notes
514      *
515      * @param v new value
516      */

517     public void setNotes(String JavaDoc v)
518     {
519     
520                   if (!ObjectUtils.equals(this.notes, v))
521               {
522             this.notes = v;
523             setModified(true);
524         }
525     
526           
527               }
528   
529     /**
530      * Get the Created
531      *
532      * @return Date
533      */

534     public Date JavaDoc getCreated()
535     {
536         return created;
537     }
538
539                         
540     /**
541      * Set the value of Created
542      *
543      * @param v new value
544      */

545     public void setCreated(Date JavaDoc v)
546     {
547     
548                   if (!ObjectUtils.equals(this.created, v))
549               {
550             this.created = v;
551             setModified(true);
552         }
553     
554           
555               }
556   
557     /**
558      * Get the Modified
559      *
560      * @return Date
561      */

562     public Date JavaDoc getModified()
563     {
564         return modified;
565     }
566
567                         
568     /**
569      * Set the value of Modified
570      *
571      * @param v new value
572      */

573     public void setModified(Date JavaDoc v)
574     {
575     
576                   if (!ObjectUtils.equals(this.modified, v))
577               {
578             this.modified = v;
579             setModified(true);
580         }
581     
582           
583               }
584   
585     /**
586      * Get the CreatedBy
587      *
588      * @return String
589      */

590     public String JavaDoc getCreatedBy()
591     {
592         return createdBy;
593     }
594
595                         
596     /**
597      * Set the value of CreatedBy
598      *
599      * @param v new value
600      */

601     public void setCreatedBy(String JavaDoc v)
602     {
603     
604                   if (!ObjectUtils.equals(this.createdBy, v))
605               {
606             this.createdBy = v;
607             setModified(true);
608         }
609     
610           
611               }
612   
613     /**
614      * Get the ModifiedBy
615      *
616      * @return String
617      */

618     public String JavaDoc getModifiedBy()
619     {
620         return modifiedBy;
621     }
622
623                         
624     /**
625      * Set the value of ModifiedBy
626      *
627      * @param v new value
628      */

629     public void setModifiedBy(String JavaDoc v)
630     {
631     
632                   if (!ObjectUtils.equals(this.modifiedBy, v))
633               {
634             this.modifiedBy = v;
635             setModified(true);
636         }
637     
638           
639               }
640   
641       
642     
643                         
644         
645         private Customer aCustomerRelatedByCustomerId;
646
647     /**
648      * Declares an association between this object and a Customer object
649      *
650      * @param v Customer
651      * @throws TorqueException
652      */

653     public void setCustomerRelatedByCustomerId(Customer v) throws TorqueException
654     {
655             if (v == null)
656         {
657                           setCustomerId( 1000);
658               }
659         else
660         {
661             setCustomerId(v.getCustomerId());
662         }
663             aCustomerRelatedByCustomerId = v;
664     }
665
666                                             
667     /**
668      * Get the associated Customer object
669      *
670      * @return the associated Customer object
671      * @throws TorqueException
672      */

673     public Customer getCustomerRelatedByCustomerId() throws TorqueException
674     {
675         if (aCustomerRelatedByCustomerId == null && (this.customerId != 0))
676         {
677                           aCustomerRelatedByCustomerId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.customerId));
678               
679             /* The following can be used instead of the line above to
680                guarantee the related object contains a reference
681                to this object, but this level of coupling
682                may be undesirable in many circumstances.
683                As it can lead to a db query with many results that may
684                never be used.
685                Customer obj = CustomerPeer.retrieveByPK(this.customerId);
686                obj.addShipmentsRelatedByCustomerId(this);
687             */

688         }
689         return aCustomerRelatedByCustomerId;
690     }
691
692     /**
693      * Provides convenient way to set a relationship based on a
694      * ObjectKey, for example
695      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
696      *
697          */

698     public void setCustomerRelatedByCustomerIdKey(ObjectKey key) throws TorqueException
699     {
700       
701                         setCustomerId(((NumberKey) key).intValue());
702                   }
703     
704     
705                         
706         
707         private Customer aCustomerRelatedByRecipientId;
708
709     /**
710      * Declares an association between this object and a Customer object
711      *
712      * @param v Customer
713      * @throws TorqueException
714      */

715     public void setCustomerRelatedByRecipientId(Customer v) throws TorqueException
716     {
717             if (v == null)
718         {
719                           setRecipientId( 1000);
720               }
721         else
722         {
723             setRecipientId(v.getCustomerId());
724         }
725             aCustomerRelatedByRecipientId = v;
726     }
727
728                                             
729     /**
730      * Get the associated Customer object
731      *
732      * @return the associated Customer object
733      * @throws TorqueException
734      */

735     public Customer getCustomerRelatedByRecipientId() throws TorqueException
736     {
737         if (aCustomerRelatedByRecipientId == null && (this.recipientId != 0))
738         {
739                           aCustomerRelatedByRecipientId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.recipientId));
740               
741             /* The following can be used instead of the line above to
742                guarantee the related object contains a reference
743                to this object, but this level of coupling
744                may be undesirable in many circumstances.
745                As it can lead to a db query with many results that may
746                never be used.
747                Customer obj = CustomerPeer.retrieveByPK(this.recipientId);
748                obj.addShipmentsRelatedByRecipientId(this);
749             */

750         }
751         return aCustomerRelatedByRecipientId;
752     }
753
754     /**
755      * Provides convenient way to set a relationship based on a
756      * ObjectKey, for example
757      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
758      *
759          */

760     public void setCustomerRelatedByRecipientIdKey(ObjectKey key) throws TorqueException
761     {
762       
763                         setRecipientId(((NumberKey) key).intValue());
764                   }
765     
766     
767                   
768     
769         private Project aProject;
770
771     /**
772      * Declares an association between this object and a Project object
773      *
774      * @param v Project
775      * @throws TorqueException
776      */

777     public void setProject(Project v) throws TorqueException
778     {
779             if (v == null)
780         {
781                           setProjectId( 1000);
782               }
783         else
784         {
785             setProjectId(v.getProjectId());
786         }
787             aProject = v;
788     }
789
790                                             
791     /**
792      * Get the associated Project object
793      *
794      * @return the associated Project object
795      * @throws TorqueException
796      */

797     public Project getProject() throws TorqueException
798     {
799         if (aProject == null && (this.projectId != 0))
800         {
801                           aProject = ProjectPeer.retrieveByPK(SimpleKey.keyFor(this.projectId));
802               
803             /* The following can be used instead of the line above to
804                guarantee the related object contains a reference
805                to this object, but this level of coupling
806                may be undesirable in many circumstances.
807                As it can lead to a db query with many results that may
808                never be used.
809                Project obj = ProjectPeer.retrieveByPK(this.projectId);
810                obj.addShipments(this);
811             */

812         }
813         return aProject;
814     }
815
816     /**
817      * Provides convenient way to set a relationship based on a
818      * ObjectKey, for example
819      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
820      *
821          */

822     public void setProjectKey(ObjectKey key) throws TorqueException
823     {
824       
825                         setProjectId(((NumberKey) key).intValue());
826                   }
827     
828     
829                   
830     
831         private Sorder aSorder;
832
833     /**
834      * Declares an association between this object and a Sorder object
835      *
836      * @param v Sorder
837      * @throws TorqueException
838      */

839     public void setSorder(Sorder v) throws TorqueException
840     {
841             if (v == null)
842         {
843                           setSorderId( 1000);
844               }
845         else
846         {
847             setSorderId(v.getSorderId());
848         }
849             aSorder = v;
850     }
851
852                                             
853     /**
854      * Get the associated Sorder object
855      *
856      * @return the associated Sorder object
857      * @throws TorqueException
858      */

859     public Sorder getSorder() throws TorqueException
860     {
861         if (aSorder == null && (this.sorderId != 0))
862         {
863                           aSorder = SorderPeer.retrieveByPK(SimpleKey.keyFor(this.sorderId));
864               
865             /* The following can be used instead of the line above to
866                guarantee the related object contains a reference
867                to this object, but this level of coupling
868                may be undesirable in many circumstances.
869                As it can lead to a db query with many results that may
870                never be used.
871                Sorder obj = SorderPeer.retrieveByPK(this.sorderId);
872                obj.addShipments(this);
873             */

874         }
875         return aSorder;
876     }
877
878     /**
879      * Provides convenient way to set a relationship based on a
880      * ObjectKey, for example
881      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
882      *
883          */

884     public void setSorderKey(ObjectKey key) throws TorqueException
885     {
886       
887                         setSorderId(((NumberKey) key).intValue());
888                   }
889     
890     
891                   
892     
893         private Carrier aCarrier;
894
895     /**
896      * Declares an association between this object and a Carrier object
897      *
898      * @param v Carrier
899      * @throws TorqueException
900      */

901     public void setCarrier(Carrier v) throws TorqueException
902     {
903             if (v == null)
904         {
905                           setCarrierId( 1000);
906               }
907         else
908         {
909             setCarrierId(v.getCarrierId());
910         }
911             aCarrier = v;
912     }
913
914                                             
915     /**
916      * Get the associated Carrier object
917      *
918      * @return the associated Carrier object
919      * @throws TorqueException
920      */

921     public Carrier getCarrier() throws TorqueException
922     {
923         if (aCarrier == null && (this.carrierId != 0))
924         {
925                           aCarrier = CarrierPeer.retrieveByPK(SimpleKey.keyFor(this.carrierId));
926               
927             /* The following can be used instead of the line above to
928                guarantee the related object contains a reference
929                to this object, but this level of coupling
930                may be undesirable in many circumstances.
931                As it can lead to a db query with many results that may
932                never be used.
933                Carrier obj = CarrierPeer.retrieveByPK(this.carrierId);
934                obj.addShipments(this);
935             */

936         }
937         return aCarrier;
938     }
939
940     /**
941      * Provides convenient way to set a relationship based on a
942      * ObjectKey, for example
943      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
944      *
945          */

946     public void setCarrierKey(ObjectKey key) throws TorqueException
947     {
948       
949                         setCarrierId(((NumberKey) key).intValue());
950                   }
951        
952                                 
953             
954           /**
955      * Collection to store aggregation of collShipmentItems
956      */

957     protected List JavaDoc collShipmentItems;
958
959     /**
960      * Temporary storage of collShipmentItems to save a possible db hit in
961      * the event objects are add to the collection, but the
962      * complete collection is never requested.
963      */

964     protected void initShipmentItems()
965     {
966         if (collShipmentItems == null)
967         {
968             collShipmentItems = new ArrayList JavaDoc();
969         }
970     }
971
972     /**
973      * Method called to associate a ShipmentItem object to this object
974      * through the ShipmentItem foreign key attribute
975      *
976      * @param l ShipmentItem
977      * @throws TorqueException
978      */

979     public void addShipmentItem(ShipmentItem l) throws TorqueException
980     {
981         getShipmentItems().add(l);
982         l.setShipment((Shipment) this);
983     }
984
985     /**
986      * The criteria used to select the current contents of collShipmentItems
987      */

988     private Criteria lastShipmentItemsCriteria = null;
989       
990     /**
991      * If this collection has already been initialized, returns
992      * the collection. Otherwise returns the results of
993      * getShipmentItems(new Criteria())
994      *
995      * @throws TorqueException
996      */

997     public List JavaDoc getShipmentItems() throws TorqueException
998     {
999               if (collShipmentItems == null)
1000        {
1001            collShipmentItems = getShipmentItems(new Criteria(10));
1002        }
1003        return collShipmentItems;
1004          }
1005
1006    /**
1007     * If this collection has already been initialized with
1008     * an identical criteria, it returns the collection.
1009     * Otherwise if this Shipment has previously
1010     * been saved, it will retrieve related ShipmentItems from storage.
1011     * If this Shipment is new, it will return
1012     * an empty collection or the current collection, the criteria
1013     * is ignored on a new object.
1014     *
1015     * @throws TorqueException
1016     */

1017    public List JavaDoc getShipmentItems(Criteria criteria) throws TorqueException
1018    {
1019              if (collShipmentItems == null)
1020        {
1021            if (isNew())
1022            {
1023               collShipmentItems = new ArrayList JavaDoc();
1024            }
1025            else
1026            {
1027                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId() );
1028                        collShipmentItems = ShipmentItemPeer.doSelect(criteria);
1029            }
1030        }
1031        else
1032        {
1033            // criteria has no effect for a new object
1034
if (!isNew())
1035            {
1036                // the following code is to determine if a new query is
1037
// called for. If the criteria is the same as the last
1038
// one, just return the collection.
1039
criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1040                            if (!lastShipmentItemsCriteria.equals(criteria))
1041                {
1042                    collShipmentItems = ShipmentItemPeer.doSelect(criteria);
1043                }
1044            }
1045        }
1046        lastShipmentItemsCriteria = criteria;
1047
1048        return collShipmentItems;
1049          }
1050
1051    /**
1052     * If this collection has already been initialized, returns
1053     * the collection. Otherwise returns the results of
1054     * getShipmentItems(new Criteria(),Connection)
1055     * This method takes in the Connection also as input so that
1056     * referenced objects can also be obtained using a Connection
1057     * that is taken as input
1058     */

1059    public List JavaDoc getShipmentItems(Connection JavaDoc con) throws TorqueException
1060    {
1061              if (collShipmentItems == null)
1062        {
1063            collShipmentItems = getShipmentItems(new Criteria(10), con);
1064        }
1065        return collShipmentItems;
1066          }
1067
1068    /**
1069     * If this collection has already been initialized with
1070     * an identical criteria, it returns the collection.
1071     * Otherwise if this Shipment has previously
1072     * been saved, it will retrieve related ShipmentItems from storage.
1073     * If this Shipment is new, it will return
1074     * an empty collection or the current collection, the criteria
1075     * is ignored on a new object.
1076     * This method takes in the Connection also as input so that
1077     * referenced objects can also be obtained using a Connection
1078     * that is taken as input
1079     */

1080    public List JavaDoc getShipmentItems(Criteria criteria, Connection JavaDoc con)
1081            throws TorqueException
1082    {
1083              if (collShipmentItems == null)
1084        {
1085            if (isNew())
1086            {
1087               collShipmentItems = new ArrayList JavaDoc();
1088            }
1089            else
1090            {
1091                         criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1092                         collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
1093             }
1094         }
1095         else
1096         {
1097             // criteria has no effect for a new object
1098
if (!isNew())
1099             {
1100                 // the following code is to determine if a new query is
1101
// called for. If the criteria is the same as the last
1102
// one, just return the collection.
1103
criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1104                             if (!lastShipmentItemsCriteria.equals(criteria))
1105                 {
1106                     collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
1107                 }
1108             }
1109         }
1110         lastShipmentItemsCriteria = criteria;
1111
1112         return collShipmentItems;
1113           }
1114
1115                                                
1116              
1117                    
1118                              
1119                                
1120                                                              
1121                                        
1122                    
1123                    
1124          
1125    /**
1126     * If this collection has already been initialized with
1127     * an identical criteria, it returns the collection.
1128     * Otherwise if this Shipment is new, it will return
1129     * an empty collection; or if this Shipment has previously
1130     * been saved, it will retrieve related ShipmentItems from storage.
1131     *
1132     * This method is protected by default in order to keep the public
1133     * api reasonable. You can provide public methods for those you
1134     * actually need in Shipment.
1135     */

1136    protected List JavaDoc getShipmentItemsJoinShipment(Criteria criteria)
1137        throws TorqueException
1138    {
1139                    if (collShipmentItems == null)
1140        {
1141            if (isNew())
1142            {
1143               collShipmentItems = new ArrayList JavaDoc();
1144            }
1145            else
1146            {
1147                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1148                              collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
1149            }
1150        }
1151        else
1152        {
1153            // the following code is to determine if a new query is
1154
// called for. If the criteria is the same as the last
1155
// one, just return the collection.
1156

1157                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1158                                    if (!lastShipmentItemsCriteria.equals(criteria))
1159            {
1160                collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
1161            }
1162        }
1163        lastShipmentItemsCriteria = criteria;
1164
1165        return collShipmentItems;
1166                }
1167                  
1168                    
1169                    
1170                                
1171                                                              
1172                                        
1173                    
1174                    
1175          
1176    /**
1177     * If this collection has already been initialized with
1178     * an identical criteria, it returns the collection.
1179     * Otherwise if this Shipment is new, it will return
1180     * an empty collection; or if this Shipment has previously
1181     * been saved, it will retrieve related ShipmentItems from storage.
1182     *
1183     * This method is protected by default in order to keep the public
1184     * api reasonable. You can provide public methods for those you
1185     * actually need in Shipment.
1186     */

1187    protected List JavaDoc getShipmentItemsJoinSorder(Criteria criteria)
1188        throws TorqueException
1189    {
1190                    if (collShipmentItems == null)
1191        {
1192            if (isNew())
1193            {
1194               collShipmentItems = new ArrayList JavaDoc();
1195            }
1196            else
1197            {
1198                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1199                              collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
1200            }
1201        }
1202        else
1203        {
1204            // the following code is to determine if a new query is
1205
// called for. If the criteria is the same as the last
1206
// one, just return the collection.
1207

1208                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1209                                    if (!lastShipmentItemsCriteria.equals(criteria))
1210            {
1211                collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
1212            }
1213        }
1214        lastShipmentItemsCriteria = criteria;
1215
1216        return collShipmentItems;
1217                }
1218                  
1219                    
1220                    
1221                                
1222                                                              
1223                                        
1224                    
1225                    
1226          
1227    /**
1228     * If this collection has already been initialized with
1229     * an identical criteria, it returns the collection.
1230     * Otherwise if this Shipment is new, it will return
1231     * an empty collection; or if this Shipment has previously
1232     * been saved, it will retrieve related ShipmentItems from storage.
1233     *
1234     * This method is protected by default in order to keep the public
1235     * api reasonable. You can provide public methods for those you
1236     * actually need in Shipment.
1237     */

1238    protected List JavaDoc getShipmentItemsJoinProduct(Criteria criteria)
1239        throws TorqueException
1240    {
1241                    if (collShipmentItems == null)
1242        {
1243            if (isNew())
1244            {
1245               collShipmentItems = new ArrayList JavaDoc();
1246            }
1247            else
1248            {
1249                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1250                              collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
1251            }
1252        }
1253        else
1254        {
1255            // the following code is to determine if a new query is
1256
// called for. If the criteria is the same as the last
1257
// one, just return the collection.
1258

1259                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1260                                    if (!lastShipmentItemsCriteria.equals(criteria))
1261            {
1262                collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
1263            }
1264        }
1265        lastShipmentItemsCriteria = criteria;
1266
1267        return collShipmentItems;
1268                }
1269                  
1270                    
1271                    
1272                                            
1273                                                                          
1274                                        
1275                    
1276                    
1277          
1278    /**
1279     * If this collection has already been initialized with
1280     * an identical criteria, it returns the collection.
1281     * Otherwise if this Shipment is new, it will return
1282     * an empty collection; or if this Shipment has previously
1283     * been saved, it will retrieve related ShipmentItems from storage.
1284     *
1285     * This method is protected by default in order to keep the public
1286     * api reasonable. You can provide public methods for those you
1287     * actually need in Shipment.
1288     */

1289    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
1290        throws TorqueException
1291    {
1292                    if (collShipmentItems == null)
1293        {
1294            if (isNew())
1295            {
1296               collShipmentItems = new ArrayList JavaDoc();
1297            }
1298            else
1299            {
1300                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1301                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1302            }
1303        }
1304        else
1305        {
1306            // the following code is to determine if a new query is
1307
// called for. If the criteria is the same as the last
1308
// one, just return the collection.
1309

1310                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1311                                    if (!lastShipmentItemsCriteria.equals(criteria))
1312            {
1313                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1314            }
1315        }
1316        lastShipmentItemsCriteria = criteria;
1317
1318        return collShipmentItems;
1319                }
1320                  
1321                    
1322                    
1323                                            
1324                                                                          
1325                                        
1326                    
1327                    
1328          
1329    /**
1330     * If this collection has already been initialized with
1331     * an identical criteria, it returns the collection.
1332     * Otherwise if this Shipment is new, it will return
1333     * an empty collection; or if this Shipment has previously
1334     * been saved, it will retrieve related ShipmentItems from storage.
1335     *
1336     * This method is protected by default in order to keep the public
1337     * api reasonable. You can provide public methods for those you
1338     * actually need in Shipment.
1339     */

1340    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
1341        throws TorqueException
1342    {
1343                    if (collShipmentItems == null)
1344        {
1345            if (isNew())
1346            {
1347               collShipmentItems = new ArrayList JavaDoc();
1348            }
1349            else
1350            {
1351                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1352                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1353            }
1354        }
1355        else
1356        {
1357            // the following code is to determine if a new query is
1358
// called for. If the criteria is the same as the last
1359
// one, just return the collection.
1360

1361                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1362                                    if (!lastShipmentItemsCriteria.equals(criteria))
1363            {
1364                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1365            }
1366        }
1367        lastShipmentItemsCriteria = criteria;
1368
1369        return collShipmentItems;
1370                }
1371                  
1372                    
1373                    
1374                                
1375                                                              
1376                                        
1377                    
1378                    
1379          
1380    /**
1381     * If this collection has already been initialized with
1382     * an identical criteria, it returns the collection.
1383     * Otherwise if this Shipment is new, it will return
1384     * an empty collection; or if this Shipment has previously
1385     * been saved, it will retrieve related ShipmentItems from storage.
1386     *
1387     * This method is protected by default in order to keep the public
1388     * api reasonable. You can provide public methods for those you
1389     * actually need in Shipment.
1390     */

1391    protected List JavaDoc getShipmentItemsJoinProject(Criteria criteria)
1392        throws TorqueException
1393    {
1394                    if (collShipmentItems == null)
1395        {
1396            if (isNew())
1397            {
1398               collShipmentItems = new ArrayList JavaDoc();
1399            }
1400            else
1401            {
1402                              criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1403                              collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
1404            }
1405        }
1406        else
1407        {
1408            // the following code is to determine if a new query is
1409
// called for. If the criteria is the same as the last
1410
// one, just return the collection.
1411

1412                        criteria.add(ShipmentItemPeer.SHIPMENT_ID, getShipmentId());
1413                                    if (!lastShipmentItemsCriteria.equals(criteria))
1414            {
1415                collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
1416            }
1417        }
1418        lastShipmentItemsCriteria = criteria;
1419
1420        return collShipmentItems;
1421                }
1422                            
1423
1424
1425          
1426    private static List JavaDoc fieldNames = null;
1427
1428    /**
1429     * Generate a list of field names.
1430     *
1431     * @return a list of field names
1432     */

1433    public static synchronized List JavaDoc getFieldNames()
1434    {
1435        if (fieldNames == null)
1436        {
1437            fieldNames = new ArrayList JavaDoc();
1438              fieldNames.add("ShipmentId");
1439              fieldNames.add("ShipmentCode");
1440              fieldNames.add("Status");
1441              fieldNames.add("Priority");
1442              fieldNames.add("IssuedDate");
1443              fieldNames.add("ClosedDate");
1444              fieldNames.add("CustomerId");
1445              fieldNames.add("RecipientId");
1446              fieldNames.add("ProjectId");
1447              fieldNames.add("SorderId");
1448              fieldNames.add("InvoiceCode");
1449              fieldNames.add("CarrierId");
1450              fieldNames.add("Subject");
1451              fieldNames.add("Notes");
1452              fieldNames.add("Created");
1453              fieldNames.add("Modified");
1454              fieldNames.add("CreatedBy");
1455              fieldNames.add("ModifiedBy");
1456              fieldNames = Collections.unmodifiableList(fieldNames);
1457        }
1458        return fieldNames;
1459    }
1460
1461    /**
1462     * Retrieves a field from the object by name passed in as a String.
1463     *
1464     * @param name field name
1465     * @return value
1466     */

1467    public Object JavaDoc getByName(String JavaDoc name)
1468    {
1469          if (name.equals("ShipmentId"))
1470        {
1471                return new Integer JavaDoc(getShipmentId());
1472            }
1473          if (name.equals("ShipmentCode"))
1474        {
1475                return getShipmentCode();
1476            }
1477          if (name.equals("Status"))
1478        {
1479                return new Integer JavaDoc(getStatus());
1480            }
1481          if (name.equals("Priority"))
1482        {
1483                return new Integer JavaDoc(getPriority());
1484            }
1485          if (name.equals("IssuedDate"))
1486        {
1487                return getIssuedDate();
1488            }
1489          if (name.equals("ClosedDate"))
1490        {
1491                return getClosedDate();
1492            }
1493          if (name.equals("CustomerId"))
1494        {
1495                return new Integer JavaDoc(getCustomerId());
1496            }
1497          if (name.equals("RecipientId"))
1498        {
1499                return new Integer JavaDoc(getRecipientId());
1500            }
1501          if (name.equals("ProjectId"))
1502        {
1503                return new Integer JavaDoc(getProjectId());
1504            }
1505          if (name.equals("SorderId"))
1506        {
1507                return new Integer JavaDoc(getSorderId());
1508            }
1509          if (name.equals("InvoiceCode"))
1510        {
1511                return getInvoiceCode();
1512            }
1513          if (name.equals("CarrierId"))
1514        {
1515                return new Integer JavaDoc(getCarrierId());
1516            }
1517          if (name.equals("Subject"))
1518        {
1519                return getSubject();
1520            }
1521          if (name.equals("Notes"))
1522        {
1523                return getNotes();
1524            }
1525          if (name.equals("Created"))
1526        {
1527                return getCreated();
1528            }
1529          if (name.equals("Modified"))
1530        {
1531                return getModified();
1532            }
1533          if (name.equals("CreatedBy"))
1534        {
1535                return getCreatedBy();
1536            }
1537          if (name.equals("ModifiedBy"))
1538        {
1539                return getModifiedBy();
1540            }
1541          return null;
1542    }
1543    
1544    /**
1545     * Retrieves a field from the object by name passed in
1546     * as a String. The String must be one of the static
1547     * Strings defined in this Class' Peer.
1548     *
1549     * @param name peer name
1550     * @return value
1551     */

1552    public Object JavaDoc getByPeerName(String JavaDoc name)
1553    {
1554          if (name.equals(ShipmentPeer.SHIPMENT_ID))
1555        {
1556                return new Integer JavaDoc(getShipmentId());
1557            }
1558          if (name.equals(ShipmentPeer.SHIPMENT_CODE))
1559        {
1560                return getShipmentCode();
1561            }
1562          if (name.equals(ShipmentPeer.STATUS))
1563        {
1564                return new Integer JavaDoc(getStatus());
1565            }
1566          if (name.equals(ShipmentPeer.PRIORITY))
1567        {
1568                return new Integer JavaDoc(getPriority());
1569            }
1570          if (name.equals(ShipmentPeer.ISSUED_DATE))
1571        {
1572                return getIssuedDate();
1573            }
1574          if (name.equals(ShipmentPeer.CLOSED_DATE))
1575        {
1576                return getClosedDate();
1577            }
1578          if (name.equals(ShipmentPeer.CUSTOMER_ID))
1579        {
1580                return new Integer JavaDoc(getCustomerId());
1581            }
1582          if (name.equals(ShipmentPeer.RECIPIENT_ID))
1583        {
1584                return new Integer JavaDoc(getRecipientId());
1585            }
1586          if (name.equals(ShipmentPeer.PROJECT_ID))
1587        {
1588                return new Integer JavaDoc(getProjectId());
1589            }
1590          if (name.equals(ShipmentPeer.SORDER_ID))
1591        {
1592                return new Integer JavaDoc(getSorderId());
1593            }
1594          if (name.equals(ShipmentPeer.INVOICE_CODE))
1595        {
1596                return getInvoiceCode();
1597            }
1598          if (name.equals(ShipmentPeer.CARRIER_ID))
1599        {
1600                return new Integer JavaDoc(getCarrierId());
1601            }
1602          if (name.equals(ShipmentPeer.SUBJECT))
1603        {
1604                return getSubject();
1605            }
1606          if (name.equals(ShipmentPeer.NOTES))
1607        {
1608                return getNotes();
1609            }
1610          if (name.equals(ShipmentPeer.CREATED))
1611        {
1612                return getCreated();
1613            }
1614          if (name.equals(ShipmentPeer.MODIFIED))
1615        {
1616                return getModified();
1617            }
1618          if (name.equals(ShipmentPeer.CREATED_BY))
1619        {
1620                return getCreatedBy();
1621            }
1622          if (name.equals(ShipmentPeer.MODIFIED_BY))
1623        {
1624                return getModifiedBy();
1625            }
1626          return null;
1627    }
1628
1629    /**
1630     * Retrieves a field from the object by Position as specified
1631     * in the xml schema. Zero-based.
1632     *
1633     * @param pos position in xml schema
1634     * @return value
1635     */

1636    public Object JavaDoc getByPosition(int pos)
1637    {
1638            if (pos == 0)
1639        {
1640                return new Integer JavaDoc(getShipmentId());
1641            }
1642              if (pos == 1)
1643        {
1644                return getShipmentCode();
1645            }
1646              if (pos == 2)
1647        {
1648                return new Integer JavaDoc(getStatus());
1649            }
1650              if (pos == 3)
1651        {
1652                return new Integer JavaDoc(getPriority());
1653            }
1654              if (pos == 4)
1655        {
1656                return getIssuedDate();
1657            }
1658              if (pos == 5)
1659        {
1660                return getClosedDate();
1661            }
1662              if (pos == 6)
1663        {
1664                return new Integer JavaDoc(getCustomerId());
1665            }
1666              if (pos == 7)
1667        {
1668                return new Integer JavaDoc(getRecipientId());
1669            }
1670              if (pos == 8)
1671        {
1672                return new Integer JavaDoc(getProjectId());
1673            }
1674              if (pos == 9)
1675        {
1676                return new Integer JavaDoc(getSorderId());
1677            }
1678              if (pos == 10)
1679        {
1680                return getInvoiceCode();
1681            }
1682              if (pos == 11)
1683        {
1684                return new Integer JavaDoc(getCarrierId());
1685            }
1686              if (pos == 12)
1687        {
1688                return getSubject();
1689            }
1690              if (pos == 13)
1691        {
1692                return getNotes();
1693            }
1694              if (pos == 14)
1695        {
1696                return getCreated();
1697            }
1698              if (pos == 15)
1699        {
1700                return getModified();
1701            }
1702              if (pos == 16)
1703        {
1704                return getCreatedBy();
1705            }
1706              if (pos == 17)
1707        {
1708                return getModifiedBy();
1709            }
1710              return null;
1711    }
1712     
1713    /**
1714     * Stores the object in the database. If the object is new,
1715     * it inserts it; otherwise an update is performed.
1716     *
1717     * @throws Exception
1718     */

1719    public void save() throws Exception JavaDoc
1720    {
1721          save(ShipmentPeer.getMapBuilder()
1722                .getDatabaseMap().getName());
1723      }
1724
1725    /**
1726     * Stores the object in the database. If the object is new,
1727     * it inserts it; otherwise an update is performed.
1728       * Note: this code is here because the method body is
1729     * auto-generated conditionally and therefore needs to be
1730     * in this file instead of in the super class, BaseObject.
1731       *
1732     * @param dbName
1733     * @throws TorqueException
1734     */

1735    public void save(String JavaDoc dbName) throws TorqueException
1736    {
1737        Connection JavaDoc con = null;
1738          try
1739        {
1740            con = Transaction.begin(dbName);
1741            save(con);
1742            Transaction.commit(con);
1743        }
1744        catch(TorqueException e)
1745        {
1746            Transaction.safeRollback(con);
1747            throw e;
1748        }
1749      }
1750
1751      /** flag to prevent endless save loop, if this object is referenced
1752        by another object which falls in this transaction. */

1753    private boolean alreadyInSave = false;
1754      /**
1755     * Stores the object in the database. If the object is new,
1756     * it inserts it; otherwise an update is performed. This method
1757     * is meant to be used as part of a transaction, otherwise use
1758     * the save() method and the connection details will be handled
1759     * internally
1760     *
1761     * @param con
1762     * @throws TorqueException
1763     */

1764    public void save(Connection JavaDoc con) throws TorqueException
1765    {
1766          if (!alreadyInSave)
1767        {
1768            alreadyInSave = true;
1769
1770
1771  
1772            // If this object has been modified, then save it to the database.
1773
if (isModified())
1774            {
1775                if (isNew())
1776                {
1777                    ShipmentPeer.doInsert((Shipment) this, con);
1778                    setNew(false);
1779                }
1780                else
1781                {
1782                    ShipmentPeer.doUpdate((Shipment) this, con);
1783                }
1784            }
1785
1786                                      
1787                
1788                    if (collShipmentItems != null)
1789            {
1790                for (int i = 0; i < collShipmentItems.size(); i++)
1791                {
1792                    ((ShipmentItem) collShipmentItems.get(i)).save(con);
1793                }
1794            }
1795                                  alreadyInSave = false;
1796        }
1797      }
1798
1799                        
1800      /**
1801     * Set the PrimaryKey using ObjectKey.
1802     *
1803     * @param key shipmentId ObjectKey
1804     */

1805    public void setPrimaryKey(ObjectKey key)
1806        throws TorqueException
1807    {
1808            setShipmentId(((NumberKey) key).intValue());
1809        }
1810
1811    /**
1812     * Set the PrimaryKey using a String.
1813     *
1814     * @param key
1815     */

1816    public void setPrimaryKey(String JavaDoc key) throws TorqueException
1817    {
1818            setShipmentId(Integer.parseInt(key));
1819        }
1820
1821  
1822    /**
1823     * returns an id that differentiates this object from others
1824     * of its class.
1825     */

1826    public ObjectKey getPrimaryKey()
1827    {
1828          return SimpleKey.keyFor(getShipmentId());
1829      }
1830 
1831    /**
1832     * get an id that differentiates this object from others
1833     * of its class.
1834     */

1835    public String JavaDoc getQueryKey()
1836    {
1837        if (getPrimaryKey() == null)
1838        {
1839            return "";
1840        }
1841        else
1842        {
1843            return getPrimaryKey().toString();
1844        }
1845    }
1846
1847    /**
1848     * set an id that differentiates this object from others
1849     * of its class.
1850     */

1851    public void setQueryKey(String JavaDoc key)
1852        throws TorqueException
1853    {
1854        setPrimaryKey(key);
1855    }
1856
1857    /**
1858     * Makes a copy of this object.
1859     * It creates a new object filling in the simple attributes.
1860       * It then fills all the association collections and sets the
1861     * related objects to isNew=true.
1862       */

1863      public Shipment copy() throws TorqueException
1864    {
1865        return copyInto(new Shipment());
1866    }
1867  
1868    protected Shipment copyInto(Shipment copyObj) throws TorqueException
1869    {
1870          copyObj.setShipmentId(shipmentId);
1871          copyObj.setShipmentCode(shipmentCode);
1872          copyObj.setStatus(status);
1873          copyObj.setPriority(priority);
1874          copyObj.setIssuedDate(issuedDate);
1875          copyObj.setClosedDate(closedDate);
1876          copyObj.setCustomerId(customerId);
1877          copyObj.setRecipientId(recipientId);
1878          copyObj.setProjectId(projectId);
1879          copyObj.setSorderId(sorderId);
1880          copyObj.setInvoiceCode(invoiceCode);
1881          copyObj.setCarrierId(carrierId);
1882          copyObj.setSubject(subject);
1883          copyObj.setNotes(notes);
1884          copyObj.setCreated(created);
1885          copyObj.setModified(modified);
1886          copyObj.setCreatedBy(createdBy);
1887          copyObj.setModifiedBy(modifiedBy);
1888  
1889                            copyObj.setShipmentId( 0);
1890                                                                                                                  
1891                                      
1892                            
1893        List JavaDoc v = getShipmentItems();
1894        for (int i = 0; i < v.size(); i++)
1895        {
1896            ShipmentItem obj = (ShipmentItem) v.get(i);
1897            copyObj.addShipmentItem(obj.copy());
1898        }
1899                            return copyObj;
1900    }
1901
1902    /**
1903     * returns a peer instance associated with this om. Since Peer classes
1904     * are not to have any instance attributes, this method returns the
1905     * same instance for all member of this class. The method could therefore
1906     * be static, but this would prevent one from overriding the behavior.
1907     */

1908    public ShipmentPeer getPeer()
1909    {
1910        return peer;
1911    }
1912
1913    public String JavaDoc toString()
1914    {
1915        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
1916        str.append("Shipment:\n");
1917        str.append("ShipmentId = ")
1918               .append(getShipmentId())
1919             .append("\n");
1920        str.append("ShipmentCode = ")
1921               .append(getShipmentCode())
1922             .append("\n");
1923        str.append("Status = ")
1924               .append(getStatus())
1925             .append("\n");
1926        str.append("Priority = ")
1927               .append(getPriority())
1928             .append("\n");
1929        str.append("IssuedDate = ")
1930               .append(getIssuedDate())
1931             .append("\n");
1932        str.append("ClosedDate = ")
1933               .append(getClosedDate())
1934             .append("\n");
1935        str.append("CustomerId = ")
1936               .append(getCustomerId())
1937             .append("\n");
1938        str.append("RecipientId = ")
1939               .append(getRecipientId())
1940             .append("\n");
1941        str.append("ProjectId = ")
1942               .append(getProjectId())
1943             .append("\n");
1944        str.append("SorderId = ")
1945               .append(getSorderId())
1946             .append("\n");
1947        str.append("InvoiceCode = ")
1948               .append(getInvoiceCode())
1949             .append("\n");
1950        str.append("CarrierId = ")
1951               .append(getCarrierId())
1952             .append("\n");
1953        str.append("Subject = ")
1954               .append(getSubject())
1955             .append("\n");
1956        str.append("Notes = ")
1957               .append(getNotes())
1958             .append("\n");
1959        str.append("Created = ")
1960               .append(getCreated())
1961             .append("\n");
1962        str.append("Modified = ")
1963               .append(getModified())
1964             .append("\n");
1965        str.append("CreatedBy = ")
1966               .append(getCreatedBy())
1967             .append("\n");
1968        str.append("ModifiedBy = ")
1969               .append(getModifiedBy())
1970             .append("\n");
1971        return(str.toString());
1972    }
1973}
1974
Popular Tags