KickJava   Java API By Example, From Geeks To Geeks.

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


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 Sorder
38  */

39 public abstract class BaseSorder extends BaseObject
40     implements org.apache.turbine.om.Retrievable
41 {
42     /** The Peer class */
43     private static final SorderPeer peer =
44         new SorderPeer();
45
46         
47     /** The value for the sorderId field */
48     private int sorderId;
49                                                 
50     /** The value for the sorderCode field */
51     private String JavaDoc sorderCode = "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 carrierId field */
75     private int carrierId = 1000;
76                                           
77     /** The value for the payTerm field */
78     private int payTerm = 10;
79                                           
80     /** The value for the payMethod field */
81     private int payMethod = 10;
82                                           
83     /** The value for the currencyId field */
84     private int currencyId = 1000;
85                                   
86     /** The value for the currencyAmount field */
87     private BigDecimal JavaDoc currencyAmount= new BigDecimal JavaDoc(0);
88                                                 
89     /** The value for the subject field */
90     private String JavaDoc subject = "---";
91       
92     /** The value for the notes field */
93     private String JavaDoc notes;
94       
95     /** The value for the created field */
96     private Date JavaDoc created;
97       
98     /** The value for the modified field */
99     private Date JavaDoc modified;
100       
101     /** The value for the createdBy field */
102     private String JavaDoc createdBy;
103       
104     /** The value for the modifiedBy field */
105     private String JavaDoc modifiedBy;
106   
107     
108     /**
109      * Get the SorderId
110      *
111      * @return int
112      */

113     public int getSorderId()
114     {
115         return sorderId;
116     }
117
118                                               
119     /**
120      * Set the value of SorderId
121      *
122      * @param v new value
123      */

124     public void setSorderId(int v) throws TorqueException
125     {
126     
127                   if (this.sorderId != v)
128               {
129             this.sorderId = v;
130             setModified(true);
131         }
132     
133           
134                                   
135                   // update associated Payment
136
if (collPayments != null)
137         {
138             for (int i = 0; i < collPayments.size(); i++)
139             {
140                 ((Payment) collPayments.get(i))
141                     .setSorderId(v);
142             }
143         }
144                                                     
145                   // update associated Service
146
if (collServices != null)
147         {
148             for (int i = 0; i < collServices.size(); i++)
149             {
150                 ((Service) collServices.get(i))
151                     .setSorderId(v);
152             }
153         }
154                                                     
155                   // update associated Shipment
156
if (collShipments != null)
157         {
158             for (int i = 0; i < collShipments.size(); i++)
159             {
160                 ((Shipment) collShipments.get(i))
161                     .setSorderId(v);
162             }
163         }
164                                                     
165                   // update associated PrintSubscription
166
if (collPrintSubscriptions != null)
167         {
168             for (int i = 0; i < collPrintSubscriptions.size(); i++)
169             {
170                 ((PrintSubscription) collPrintSubscriptions.get(i))
171                     .setSorderId(v);
172             }
173         }
174                                                     
175                   // update associated OnlineSubscription
176
if (collOnlineSubscriptions != null)
177         {
178             for (int i = 0; i < collOnlineSubscriptions.size(); i++)
179             {
180                 ((OnlineSubscription) collOnlineSubscriptions.get(i))
181                     .setSorderId(v);
182             }
183         }
184                                                     
185                   // update associated SorderItem
186
if (collSorderItems != null)
187         {
188             for (int i = 0; i < collSorderItems.size(); i++)
189             {
190                 ((SorderItem) collSorderItems.get(i))
191                     .setSorderId(v);
192             }
193         }
194                                                     
195                   // update associated PaymentItem
196
if (collPaymentItems != null)
197         {
198             for (int i = 0; i < collPaymentItems.size(); i++)
199             {
200                 ((PaymentItem) collPaymentItems.get(i))
201                     .setSorderId(v);
202             }
203         }
204                                                     
205                   // update associated ShipmentItem
206
if (collShipmentItems != null)
207         {
208             for (int i = 0; i < collShipmentItems.size(); i++)
209             {
210                 ((ShipmentItem) collShipmentItems.get(i))
211                     .setSorderId(v);
212             }
213         }
214                                                     
215                   // update associated ServiceItem
216
if (collServiceItems != null)
217         {
218             for (int i = 0; i < collServiceItems.size(); i++)
219             {
220                 ((ServiceItem) collServiceItems.get(i))
221                     .setSorderId(v);
222             }
223         }
224                                 }
225   
226     /**
227      * Get the SorderCode
228      *
229      * @return String
230      */

231     public String JavaDoc getSorderCode()
232     {
233         return sorderCode;
234     }
235
236                         
237     /**
238      * Set the value of SorderCode
239      *
240      * @param v new value
241      */

242     public void setSorderCode(String JavaDoc v)
243     {
244     
245                   if (!ObjectUtils.equals(this.sorderCode, v))
246               {
247             this.sorderCode = v;
248             setModified(true);
249         }
250     
251           
252               }
253   
254     /**
255      * Get the Status
256      *
257      * @return int
258      */

259     public int getStatus()
260     {
261         return status;
262     }
263
264                         
265     /**
266      * Set the value of Status
267      *
268      * @param v new value
269      */

270     public void setStatus(int v)
271     {
272     
273                   if (this.status != v)
274               {
275             this.status = v;
276             setModified(true);
277         }
278     
279           
280               }
281   
282     /**
283      * Get the Priority
284      *
285      * @return int
286      */

287     public int getPriority()
288     {
289         return priority;
290     }
291
292                         
293     /**
294      * Set the value of Priority
295      *
296      * @param v new value
297      */

298     public void setPriority(int v)
299     {
300     
301                   if (this.priority != v)
302               {
303             this.priority = v;
304             setModified(true);
305         }
306     
307           
308               }
309   
310     /**
311      * Get the IssuedDate
312      *
313      * @return Date
314      */

315     public Date JavaDoc getIssuedDate()
316     {
317         return issuedDate;
318     }
319
320                         
321     /**
322      * Set the value of IssuedDate
323      *
324      * @param v new value
325      */

326     public void setIssuedDate(Date JavaDoc v)
327     {
328     
329                   if (!ObjectUtils.equals(this.issuedDate, v))
330               {
331             this.issuedDate = v;
332             setModified(true);
333         }
334     
335           
336               }
337   
338     /**
339      * Get the ClosedDate
340      *
341      * @return Date
342      */

343     public Date JavaDoc getClosedDate()
344     {
345         return closedDate;
346     }
347
348                         
349     /**
350      * Set the value of ClosedDate
351      *
352      * @param v new value
353      */

354     public void setClosedDate(Date JavaDoc v)
355     {
356     
357                   if (!ObjectUtils.equals(this.closedDate, v))
358               {
359             this.closedDate = v;
360             setModified(true);
361         }
362     
363           
364               }
365   
366     /**
367      * Get the CustomerId
368      *
369      * @return int
370      */

371     public int getCustomerId()
372     {
373         return customerId;
374     }
375
376                               
377     /**
378      * Set the value of CustomerId
379      *
380      * @param v new value
381      */

382     public void setCustomerId(int v) throws TorqueException
383     {
384     
385                   if (this.customerId != v)
386               {
387             this.customerId = v;
388             setModified(true);
389         }
390     
391                                                                   
392                 if (aCustomerRelatedByCustomerId != null && !(aCustomerRelatedByCustomerId.getCustomerId() == v))
393                 {
394             aCustomerRelatedByCustomerId = null;
395         }
396       
397               }
398   
399     /**
400      * Get the RecipientId
401      *
402      * @return int
403      */

404     public int getRecipientId()
405     {
406         return recipientId;
407     }
408
409                               
410     /**
411      * Set the value of RecipientId
412      *
413      * @param v new value
414      */

415     public void setRecipientId(int v) throws TorqueException
416     {
417     
418                   if (this.recipientId != v)
419               {
420             this.recipientId = v;
421             setModified(true);
422         }
423     
424                                                                   
425                 if (aCustomerRelatedByRecipientId != null && !(aCustomerRelatedByRecipientId.getCustomerId() == v))
426                 {
427             aCustomerRelatedByRecipientId = null;
428         }
429       
430               }
431   
432     /**
433      * Get the ProjectId
434      *
435      * @return int
436      */

437     public int getProjectId()
438     {
439         return projectId;
440     }
441
442                               
443     /**
444      * Set the value of ProjectId
445      *
446      * @param v new value
447      */

448     public void setProjectId(int v) throws TorqueException
449     {
450     
451                   if (this.projectId != v)
452               {
453             this.projectId = v;
454             setModified(true);
455         }
456     
457                           
458                 if (aProject != null && !(aProject.getProjectId() == v))
459                 {
460             aProject = null;
461         }
462       
463               }
464   
465     /**
466      * Get the CarrierId
467      *
468      * @return int
469      */

470     public int getCarrierId()
471     {
472         return carrierId;
473     }
474
475                               
476     /**
477      * Set the value of CarrierId
478      *
479      * @param v new value
480      */

481     public void setCarrierId(int v) throws TorqueException
482     {
483     
484                   if (this.carrierId != v)
485               {
486             this.carrierId = v;
487             setModified(true);
488         }
489     
490                           
491                 if (aCarrier != null && !(aCarrier.getCarrierId() == v))
492                 {
493             aCarrier = null;
494         }
495       
496               }
497   
498     /**
499      * Get the PayTerm
500      *
501      * @return int
502      */

503     public int getPayTerm()
504     {
505         return payTerm;
506     }
507
508                         
509     /**
510      * Set the value of PayTerm
511      *
512      * @param v new value
513      */

514     public void setPayTerm(int v)
515     {
516     
517                   if (this.payTerm != v)
518               {
519             this.payTerm = v;
520             setModified(true);
521         }
522     
523           
524               }
525   
526     /**
527      * Get the PayMethod
528      *
529      * @return int
530      */

531     public int getPayMethod()
532     {
533         return payMethod;
534     }
535
536                         
537     /**
538      * Set the value of PayMethod
539      *
540      * @param v new value
541      */

542     public void setPayMethod(int v)
543     {
544     
545                   if (this.payMethod != v)
546               {
547             this.payMethod = v;
548             setModified(true);
549         }
550     
551           
552               }
553   
554     /**
555      * Get the CurrencyId
556      *
557      * @return int
558      */

559     public int getCurrencyId()
560     {
561         return currencyId;
562     }
563
564                               
565     /**
566      * Set the value of CurrencyId
567      *
568      * @param v new value
569      */

570     public void setCurrencyId(int v) throws TorqueException
571     {
572     
573                   if (this.currencyId != v)
574               {
575             this.currencyId = v;
576             setModified(true);
577         }
578     
579                           
580                 if (aCurrency != null && !(aCurrency.getCurrencyId() == v))
581                 {
582             aCurrency = null;
583         }
584       
585               }
586   
587     /**
588      * Get the CurrencyAmount
589      *
590      * @return BigDecimal
591      */

592     public BigDecimal JavaDoc getCurrencyAmount()
593     {
594         return currencyAmount;
595     }
596
597                         
598     /**
599      * Set the value of CurrencyAmount
600      *
601      * @param v new value
602      */

603     public void setCurrencyAmount(BigDecimal JavaDoc v)
604     {
605     
606                   if (!ObjectUtils.equals(this.currencyAmount, v))
607               {
608             this.currencyAmount = v;
609             setModified(true);
610         }
611     
612           
613               }
614   
615     /**
616      * Get the Subject
617      *
618      * @return String
619      */

620     public String JavaDoc getSubject()
621     {
622         return subject;
623     }
624
625                         
626     /**
627      * Set the value of Subject
628      *
629      * @param v new value
630      */

631     public void setSubject(String JavaDoc v)
632     {
633     
634                   if (!ObjectUtils.equals(this.subject, v))
635               {
636             this.subject = v;
637             setModified(true);
638         }
639     
640           
641               }
642   
643     /**
644      * Get the Notes
645      *
646      * @return String
647      */

648     public String JavaDoc getNotes()
649     {
650         return notes;
651     }
652
653                         
654     /**
655      * Set the value of Notes
656      *
657      * @param v new value
658      */

659     public void setNotes(String JavaDoc v)
660     {
661     
662                   if (!ObjectUtils.equals(this.notes, v))
663               {
664             this.notes = v;
665             setModified(true);
666         }
667     
668           
669               }
670   
671     /**
672      * Get the Created
673      *
674      * @return Date
675      */

676     public Date JavaDoc getCreated()
677     {
678         return created;
679     }
680
681                         
682     /**
683      * Set the value of Created
684      *
685      * @param v new value
686      */

687     public void setCreated(Date JavaDoc v)
688     {
689     
690                   if (!ObjectUtils.equals(this.created, v))
691               {
692             this.created = v;
693             setModified(true);
694         }
695     
696           
697               }
698   
699     /**
700      * Get the Modified
701      *
702      * @return Date
703      */

704     public Date JavaDoc getModified()
705     {
706         return modified;
707     }
708
709                         
710     /**
711      * Set the value of Modified
712      *
713      * @param v new value
714      */

715     public void setModified(Date JavaDoc v)
716     {
717     
718                   if (!ObjectUtils.equals(this.modified, v))
719               {
720             this.modified = v;
721             setModified(true);
722         }
723     
724           
725               }
726   
727     /**
728      * Get the CreatedBy
729      *
730      * @return String
731      */

732     public String JavaDoc getCreatedBy()
733     {
734         return createdBy;
735     }
736
737                         
738     /**
739      * Set the value of CreatedBy
740      *
741      * @param v new value
742      */

743     public void setCreatedBy(String JavaDoc v)
744     {
745     
746                   if (!ObjectUtils.equals(this.createdBy, v))
747               {
748             this.createdBy = v;
749             setModified(true);
750         }
751     
752           
753               }
754   
755     /**
756      * Get the ModifiedBy
757      *
758      * @return String
759      */

760     public String JavaDoc getModifiedBy()
761     {
762         return modifiedBy;
763     }
764
765                         
766     /**
767      * Set the value of ModifiedBy
768      *
769      * @param v new value
770      */

771     public void setModifiedBy(String JavaDoc v)
772     {
773     
774                   if (!ObjectUtils.equals(this.modifiedBy, v))
775               {
776             this.modifiedBy = v;
777             setModified(true);
778         }
779     
780           
781               }
782   
783       
784     
785                         
786         
787         private Customer aCustomerRelatedByCustomerId;
788
789     /**
790      * Declares an association between this object and a Customer object
791      *
792      * @param v Customer
793      * @throws TorqueException
794      */

795     public void setCustomerRelatedByCustomerId(Customer v) throws TorqueException
796     {
797             if (v == null)
798         {
799                           setCustomerId( 1000);
800               }
801         else
802         {
803             setCustomerId(v.getCustomerId());
804         }
805             aCustomerRelatedByCustomerId = v;
806     }
807
808                                             
809     /**
810      * Get the associated Customer object
811      *
812      * @return the associated Customer object
813      * @throws TorqueException
814      */

815     public Customer getCustomerRelatedByCustomerId() throws TorqueException
816     {
817         if (aCustomerRelatedByCustomerId == null && (this.customerId != 0))
818         {
819                           aCustomerRelatedByCustomerId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.customerId));
820               
821             /* The following can be used instead of the line above to
822                guarantee the related object contains a reference
823                to this object, but this level of coupling
824                may be undesirable in many circumstances.
825                As it can lead to a db query with many results that may
826                never be used.
827                Customer obj = CustomerPeer.retrieveByPK(this.customerId);
828                obj.addSordersRelatedByCustomerId(this);
829             */

830         }
831         return aCustomerRelatedByCustomerId;
832     }
833
834     /**
835      * Provides convenient way to set a relationship based on a
836      * ObjectKey, for example
837      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
838      *
839          */

840     public void setCustomerRelatedByCustomerIdKey(ObjectKey key) throws TorqueException
841     {
842       
843                         setCustomerId(((NumberKey) key).intValue());
844                   }
845     
846     
847                         
848         
849         private Customer aCustomerRelatedByRecipientId;
850
851     /**
852      * Declares an association between this object and a Customer object
853      *
854      * @param v Customer
855      * @throws TorqueException
856      */

857     public void setCustomerRelatedByRecipientId(Customer v) throws TorqueException
858     {
859             if (v == null)
860         {
861                           setRecipientId( 1000);
862               }
863         else
864         {
865             setRecipientId(v.getCustomerId());
866         }
867             aCustomerRelatedByRecipientId = v;
868     }
869
870                                             
871     /**
872      * Get the associated Customer object
873      *
874      * @return the associated Customer object
875      * @throws TorqueException
876      */

877     public Customer getCustomerRelatedByRecipientId() throws TorqueException
878     {
879         if (aCustomerRelatedByRecipientId == null && (this.recipientId != 0))
880         {
881                           aCustomerRelatedByRecipientId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.recipientId));
882               
883             /* The following can be used instead of the line above to
884                guarantee the related object contains a reference
885                to this object, but this level of coupling
886                may be undesirable in many circumstances.
887                As it can lead to a db query with many results that may
888                never be used.
889                Customer obj = CustomerPeer.retrieveByPK(this.recipientId);
890                obj.addSordersRelatedByRecipientId(this);
891             */

892         }
893         return aCustomerRelatedByRecipientId;
894     }
895
896     /**
897      * Provides convenient way to set a relationship based on a
898      * ObjectKey, for example
899      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
900      *
901          */

902     public void setCustomerRelatedByRecipientIdKey(ObjectKey key) throws TorqueException
903     {
904       
905                         setRecipientId(((NumberKey) key).intValue());
906                   }
907     
908     
909                   
910     
911         private Project aProject;
912
913     /**
914      * Declares an association between this object and a Project object
915      *
916      * @param v Project
917      * @throws TorqueException
918      */

919     public void setProject(Project v) throws TorqueException
920     {
921             if (v == null)
922         {
923                           setProjectId( 1000);
924               }
925         else
926         {
927             setProjectId(v.getProjectId());
928         }
929             aProject = v;
930     }
931
932                                             
933     /**
934      * Get the associated Project object
935      *
936      * @return the associated Project object
937      * @throws TorqueException
938      */

939     public Project getProject() throws TorqueException
940     {
941         if (aProject == null && (this.projectId != 0))
942         {
943                           aProject = ProjectPeer.retrieveByPK(SimpleKey.keyFor(this.projectId));
944               
945             /* The following can be used instead of the line above to
946                guarantee the related object contains a reference
947                to this object, but this level of coupling
948                may be undesirable in many circumstances.
949                As it can lead to a db query with many results that may
950                never be used.
951                Project obj = ProjectPeer.retrieveByPK(this.projectId);
952                obj.addSorders(this);
953             */

954         }
955         return aProject;
956     }
957
958     /**
959      * Provides convenient way to set a relationship based on a
960      * ObjectKey, for example
961      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
962      *
963          */

964     public void setProjectKey(ObjectKey key) throws TorqueException
965     {
966       
967                         setProjectId(((NumberKey) key).intValue());
968                   }
969     
970     
971                   
972     
973         private Carrier aCarrier;
974
975     /**
976      * Declares an association between this object and a Carrier object
977      *
978      * @param v Carrier
979      * @throws TorqueException
980      */

981     public void setCarrier(Carrier v) throws TorqueException
982     {
983             if (v == null)
984         {
985                           setCarrierId( 1000);
986               }
987         else
988         {
989             setCarrierId(v.getCarrierId());
990         }
991             aCarrier = v;
992     }
993
994                                             
995     /**
996      * Get the associated Carrier object
997      *
998      * @return the associated Carrier object
999      * @throws TorqueException
1000     */

1001    public Carrier getCarrier() throws TorqueException
1002    {
1003        if (aCarrier == null && (this.carrierId != 0))
1004        {
1005                          aCarrier = CarrierPeer.retrieveByPK(SimpleKey.keyFor(this.carrierId));
1006              
1007            /* The following can be used instead of the line above to
1008               guarantee the related object contains a reference
1009               to this object, but this level of coupling
1010               may be undesirable in many circumstances.
1011               As it can lead to a db query with many results that may
1012               never be used.
1013               Carrier obj = CarrierPeer.retrieveByPK(this.carrierId);
1014               obj.addSorders(this);
1015            */

1016        }
1017        return aCarrier;
1018    }
1019
1020    /**
1021     * Provides convenient way to set a relationship based on a
1022     * ObjectKey, for example
1023     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
1024     *
1025         */

1026    public void setCarrierKey(ObjectKey key) throws TorqueException
1027    {
1028      
1029                        setCarrierId(((NumberKey) key).intValue());
1030                  }
1031    
1032    
1033                  
1034    
1035        private Currency aCurrency;
1036
1037    /**
1038     * Declares an association between this object and a Currency object
1039     *
1040     * @param v Currency
1041     * @throws TorqueException
1042     */

1043    public void setCurrency(Currency v) throws TorqueException
1044    {
1045            if (v == null)
1046        {
1047                          setCurrencyId( 1000);
1048              }
1049        else
1050        {
1051            setCurrencyId(v.getCurrencyId());
1052        }
1053            aCurrency = v;
1054    }
1055
1056                                            
1057    /**
1058     * Get the associated Currency object
1059     *
1060     * @return the associated Currency object
1061     * @throws TorqueException
1062     */

1063    public Currency getCurrency() throws TorqueException
1064    {
1065        if (aCurrency == null && (this.currencyId != 0))
1066        {
1067                          aCurrency = CurrencyPeer.retrieveByPK(SimpleKey.keyFor(this.currencyId));
1068              
1069            /* The following can be used instead of the line above to
1070               guarantee the related object contains a reference
1071               to this object, but this level of coupling
1072               may be undesirable in many circumstances.
1073               As it can lead to a db query with many results that may
1074               never be used.
1075               Currency obj = CurrencyPeer.retrieveByPK(this.currencyId);
1076               obj.addSorders(this);
1077            */

1078        }
1079        return aCurrency;
1080    }
1081
1082    /**
1083     * Provides convenient way to set a relationship based on a
1084     * ObjectKey, for example
1085     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
1086     *
1087         */

1088    public void setCurrencyKey(ObjectKey key) throws TorqueException
1089    {
1090      
1091                        setCurrencyId(((NumberKey) key).intValue());
1092                  }
1093       
1094                                
1095            
1096          /**
1097     * Collection to store aggregation of collPayments
1098     */

1099    protected List JavaDoc collPayments;
1100
1101    /**
1102     * Temporary storage of collPayments to save a possible db hit in
1103     * the event objects are add to the collection, but the
1104     * complete collection is never requested.
1105     */

1106    protected void initPayments()
1107    {
1108        if (collPayments == null)
1109        {
1110            collPayments = new ArrayList JavaDoc();
1111        }
1112    }
1113
1114    /**
1115     * Method called to associate a Payment object to this object
1116     * through the Payment foreign key attribute
1117     *
1118     * @param l Payment
1119     * @throws TorqueException
1120     */

1121    public void addPayment(Payment l) throws TorqueException
1122    {
1123        getPayments().add(l);
1124        l.setSorder((Sorder) this);
1125    }
1126
1127    /**
1128     * The criteria used to select the current contents of collPayments
1129     */

1130    private Criteria lastPaymentsCriteria = null;
1131      
1132    /**
1133     * If this collection has already been initialized, returns
1134     * the collection. Otherwise returns the results of
1135     * getPayments(new Criteria())
1136     *
1137     * @throws TorqueException
1138     */

1139    public List JavaDoc getPayments() throws TorqueException
1140    {
1141              if (collPayments == null)
1142        {
1143            collPayments = getPayments(new Criteria(10));
1144        }
1145        return collPayments;
1146          }
1147
1148    /**
1149     * If this collection has already been initialized with
1150     * an identical criteria, it returns the collection.
1151     * Otherwise if this Sorder has previously
1152     * been saved, it will retrieve related Payments from storage.
1153     * If this Sorder is new, it will return
1154     * an empty collection or the current collection, the criteria
1155     * is ignored on a new object.
1156     *
1157     * @throws TorqueException
1158     */

1159    public List JavaDoc getPayments(Criteria criteria) throws TorqueException
1160    {
1161              if (collPayments == null)
1162        {
1163            if (isNew())
1164            {
1165               collPayments = new ArrayList JavaDoc();
1166            }
1167            else
1168            {
1169                        criteria.add(PaymentPeer.SORDER_ID, getSorderId() );
1170                        collPayments = PaymentPeer.doSelect(criteria);
1171            }
1172        }
1173        else
1174        {
1175            // criteria has no effect for a new object
1176
if (!isNew())
1177            {
1178                // the following code is to determine if a new query is
1179
// called for. If the criteria is the same as the last
1180
// one, just return the collection.
1181
criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1182                            if (!lastPaymentsCriteria.equals(criteria))
1183                {
1184                    collPayments = PaymentPeer.doSelect(criteria);
1185                }
1186            }
1187        }
1188        lastPaymentsCriteria = criteria;
1189
1190        return collPayments;
1191          }
1192
1193    /**
1194     * If this collection has already been initialized, returns
1195     * the collection. Otherwise returns the results of
1196     * getPayments(new Criteria(),Connection)
1197     * This method takes in the Connection also as input so that
1198     * referenced objects can also be obtained using a Connection
1199     * that is taken as input
1200     */

1201    public List JavaDoc getPayments(Connection JavaDoc con) throws TorqueException
1202    {
1203              if (collPayments == null)
1204        {
1205            collPayments = getPayments(new Criteria(10), con);
1206        }
1207        return collPayments;
1208          }
1209
1210    /**
1211     * If this collection has already been initialized with
1212     * an identical criteria, it returns the collection.
1213     * Otherwise if this Sorder has previously
1214     * been saved, it will retrieve related Payments from storage.
1215     * If this Sorder is new, it will return
1216     * an empty collection or the current collection, the criteria
1217     * is ignored on a new object.
1218     * This method takes in the Connection also as input so that
1219     * referenced objects can also be obtained using a Connection
1220     * that is taken as input
1221     */

1222    public List JavaDoc getPayments(Criteria criteria, Connection JavaDoc con)
1223            throws TorqueException
1224    {
1225              if (collPayments == null)
1226        {
1227            if (isNew())
1228            {
1229               collPayments = new ArrayList JavaDoc();
1230            }
1231            else
1232            {
1233                         criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1234                         collPayments = PaymentPeer.doSelect(criteria, con);
1235             }
1236         }
1237         else
1238         {
1239             // criteria has no effect for a new object
1240
if (!isNew())
1241             {
1242                 // the following code is to determine if a new query is
1243
// called for. If the criteria is the same as the last
1244
// one, just return the collection.
1245
criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1246                             if (!lastPaymentsCriteria.equals(criteria))
1247                 {
1248                     collPayments = PaymentPeer.doSelect(criteria, con);
1249                 }
1250             }
1251         }
1252         lastPaymentsCriteria = criteria;
1253
1254         return collPayments;
1255           }
1256
1257                                    
1258              
1259                    
1260                    
1261                                
1262                                                              
1263                                        
1264                    
1265                    
1266          
1267    /**
1268     * If this collection has already been initialized with
1269     * an identical criteria, it returns the collection.
1270     * Otherwise if this Sorder is new, it will return
1271     * an empty collection; or if this Sorder has previously
1272     * been saved, it will retrieve related Payments from storage.
1273     *
1274     * This method is protected by default in order to keep the public
1275     * api reasonable. You can provide public methods for those you
1276     * actually need in Sorder.
1277     */

1278    protected List JavaDoc getPaymentsJoinCustomer(Criteria criteria)
1279        throws TorqueException
1280    {
1281                    if (collPayments == null)
1282        {
1283            if (isNew())
1284            {
1285               collPayments = new ArrayList JavaDoc();
1286            }
1287            else
1288            {
1289                              criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1290                              collPayments = PaymentPeer.doSelectJoinCustomer(criteria);
1291            }
1292        }
1293        else
1294        {
1295            // the following code is to determine if a new query is
1296
// called for. If the criteria is the same as the last
1297
// one, just return the collection.
1298

1299                        criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1300                                    if (!lastPaymentsCriteria.equals(criteria))
1301            {
1302                collPayments = PaymentPeer.doSelectJoinCustomer(criteria);
1303            }
1304        }
1305        lastPaymentsCriteria = criteria;
1306
1307        return collPayments;
1308                }
1309                  
1310                    
1311                    
1312                                
1313                                                              
1314                                        
1315                    
1316                    
1317          
1318    /**
1319     * If this collection has already been initialized with
1320     * an identical criteria, it returns the collection.
1321     * Otherwise if this Sorder is new, it will return
1322     * an empty collection; or if this Sorder has previously
1323     * been saved, it will retrieve related Payments from storage.
1324     *
1325     * This method is protected by default in order to keep the public
1326     * api reasonable. You can provide public methods for those you
1327     * actually need in Sorder.
1328     */

1329    protected List JavaDoc getPaymentsJoinProject(Criteria criteria)
1330        throws TorqueException
1331    {
1332                    if (collPayments == null)
1333        {
1334            if (isNew())
1335            {
1336               collPayments = new ArrayList JavaDoc();
1337            }
1338            else
1339            {
1340                              criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1341                              collPayments = PaymentPeer.doSelectJoinProject(criteria);
1342            }
1343        }
1344        else
1345        {
1346            // the following code is to determine if a new query is
1347
// called for. If the criteria is the same as the last
1348
// one, just return the collection.
1349

1350                        criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1351                                    if (!lastPaymentsCriteria.equals(criteria))
1352            {
1353                collPayments = PaymentPeer.doSelectJoinProject(criteria);
1354            }
1355        }
1356        lastPaymentsCriteria = criteria;
1357
1358        return collPayments;
1359                }
1360                  
1361                    
1362                              
1363                                
1364                                                              
1365                                        
1366                    
1367                    
1368          
1369    /**
1370     * If this collection has already been initialized with
1371     * an identical criteria, it returns the collection.
1372     * Otherwise if this Sorder is new, it will return
1373     * an empty collection; or if this Sorder has previously
1374     * been saved, it will retrieve related Payments from storage.
1375     *
1376     * This method is protected by default in order to keep the public
1377     * api reasonable. You can provide public methods for those you
1378     * actually need in Sorder.
1379     */

1380    protected List JavaDoc getPaymentsJoinSorder(Criteria criteria)
1381        throws TorqueException
1382    {
1383                    if (collPayments == null)
1384        {
1385            if (isNew())
1386            {
1387               collPayments = new ArrayList JavaDoc();
1388            }
1389            else
1390            {
1391                              criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1392                              collPayments = PaymentPeer.doSelectJoinSorder(criteria);
1393            }
1394        }
1395        else
1396        {
1397            // the following code is to determine if a new query is
1398
// called for. If the criteria is the same as the last
1399
// one, just return the collection.
1400

1401                        criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1402                                    if (!lastPaymentsCriteria.equals(criteria))
1403            {
1404                collPayments = PaymentPeer.doSelectJoinSorder(criteria);
1405            }
1406        }
1407        lastPaymentsCriteria = criteria;
1408
1409        return collPayments;
1410                }
1411                  
1412                    
1413                    
1414                                
1415                                                              
1416                                        
1417                    
1418                    
1419          
1420    /**
1421     * If this collection has already been initialized with
1422     * an identical criteria, it returns the collection.
1423     * Otherwise if this Sorder is new, it will return
1424     * an empty collection; or if this Sorder has previously
1425     * been saved, it will retrieve related Payments from storage.
1426     *
1427     * This method is protected by default in order to keep the public
1428     * api reasonable. You can provide public methods for those you
1429     * actually need in Sorder.
1430     */

1431    protected List JavaDoc getPaymentsJoinCurrency(Criteria criteria)
1432        throws TorqueException
1433    {
1434                    if (collPayments == null)
1435        {
1436            if (isNew())
1437            {
1438               collPayments = new ArrayList JavaDoc();
1439            }
1440            else
1441            {
1442                              criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1443                              collPayments = PaymentPeer.doSelectJoinCurrency(criteria);
1444            }
1445        }
1446        else
1447        {
1448            // the following code is to determine if a new query is
1449
// called for. If the criteria is the same as the last
1450
// one, just return the collection.
1451

1452                        criteria.add(PaymentPeer.SORDER_ID, getSorderId());
1453                                    if (!lastPaymentsCriteria.equals(criteria))
1454            {
1455                collPayments = PaymentPeer.doSelectJoinCurrency(criteria);
1456            }
1457        }
1458        lastPaymentsCriteria = criteria;
1459
1460        return collPayments;
1461                }
1462                            
1463
1464
1465                          
1466            
1467          /**
1468     * Collection to store aggregation of collServices
1469     */

1470    protected List JavaDoc collServices;
1471
1472    /**
1473     * Temporary storage of collServices to save a possible db hit in
1474     * the event objects are add to the collection, but the
1475     * complete collection is never requested.
1476     */

1477    protected void initServices()
1478    {
1479        if (collServices == null)
1480        {
1481            collServices = new ArrayList JavaDoc();
1482        }
1483    }
1484
1485    /**
1486     * Method called to associate a Service object to this object
1487     * through the Service foreign key attribute
1488     *
1489     * @param l Service
1490     * @throws TorqueException
1491     */

1492    public void addService(Service l) throws TorqueException
1493    {
1494        getServices().add(l);
1495        l.setSorder((Sorder) this);
1496    }
1497
1498    /**
1499     * The criteria used to select the current contents of collServices
1500     */

1501    private Criteria lastServicesCriteria = null;
1502      
1503    /**
1504     * If this collection has already been initialized, returns
1505     * the collection. Otherwise returns the results of
1506     * getServices(new Criteria())
1507     *
1508     * @throws TorqueException
1509     */

1510    public List JavaDoc getServices() throws TorqueException
1511    {
1512              if (collServices == null)
1513        {
1514            collServices = getServices(new Criteria(10));
1515        }
1516        return collServices;
1517          }
1518
1519    /**
1520     * If this collection has already been initialized with
1521     * an identical criteria, it returns the collection.
1522     * Otherwise if this Sorder has previously
1523     * been saved, it will retrieve related Services from storage.
1524     * If this Sorder is new, it will return
1525     * an empty collection or the current collection, the criteria
1526     * is ignored on a new object.
1527     *
1528     * @throws TorqueException
1529     */

1530    public List JavaDoc getServices(Criteria criteria) throws TorqueException
1531    {
1532              if (collServices == null)
1533        {
1534            if (isNew())
1535            {
1536               collServices = new ArrayList JavaDoc();
1537            }
1538            else
1539            {
1540                        criteria.add(ServicePeer.SORDER_ID, getSorderId() );
1541                        collServices = ServicePeer.doSelect(criteria);
1542            }
1543        }
1544        else
1545        {
1546            // criteria has no effect for a new object
1547
if (!isNew())
1548            {
1549                // the following code is to determine if a new query is
1550
// called for. If the criteria is the same as the last
1551
// one, just return the collection.
1552
criteria.add(ServicePeer.SORDER_ID, getSorderId());
1553                            if (!lastServicesCriteria.equals(criteria))
1554                {
1555                    collServices = ServicePeer.doSelect(criteria);
1556                }
1557            }
1558        }
1559        lastServicesCriteria = criteria;
1560
1561        return collServices;
1562          }
1563
1564    /**
1565     * If this collection has already been initialized, returns
1566     * the collection. Otherwise returns the results of
1567     * getServices(new Criteria(),Connection)
1568     * This method takes in the Connection also as input so that
1569     * referenced objects can also be obtained using a Connection
1570     * that is taken as input
1571     */

1572    public List JavaDoc getServices(Connection JavaDoc con) throws TorqueException
1573    {
1574              if (collServices == null)
1575        {
1576            collServices = getServices(new Criteria(10), con);
1577        }
1578        return collServices;
1579          }
1580
1581    /**
1582     * If this collection has already been initialized with
1583     * an identical criteria, it returns the collection.
1584     * Otherwise if this Sorder has previously
1585     * been saved, it will retrieve related Services from storage.
1586     * If this Sorder is new, it will return
1587     * an empty collection or the current collection, the criteria
1588     * is ignored on a new object.
1589     * This method takes in the Connection also as input so that
1590     * referenced objects can also be obtained using a Connection
1591     * that is taken as input
1592     */

1593    public List JavaDoc getServices(Criteria criteria, Connection JavaDoc con)
1594            throws TorqueException
1595    {
1596              if (collServices == null)
1597        {
1598            if (isNew())
1599            {
1600               collServices = new ArrayList JavaDoc();
1601            }
1602            else
1603            {
1604                         criteria.add(ServicePeer.SORDER_ID, getSorderId());
1605                         collServices = ServicePeer.doSelect(criteria, con);
1606             }
1607         }
1608         else
1609         {
1610             // criteria has no effect for a new object
1611
if (!isNew())
1612             {
1613                 // the following code is to determine if a new query is
1614
// called for. If the criteria is the same as the last
1615
// one, just return the collection.
1616
criteria.add(ServicePeer.SORDER_ID, getSorderId());
1617                             if (!lastServicesCriteria.equals(criteria))
1618                 {
1619                     collServices = ServicePeer.doSelect(criteria, con);
1620                 }
1621             }
1622         }
1623         lastServicesCriteria = criteria;
1624
1625         return collServices;
1626           }
1627
1628                                    
1629              
1630                    
1631                    
1632                                            
1633                                                                          
1634                                        
1635                    
1636                    
1637          
1638    /**
1639     * If this collection has already been initialized with
1640     * an identical criteria, it returns the collection.
1641     * Otherwise if this Sorder is new, it will return
1642     * an empty collection; or if this Sorder has previously
1643     * been saved, it will retrieve related Services from storage.
1644     *
1645     * This method is protected by default in order to keep the public
1646     * api reasonable. You can provide public methods for those you
1647     * actually need in Sorder.
1648     */

1649    protected List JavaDoc getServicesJoinCustomerRelatedByCustomerId(Criteria criteria)
1650        throws TorqueException
1651    {
1652                    if (collServices == null)
1653        {
1654            if (isNew())
1655            {
1656               collServices = new ArrayList JavaDoc();
1657            }
1658            else
1659            {
1660                              criteria.add(ServicePeer.SORDER_ID, getSorderId());
1661                              collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1662            }
1663        }
1664        else
1665        {
1666            // the following code is to determine if a new query is
1667
// called for. If the criteria is the same as the last
1668
// one, just return the collection.
1669

1670                        criteria.add(ServicePeer.SORDER_ID, getSorderId());
1671                                    if (!lastServicesCriteria.equals(criteria))
1672            {
1673                collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1674            }
1675        }
1676        lastServicesCriteria = criteria;
1677
1678        return collServices;
1679                }
1680                  
1681                    
1682                    
1683                                            
1684                                                                          
1685                                        
1686                    
1687                    
1688          
1689    /**
1690     * If this collection has already been initialized with
1691     * an identical criteria, it returns the collection.
1692     * Otherwise if this Sorder is new, it will return
1693     * an empty collection; or if this Sorder has previously
1694     * been saved, it will retrieve related Services from storage.
1695     *
1696     * This method is protected by default in order to keep the public
1697     * api reasonable. You can provide public methods for those you
1698     * actually need in Sorder.
1699     */

1700    protected List JavaDoc getServicesJoinCustomerRelatedByRecipientId(Criteria criteria)
1701        throws TorqueException
1702    {
1703                    if (collServices == null)
1704        {
1705            if (isNew())
1706            {
1707               collServices = new ArrayList JavaDoc();
1708            }
1709            else
1710            {
1711                              criteria.add(ServicePeer.SORDER_ID, getSorderId());
1712                              collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1713            }
1714        }
1715        else
1716        {
1717            // the following code is to determine if a new query is
1718
// called for. If the criteria is the same as the last
1719
// one, just return the collection.
1720

1721                        criteria.add(ServicePeer.SORDER_ID, getSorderId());
1722                                    if (!lastServicesCriteria.equals(criteria))
1723            {
1724                collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1725            }
1726        }
1727        lastServicesCriteria = criteria;
1728
1729        return collServices;
1730                }
1731                  
1732                    
1733                    
1734                                
1735                                                              
1736                                        
1737                    
1738                    
1739          
1740    /**
1741     * If this collection has already been initialized with
1742     * an identical criteria, it returns the collection.
1743     * Otherwise if this Sorder is new, it will return
1744     * an empty collection; or if this Sorder has previously
1745     * been saved, it will retrieve related Services from storage.
1746     *
1747     * This method is protected by default in order to keep the public
1748     * api reasonable. You can provide public methods for those you
1749     * actually need in Sorder.
1750     */

1751    protected List JavaDoc getServicesJoinProject(Criteria criteria)
1752        throws TorqueException
1753    {
1754                    if (collServices == null)
1755        {
1756            if (isNew())
1757            {
1758               collServices = new ArrayList JavaDoc();
1759            }
1760            else
1761            {
1762                              criteria.add(ServicePeer.SORDER_ID, getSorderId());
1763                              collServices = ServicePeer.doSelectJoinProject(criteria);
1764            }
1765        }
1766        else
1767        {
1768            // the following code is to determine if a new query is
1769
// called for. If the criteria is the same as the last
1770
// one, just return the collection.
1771

1772                        criteria.add(ServicePeer.SORDER_ID, getSorderId());
1773                                    if (!lastServicesCriteria.equals(criteria))
1774            {
1775                collServices = ServicePeer.doSelectJoinProject(criteria);
1776            }
1777        }
1778        lastServicesCriteria = criteria;
1779
1780        return collServices;
1781                }
1782                  
1783                    
1784                              
1785                                
1786                                                              
1787                                        
1788                    
1789                    
1790          
1791    /**
1792     * If this collection has already been initialized with
1793     * an identical criteria, it returns the collection.
1794     * Otherwise if this Sorder is new, it will return
1795     * an empty collection; or if this Sorder has previously
1796     * been saved, it will retrieve related Services from storage.
1797     *
1798     * This method is protected by default in order to keep the public
1799     * api reasonable. You can provide public methods for those you
1800     * actually need in Sorder.
1801     */

1802    protected List JavaDoc getServicesJoinSorder(Criteria criteria)
1803        throws TorqueException
1804    {
1805                    if (collServices == null)
1806        {
1807            if (isNew())
1808            {
1809               collServices = new ArrayList JavaDoc();
1810            }
1811            else
1812            {
1813                              criteria.add(ServicePeer.SORDER_ID, getSorderId());
1814                              collServices = ServicePeer.doSelectJoinSorder(criteria);
1815            }
1816        }
1817        else
1818        {
1819            // the following code is to determine if a new query is
1820
// called for. If the criteria is the same as the last
1821
// one, just return the collection.
1822

1823                        criteria.add(ServicePeer.SORDER_ID, getSorderId());
1824                                    if (!lastServicesCriteria.equals(criteria))
1825            {
1826                collServices = ServicePeer.doSelectJoinSorder(criteria);
1827            }
1828        }
1829        lastServicesCriteria = criteria;
1830
1831        return collServices;
1832                }
1833                            
1834
1835
1836                          
1837            
1838          /**
1839     * Collection to store aggregation of collShipments
1840     */

1841    protected List JavaDoc collShipments;
1842
1843    /**
1844     * Temporary storage of collShipments to save a possible db hit in
1845     * the event objects are add to the collection, but the
1846     * complete collection is never requested.
1847     */

1848    protected void initShipments()
1849    {
1850        if (collShipments == null)
1851        {
1852            collShipments = new ArrayList JavaDoc();
1853        }
1854    }
1855
1856    /**
1857     * Method called to associate a Shipment object to this object
1858     * through the Shipment foreign key attribute
1859     *
1860     * @param l Shipment
1861     * @throws TorqueException
1862     */

1863    public void addShipment(Shipment l) throws TorqueException
1864    {
1865        getShipments().add(l);
1866        l.setSorder((Sorder) this);
1867    }
1868
1869    /**
1870     * The criteria used to select the current contents of collShipments
1871     */

1872    private Criteria lastShipmentsCriteria = null;
1873      
1874    /**
1875     * If this collection has already been initialized, returns
1876     * the collection. Otherwise returns the results of
1877     * getShipments(new Criteria())
1878     *
1879     * @throws TorqueException
1880     */

1881    public List JavaDoc getShipments() throws TorqueException
1882    {
1883              if (collShipments == null)
1884        {
1885            collShipments = getShipments(new Criteria(10));
1886        }
1887        return collShipments;
1888          }
1889
1890    /**
1891     * If this collection has already been initialized with
1892     * an identical criteria, it returns the collection.
1893     * Otherwise if this Sorder has previously
1894     * been saved, it will retrieve related Shipments from storage.
1895     * If this Sorder is new, it will return
1896     * an empty collection or the current collection, the criteria
1897     * is ignored on a new object.
1898     *
1899     * @throws TorqueException
1900     */

1901    public List JavaDoc getShipments(Criteria criteria) throws TorqueException
1902    {
1903              if (collShipments == null)
1904        {
1905            if (isNew())
1906            {
1907               collShipments = new ArrayList JavaDoc();
1908            }
1909            else
1910            {
1911                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId() );
1912                        collShipments = ShipmentPeer.doSelect(criteria);
1913            }
1914        }
1915        else
1916        {
1917            // criteria has no effect for a new object
1918
if (!isNew())
1919            {
1920                // the following code is to determine if a new query is
1921
// called for. If the criteria is the same as the last
1922
// one, just return the collection.
1923
criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
1924                            if (!lastShipmentsCriteria.equals(criteria))
1925                {
1926                    collShipments = ShipmentPeer.doSelect(criteria);
1927                }
1928            }
1929        }
1930        lastShipmentsCriteria = criteria;
1931
1932        return collShipments;
1933          }
1934
1935    /**
1936     * If this collection has already been initialized, returns
1937     * the collection. Otherwise returns the results of
1938     * getShipments(new Criteria(),Connection)
1939     * This method takes in the Connection also as input so that
1940     * referenced objects can also be obtained using a Connection
1941     * that is taken as input
1942     */

1943    public List JavaDoc getShipments(Connection JavaDoc con) throws TorqueException
1944    {
1945              if (collShipments == null)
1946        {
1947            collShipments = getShipments(new Criteria(10), con);
1948        }
1949        return collShipments;
1950          }
1951
1952    /**
1953     * If this collection has already been initialized with
1954     * an identical criteria, it returns the collection.
1955     * Otherwise if this Sorder has previously
1956     * been saved, it will retrieve related Shipments from storage.
1957     * If this Sorder is new, it will return
1958     * an empty collection or the current collection, the criteria
1959     * is ignored on a new object.
1960     * This method takes in the Connection also as input so that
1961     * referenced objects can also be obtained using a Connection
1962     * that is taken as input
1963     */

1964    public List JavaDoc getShipments(Criteria criteria, Connection JavaDoc con)
1965            throws TorqueException
1966    {
1967              if (collShipments == null)
1968        {
1969            if (isNew())
1970            {
1971               collShipments = new ArrayList JavaDoc();
1972            }
1973            else
1974            {
1975                         criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
1976                         collShipments = ShipmentPeer.doSelect(criteria, con);
1977             }
1978         }
1979         else
1980         {
1981             // criteria has no effect for a new object
1982
if (!isNew())
1983             {
1984                 // the following code is to determine if a new query is
1985
// called for. If the criteria is the same as the last
1986
// one, just return the collection.
1987
criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
1988                             if (!lastShipmentsCriteria.equals(criteria))
1989                 {
1990                     collShipments = ShipmentPeer.doSelect(criteria, con);
1991                 }
1992             }
1993         }
1994         lastShipmentsCriteria = criteria;
1995
1996         return collShipments;
1997           }
1998
1999                                          
2000              
2001                    
2002                    
2003                                            
2004                                                                          
2005                                        
2006                    
2007                    
2008          
2009    /**
2010     * If this collection has already been initialized with
2011     * an identical criteria, it returns the collection.
2012     * Otherwise if this Sorder is new, it will return
2013     * an empty collection; or if this Sorder has previously
2014     * been saved, it will retrieve related Shipments from storage.
2015     *
2016     * This method is protected by default in order to keep the public
2017     * api reasonable. You can provide public methods for those you
2018     * actually need in Sorder.
2019     */

2020    protected List JavaDoc getShipmentsJoinCustomerRelatedByCustomerId(Criteria criteria)
2021        throws TorqueException
2022    {
2023                    if (collShipments == null)
2024        {
2025            if (isNew())
2026            {
2027               collShipments = new ArrayList JavaDoc();
2028            }
2029            else
2030            {
2031                              criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2032                              collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2033            }
2034        }
2035        else
2036        {
2037            // the following code is to determine if a new query is
2038
// called for. If the criteria is the same as the last
2039
// one, just return the collection.
2040

2041                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2042                                    if (!lastShipmentsCriteria.equals(criteria))
2043            {
2044                collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2045            }
2046        }
2047        lastShipmentsCriteria = criteria;
2048
2049        return collShipments;
2050                }
2051                  
2052                    
2053                    
2054                                            
2055                                                                          
2056                                        
2057                    
2058                    
2059          
2060    /**
2061     * If this collection has already been initialized with
2062     * an identical criteria, it returns the collection.
2063     * Otherwise if this Sorder is new, it will return
2064     * an empty collection; or if this Sorder has previously
2065     * been saved, it will retrieve related Shipments from storage.
2066     *
2067     * This method is protected by default in order to keep the public
2068     * api reasonable. You can provide public methods for those you
2069     * actually need in Sorder.
2070     */

2071    protected List JavaDoc getShipmentsJoinCustomerRelatedByRecipientId(Criteria criteria)
2072        throws TorqueException
2073    {
2074                    if (collShipments == null)
2075        {
2076            if (isNew())
2077            {
2078               collShipments = new ArrayList JavaDoc();
2079            }
2080            else
2081            {
2082                              criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2083                              collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2084            }
2085        }
2086        else
2087        {
2088            // the following code is to determine if a new query is
2089
// called for. If the criteria is the same as the last
2090
// one, just return the collection.
2091

2092                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2093                                    if (!lastShipmentsCriteria.equals(criteria))
2094            {
2095                collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2096            }
2097        }
2098        lastShipmentsCriteria = criteria;
2099
2100        return collShipments;
2101                }
2102                  
2103                    
2104                    
2105                                
2106                                                              
2107                                        
2108                    
2109                    
2110          
2111    /**
2112     * If this collection has already been initialized with
2113     * an identical criteria, it returns the collection.
2114     * Otherwise if this Sorder is new, it will return
2115     * an empty collection; or if this Sorder has previously
2116     * been saved, it will retrieve related Shipments from storage.
2117     *
2118     * This method is protected by default in order to keep the public
2119     * api reasonable. You can provide public methods for those you
2120     * actually need in Sorder.
2121     */

2122    protected List JavaDoc getShipmentsJoinProject(Criteria criteria)
2123        throws TorqueException
2124    {
2125                    if (collShipments == null)
2126        {
2127            if (isNew())
2128            {
2129               collShipments = new ArrayList JavaDoc();
2130            }
2131            else
2132            {
2133                              criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2134                              collShipments = ShipmentPeer.doSelectJoinProject(criteria);
2135            }
2136        }
2137        else
2138        {
2139            // the following code is to determine if a new query is
2140
// called for. If the criteria is the same as the last
2141
// one, just return the collection.
2142

2143                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2144                                    if (!lastShipmentsCriteria.equals(criteria))
2145            {
2146                collShipments = ShipmentPeer.doSelectJoinProject(criteria);
2147            }
2148        }
2149        lastShipmentsCriteria = criteria;
2150
2151        return collShipments;
2152                }
2153                  
2154                    
2155                              
2156                                
2157                                                              
2158                                        
2159                    
2160                    
2161          
2162    /**
2163     * If this collection has already been initialized with
2164     * an identical criteria, it returns the collection.
2165     * Otherwise if this Sorder is new, it will return
2166     * an empty collection; or if this Sorder has previously
2167     * been saved, it will retrieve related Shipments from storage.
2168     *
2169     * This method is protected by default in order to keep the public
2170     * api reasonable. You can provide public methods for those you
2171     * actually need in Sorder.
2172     */

2173    protected List JavaDoc getShipmentsJoinSorder(Criteria criteria)
2174        throws TorqueException
2175    {
2176                    if (collShipments == null)
2177        {
2178            if (isNew())
2179            {
2180               collShipments = new ArrayList JavaDoc();
2181            }
2182            else
2183            {
2184                              criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2185                              collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
2186            }
2187        }
2188        else
2189        {
2190            // the following code is to determine if a new query is
2191
// called for. If the criteria is the same as the last
2192
// one, just return the collection.
2193

2194                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2195                                    if (!lastShipmentsCriteria.equals(criteria))
2196            {
2197                collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
2198            }
2199        }
2200        lastShipmentsCriteria = criteria;
2201
2202        return collShipments;
2203                }
2204                  
2205                    
2206                    
2207                                
2208                                                              
2209                                        
2210                    
2211                    
2212          
2213    /**
2214     * If this collection has already been initialized with
2215     * an identical criteria, it returns the collection.
2216     * Otherwise if this Sorder is new, it will return
2217     * an empty collection; or if this Sorder has previously
2218     * been saved, it will retrieve related Shipments from storage.
2219     *
2220     * This method is protected by default in order to keep the public
2221     * api reasonable. You can provide public methods for those you
2222     * actually need in Sorder.
2223     */

2224    protected List JavaDoc getShipmentsJoinCarrier(Criteria criteria)
2225        throws TorqueException
2226    {
2227                    if (collShipments == null)
2228        {
2229            if (isNew())
2230            {
2231               collShipments = new ArrayList JavaDoc();
2232            }
2233            else
2234            {
2235                              criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2236                              collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
2237            }
2238        }
2239        else
2240        {
2241            // the following code is to determine if a new query is
2242
// called for. If the criteria is the same as the last
2243
// one, just return the collection.
2244

2245                        criteria.add(ShipmentPeer.SORDER_ID, getSorderId());
2246                                    if (!lastShipmentsCriteria.equals(criteria))
2247            {
2248                collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
2249            }
2250        }
2251        lastShipmentsCriteria = criteria;
2252
2253        return collShipments;
2254                }
2255                            
2256
2257
2258                          
2259            
2260          /**
2261     * Collection to store aggregation of collPrintSubscriptions
2262     */

2263    protected List JavaDoc collPrintSubscriptions;
2264
2265    /**
2266     * Temporary storage of collPrintSubscriptions to save a possible db hit in
2267     * the event objects are add to the collection, but the
2268     * complete collection is never requested.
2269     */

2270    protected void initPrintSubscriptions()
2271    {
2272        if (collPrintSubscriptions == null)
2273        {
2274            collPrintSubscriptions = new ArrayList JavaDoc();
2275        }
2276    }
2277
2278    /**
2279     * Method called to associate a PrintSubscription object to this object
2280     * through the PrintSubscription foreign key attribute
2281     *
2282     * @param l PrintSubscription
2283     * @throws TorqueException
2284     */

2285    public void addPrintSubscription(PrintSubscription l) throws TorqueException
2286    {
2287        getPrintSubscriptions().add(l);
2288        l.setSorder((Sorder) this);
2289    }
2290
2291    /**
2292     * The criteria used to select the current contents of collPrintSubscriptions
2293     */

2294    private Criteria lastPrintSubscriptionsCriteria = null;
2295      
2296    /**
2297     * If this collection has already been initialized, returns
2298     * the collection. Otherwise returns the results of
2299     * getPrintSubscriptions(new Criteria())
2300     *
2301     * @throws TorqueException
2302     */

2303    public List JavaDoc getPrintSubscriptions() throws TorqueException
2304    {
2305              if (collPrintSubscriptions == null)
2306        {
2307            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10));
2308        }
2309        return collPrintSubscriptions;
2310          }
2311
2312    /**
2313     * If this collection has already been initialized with
2314     * an identical criteria, it returns the collection.
2315     * Otherwise if this Sorder has previously
2316     * been saved, it will retrieve related PrintSubscriptions from storage.
2317     * If this Sorder is new, it will return
2318     * an empty collection or the current collection, the criteria
2319     * is ignored on a new object.
2320     *
2321     * @throws TorqueException
2322     */

2323    public List JavaDoc getPrintSubscriptions(Criteria criteria) throws TorqueException
2324    {
2325              if (collPrintSubscriptions == null)
2326        {
2327            if (isNew())
2328            {
2329               collPrintSubscriptions = new ArrayList JavaDoc();
2330            }
2331            else
2332            {
2333                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId() );
2334                        collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
2335            }
2336        }
2337        else
2338        {
2339            // criteria has no effect for a new object
2340
if (!isNew())
2341            {
2342                // the following code is to determine if a new query is
2343
// called for. If the criteria is the same as the last
2344
// one, just return the collection.
2345
criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2346                            if (!lastPrintSubscriptionsCriteria.equals(criteria))
2347                {
2348                    collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
2349                }
2350            }
2351        }
2352        lastPrintSubscriptionsCriteria = criteria;
2353
2354        return collPrintSubscriptions;
2355          }
2356
2357    /**
2358     * If this collection has already been initialized, returns
2359     * the collection. Otherwise returns the results of
2360     * getPrintSubscriptions(new Criteria(),Connection)
2361     * This method takes in the Connection also as input so that
2362     * referenced objects can also be obtained using a Connection
2363     * that is taken as input
2364     */

2365    public List JavaDoc getPrintSubscriptions(Connection JavaDoc con) throws TorqueException
2366    {
2367              if (collPrintSubscriptions == null)
2368        {
2369            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con);
2370        }
2371        return collPrintSubscriptions;
2372          }
2373
2374    /**
2375     * If this collection has already been initialized with
2376     * an identical criteria, it returns the collection.
2377     * Otherwise if this Sorder has previously
2378     * been saved, it will retrieve related PrintSubscriptions from storage.
2379     * If this Sorder is new, it will return
2380     * an empty collection or the current collection, the criteria
2381     * is ignored on a new object.
2382     * This method takes in the Connection also as input so that
2383     * referenced objects can also be obtained using a Connection
2384     * that is taken as input
2385     */

2386    public List JavaDoc getPrintSubscriptions(Criteria criteria, Connection JavaDoc con)
2387            throws TorqueException
2388    {
2389              if (collPrintSubscriptions == null)
2390        {
2391            if (isNew())
2392            {
2393               collPrintSubscriptions = new ArrayList JavaDoc();
2394            }
2395            else
2396            {
2397                         criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2398                         collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
2399             }
2400         }
2401         else
2402         {
2403             // criteria has no effect for a new object
2404
if (!isNew())
2405             {
2406                 // the following code is to determine if a new query is
2407
// called for. If the criteria is the same as the last
2408
// one, just return the collection.
2409
criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2410                             if (!lastPrintSubscriptionsCriteria.equals(criteria))
2411                 {
2412                     collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
2413                 }
2414             }
2415         }
2416         lastPrintSubscriptionsCriteria = criteria;
2417
2418         return collPrintSubscriptions;
2419           }
2420
2421                                                
2422              
2423                    
2424                    
2425                                            
2426                                                                          
2427                                        
2428                    
2429                    
2430          
2431    /**
2432     * If this collection has already been initialized with
2433     * an identical criteria, it returns the collection.
2434     * Otherwise if this Sorder is new, it will return
2435     * an empty collection; or if this Sorder has previously
2436     * been saved, it will retrieve related PrintSubscriptions from storage.
2437     *
2438     * This method is protected by default in order to keep the public
2439     * api reasonable. You can provide public methods for those you
2440     * actually need in Sorder.
2441     */

2442    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
2443        throws TorqueException
2444    {
2445                    if (collPrintSubscriptions == null)
2446        {
2447            if (isNew())
2448            {
2449               collPrintSubscriptions = new ArrayList JavaDoc();
2450            }
2451            else
2452            {
2453                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2454                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2455            }
2456        }
2457        else
2458        {
2459            // the following code is to determine if a new query is
2460
// called for. If the criteria is the same as the last
2461
// one, just return the collection.
2462

2463                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2464                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2465            {
2466                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2467            }
2468        }
2469        lastPrintSubscriptionsCriteria = criteria;
2470
2471        return collPrintSubscriptions;
2472                }
2473                  
2474                    
2475                    
2476                                            
2477                                                                          
2478                                        
2479                    
2480                    
2481          
2482    /**
2483     * If this collection has already been initialized with
2484     * an identical criteria, it returns the collection.
2485     * Otherwise if this Sorder is new, it will return
2486     * an empty collection; or if this Sorder has previously
2487     * been saved, it will retrieve related PrintSubscriptions from storage.
2488     *
2489     * This method is protected by default in order to keep the public
2490     * api reasonable. You can provide public methods for those you
2491     * actually need in Sorder.
2492     */

2493    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
2494        throws TorqueException
2495    {
2496                    if (collPrintSubscriptions == null)
2497        {
2498            if (isNew())
2499            {
2500               collPrintSubscriptions = new ArrayList JavaDoc();
2501            }
2502            else
2503            {
2504                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2505                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2506            }
2507        }
2508        else
2509        {
2510            // the following code is to determine if a new query is
2511
// called for. If the criteria is the same as the last
2512
// one, just return the collection.
2513

2514                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2515                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2516            {
2517                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2518            }
2519        }
2520        lastPrintSubscriptionsCriteria = criteria;
2521
2522        return collPrintSubscriptions;
2523                }
2524                  
2525                    
2526                    
2527                                
2528                                                              
2529                                        
2530                    
2531                    
2532          
2533    /**
2534     * If this collection has already been initialized with
2535     * an identical criteria, it returns the collection.
2536     * Otherwise if this Sorder is new, it will return
2537     * an empty collection; or if this Sorder has previously
2538     * been saved, it will retrieve related PrintSubscriptions from storage.
2539     *
2540     * This method is protected by default in order to keep the public
2541     * api reasonable. You can provide public methods for those you
2542     * actually need in Sorder.
2543     */

2544    protected List JavaDoc getPrintSubscriptionsJoinCarrier(Criteria criteria)
2545        throws TorqueException
2546    {
2547                    if (collPrintSubscriptions == null)
2548        {
2549            if (isNew())
2550            {
2551               collPrintSubscriptions = new ArrayList JavaDoc();
2552            }
2553            else
2554            {
2555                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2556                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
2557            }
2558        }
2559        else
2560        {
2561            // the following code is to determine if a new query is
2562
// called for. If the criteria is the same as the last
2563
// one, just return the collection.
2564

2565                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2566                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2567            {
2568                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
2569            }
2570        }
2571        lastPrintSubscriptionsCriteria = criteria;
2572
2573        return collPrintSubscriptions;
2574                }
2575                  
2576                    
2577                    
2578                                
2579                                                              
2580                                        
2581                    
2582                    
2583          
2584    /**
2585     * If this collection has already been initialized with
2586     * an identical criteria, it returns the collection.
2587     * Otherwise if this Sorder is new, it will return
2588     * an empty collection; or if this Sorder has previously
2589     * been saved, it will retrieve related PrintSubscriptions from storage.
2590     *
2591     * This method is protected by default in order to keep the public
2592     * api reasonable. You can provide public methods for those you
2593     * actually need in Sorder.
2594     */

2595    protected List JavaDoc getPrintSubscriptionsJoinProject(Criteria criteria)
2596        throws TorqueException
2597    {
2598                    if (collPrintSubscriptions == null)
2599        {
2600            if (isNew())
2601            {
2602               collPrintSubscriptions = new ArrayList JavaDoc();
2603            }
2604            else
2605            {
2606                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2607                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
2608            }
2609        }
2610        else
2611        {
2612            // the following code is to determine if a new query is
2613
// called for. If the criteria is the same as the last
2614
// one, just return the collection.
2615

2616                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2617                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2618            {
2619                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
2620            }
2621        }
2622        lastPrintSubscriptionsCriteria = criteria;
2623
2624        return collPrintSubscriptions;
2625                }
2626                  
2627                    
2628                    
2629                                
2630                                                              
2631                                        
2632                    
2633                    
2634          
2635    /**
2636     * If this collection has already been initialized with
2637     * an identical criteria, it returns the collection.
2638     * Otherwise if this Sorder is new, it will return
2639     * an empty collection; or if this Sorder has previously
2640     * been saved, it will retrieve related PrintSubscriptions from storage.
2641     *
2642     * This method is protected by default in order to keep the public
2643     * api reasonable. You can provide public methods for those you
2644     * actually need in Sorder.
2645     */

2646    protected List JavaDoc getPrintSubscriptionsJoinProduct(Criteria criteria)
2647        throws TorqueException
2648    {
2649                    if (collPrintSubscriptions == null)
2650        {
2651            if (isNew())
2652            {
2653               collPrintSubscriptions = new ArrayList JavaDoc();
2654            }
2655            else
2656            {
2657                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2658                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
2659            }
2660        }
2661        else
2662        {
2663            // the following code is to determine if a new query is
2664
// called for. If the criteria is the same as the last
2665
// one, just return the collection.
2666

2667                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2668                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2669            {
2670                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
2671            }
2672        }
2673        lastPrintSubscriptionsCriteria = criteria;
2674
2675        return collPrintSubscriptions;
2676                }
2677                  
2678                    
2679                              
2680                                
2681                                                              
2682                                        
2683                    
2684                    
2685          
2686    /**
2687     * If this collection has already been initialized with
2688     * an identical criteria, it returns the collection.
2689     * Otherwise if this Sorder is new, it will return
2690     * an empty collection; or if this Sorder has previously
2691     * been saved, it will retrieve related PrintSubscriptions from storage.
2692     *
2693     * This method is protected by default in order to keep the public
2694     * api reasonable. You can provide public methods for those you
2695     * actually need in Sorder.
2696     */

2697    protected List JavaDoc getPrintSubscriptionsJoinSorder(Criteria criteria)
2698        throws TorqueException
2699    {
2700                    if (collPrintSubscriptions == null)
2701        {
2702            if (isNew())
2703            {
2704               collPrintSubscriptions = new ArrayList JavaDoc();
2705            }
2706            else
2707            {
2708                              criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2709                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
2710            }
2711        }
2712        else
2713        {
2714            // the following code is to determine if a new query is
2715
// called for. If the criteria is the same as the last
2716
// one, just return the collection.
2717

2718                        criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId());
2719                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2720            {
2721                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
2722            }
2723        }
2724        lastPrintSubscriptionsCriteria = criteria;
2725
2726        return collPrintSubscriptions;
2727                }
2728                            
2729
2730
2731                          
2732            
2733          /**
2734     * Collection to store aggregation of collOnlineSubscriptions
2735     */

2736    protected List JavaDoc collOnlineSubscriptions;
2737
2738    /**
2739     * Temporary storage of collOnlineSubscriptions to save a possible db hit in
2740     * the event objects are add to the collection, but the
2741     * complete collection is never requested.
2742     */

2743    protected void initOnlineSubscriptions()
2744    {
2745        if (collOnlineSubscriptions == null)
2746        {
2747            collOnlineSubscriptions = new ArrayList JavaDoc();
2748        }
2749    }
2750
2751    /**
2752     * Method called to associate a OnlineSubscription object to this object
2753     * through the OnlineSubscription foreign key attribute
2754     *
2755     * @param l OnlineSubscription
2756     * @throws TorqueException
2757     */

2758    public void addOnlineSubscription(OnlineSubscription l) throws TorqueException
2759    {
2760        getOnlineSubscriptions().add(l);
2761        l.setSorder((Sorder) this);
2762    }
2763
2764    /**
2765     * The criteria used to select the current contents of collOnlineSubscriptions
2766     */

2767    private Criteria lastOnlineSubscriptionsCriteria = null;
2768      
2769    /**
2770     * If this collection has already been initialized, returns
2771     * the collection. Otherwise returns the results of
2772     * getOnlineSubscriptions(new Criteria())
2773     *
2774     * @throws TorqueException
2775     */

2776    public List JavaDoc getOnlineSubscriptions() throws TorqueException
2777    {
2778              if (collOnlineSubscriptions == null)
2779        {
2780            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10));
2781        }
2782        return collOnlineSubscriptions;
2783          }
2784
2785    /**
2786     * If this collection has already been initialized with
2787     * an identical criteria, it returns the collection.
2788     * Otherwise if this Sorder has previously
2789     * been saved, it will retrieve related OnlineSubscriptions from storage.
2790     * If this Sorder is new, it will return
2791     * an empty collection or the current collection, the criteria
2792     * is ignored on a new object.
2793     *
2794     * @throws TorqueException
2795     */

2796    public List JavaDoc getOnlineSubscriptions(Criteria criteria) throws TorqueException
2797    {
2798              if (collOnlineSubscriptions == null)
2799        {
2800            if (isNew())
2801            {
2802               collOnlineSubscriptions = new ArrayList JavaDoc();
2803            }
2804            else
2805            {
2806                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId() );
2807                        collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
2808            }
2809        }
2810        else
2811        {
2812            // criteria has no effect for a new object
2813
if (!isNew())
2814            {
2815                // the following code is to determine if a new query is
2816
// called for. If the criteria is the same as the last
2817
// one, just return the collection.
2818
criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2819                            if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2820                {
2821                    collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
2822                }
2823            }
2824        }
2825        lastOnlineSubscriptionsCriteria = criteria;
2826
2827        return collOnlineSubscriptions;
2828          }
2829
2830    /**
2831     * If this collection has already been initialized, returns
2832     * the collection. Otherwise returns the results of
2833     * getOnlineSubscriptions(new Criteria(),Connection)
2834     * This method takes in the Connection also as input so that
2835     * referenced objects can also be obtained using a Connection
2836     * that is taken as input
2837     */

2838    public List JavaDoc getOnlineSubscriptions(Connection JavaDoc con) throws TorqueException
2839    {
2840              if (collOnlineSubscriptions == null)
2841        {
2842            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10), con);
2843        }
2844        return collOnlineSubscriptions;
2845          }
2846
2847    /**
2848     * If this collection has already been initialized with
2849     * an identical criteria, it returns the collection.
2850     * Otherwise if this Sorder has previously
2851     * been saved, it will retrieve related OnlineSubscriptions from storage.
2852     * If this Sorder is new, it will return
2853     * an empty collection or the current collection, the criteria
2854     * is ignored on a new object.
2855     * This method takes in the Connection also as input so that
2856     * referenced objects can also be obtained using a Connection
2857     * that is taken as input
2858     */

2859    public List JavaDoc getOnlineSubscriptions(Criteria criteria, Connection JavaDoc con)
2860            throws TorqueException
2861    {
2862              if (collOnlineSubscriptions == null)
2863        {
2864            if (isNew())
2865            {
2866               collOnlineSubscriptions = new ArrayList JavaDoc();
2867            }
2868            else
2869            {
2870                         criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2871                         collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
2872             }
2873         }
2874         else
2875         {
2876             // criteria has no effect for a new object
2877
if (!isNew())
2878             {
2879                 // the following code is to determine if a new query is
2880
// called for. If the criteria is the same as the last
2881
// one, just return the collection.
2882
criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2883                             if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2884                 {
2885                     collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
2886                 }
2887             }
2888         }
2889         lastOnlineSubscriptionsCriteria = criteria;
2890
2891         return collOnlineSubscriptions;
2892           }
2893
2894                                          
2895              
2896                    
2897                    
2898                                            
2899                                                                          
2900                                        
2901                    
2902                    
2903          
2904    /**
2905     * If this collection has already been initialized with
2906     * an identical criteria, it returns the collection.
2907     * Otherwise if this Sorder is new, it will return
2908     * an empty collection; or if this Sorder has previously
2909     * been saved, it will retrieve related OnlineSubscriptions from storage.
2910     *
2911     * This method is protected by default in order to keep the public
2912     * api reasonable. You can provide public methods for those you
2913     * actually need in Sorder.
2914     */

2915    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
2916        throws TorqueException
2917    {
2918                    if (collOnlineSubscriptions == null)
2919        {
2920            if (isNew())
2921            {
2922               collOnlineSubscriptions = new ArrayList JavaDoc();
2923            }
2924            else
2925            {
2926                              criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2927                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2928            }
2929        }
2930        else
2931        {
2932            // the following code is to determine if a new query is
2933
// called for. If the criteria is the same as the last
2934
// one, just return the collection.
2935

2936                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2937                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2938            {
2939                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2940            }
2941        }
2942        lastOnlineSubscriptionsCriteria = criteria;
2943
2944        return collOnlineSubscriptions;
2945                }
2946                  
2947                    
2948                    
2949                                            
2950                                                                          
2951                                        
2952                    
2953                    
2954          
2955    /**
2956     * If this collection has already been initialized with
2957     * an identical criteria, it returns the collection.
2958     * Otherwise if this Sorder is new, it will return
2959     * an empty collection; or if this Sorder has previously
2960     * been saved, it will retrieve related OnlineSubscriptions from storage.
2961     *
2962     * This method is protected by default in order to keep the public
2963     * api reasonable. You can provide public methods for those you
2964     * actually need in Sorder.
2965     */

2966    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
2967        throws TorqueException
2968    {
2969                    if (collOnlineSubscriptions == null)
2970        {
2971            if (isNew())
2972            {
2973               collOnlineSubscriptions = new ArrayList JavaDoc();
2974            }
2975            else
2976            {
2977                              criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2978                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2979            }
2980        }
2981        else
2982        {
2983            // the following code is to determine if a new query is
2984
// called for. If the criteria is the same as the last
2985
// one, just return the collection.
2986

2987                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
2988                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2989            {
2990                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2991            }
2992        }
2993        lastOnlineSubscriptionsCriteria = criteria;
2994
2995        return collOnlineSubscriptions;
2996                }
2997                  
2998                    
2999                    
3000                                
3001                                                              
3002                                        
3003                    
3004                    
3005          
3006    /**
3007     * If this collection has already been initialized with
3008     * an identical criteria, it returns the collection.
3009     * Otherwise if this Sorder is new, it will return
3010     * an empty collection; or if this Sorder has previously
3011     * been saved, it will retrieve related OnlineSubscriptions from storage.
3012     *
3013     * This method is protected by default in order to keep the public
3014     * api reasonable. You can provide public methods for those you
3015     * actually need in Sorder.
3016     */

3017    protected List JavaDoc getOnlineSubscriptionsJoinProject(Criteria criteria)
3018        throws TorqueException
3019    {
3020                    if (collOnlineSubscriptions == null)
3021        {
3022            if (isNew())
3023            {
3024               collOnlineSubscriptions = new ArrayList JavaDoc();
3025            }
3026            else
3027            {
3028                              criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3029                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
3030            }
3031        }
3032        else
3033        {
3034            // the following code is to determine if a new query is
3035
// called for. If the criteria is the same as the last
3036
// one, just return the collection.
3037

3038                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3039                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3040            {
3041                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
3042            }
3043        }
3044        lastOnlineSubscriptionsCriteria = criteria;
3045
3046        return collOnlineSubscriptions;
3047                }
3048                  
3049                    
3050                    
3051                                
3052                                                              
3053                                        
3054                    
3055                    
3056          
3057    /**
3058     * If this collection has already been initialized with
3059     * an identical criteria, it returns the collection.
3060     * Otherwise if this Sorder is new, it will return
3061     * an empty collection; or if this Sorder has previously
3062     * been saved, it will retrieve related OnlineSubscriptions from storage.
3063     *
3064     * This method is protected by default in order to keep the public
3065     * api reasonable. You can provide public methods for those you
3066     * actually need in Sorder.
3067     */

3068    protected List JavaDoc getOnlineSubscriptionsJoinProduct(Criteria criteria)
3069        throws TorqueException
3070    {
3071                    if (collOnlineSubscriptions == null)
3072        {
3073            if (isNew())
3074            {
3075               collOnlineSubscriptions = new ArrayList JavaDoc();
3076            }
3077            else
3078            {
3079                              criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3080                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
3081            }
3082        }
3083        else
3084        {
3085            // the following code is to determine if a new query is
3086
// called for. If the criteria is the same as the last
3087
// one, just return the collection.
3088

3089                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3090                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3091            {
3092                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
3093            }
3094        }
3095        lastOnlineSubscriptionsCriteria = criteria;
3096
3097        return collOnlineSubscriptions;
3098                }
3099                  
3100                    
3101                              
3102                                
3103                                                              
3104                                        
3105                    
3106                    
3107          
3108    /**
3109     * If this collection has already been initialized with
3110     * an identical criteria, it returns the collection.
3111     * Otherwise if this Sorder is new, it will return
3112     * an empty collection; or if this Sorder has previously
3113     * been saved, it will retrieve related OnlineSubscriptions from storage.
3114     *
3115     * This method is protected by default in order to keep the public
3116     * api reasonable. You can provide public methods for those you
3117     * actually need in Sorder.
3118     */

3119    protected List JavaDoc getOnlineSubscriptionsJoinSorder(Criteria criteria)
3120        throws TorqueException
3121    {
3122                    if (collOnlineSubscriptions == null)
3123        {
3124            if (isNew())
3125            {
3126               collOnlineSubscriptions = new ArrayList JavaDoc();
3127            }
3128            else
3129            {
3130                              criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3131                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
3132            }
3133        }
3134        else
3135        {
3136            // the following code is to determine if a new query is
3137
// called for. If the criteria is the same as the last
3138
// one, just return the collection.
3139

3140                        criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId());
3141                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3142            {
3143                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
3144            }
3145        }
3146        lastOnlineSubscriptionsCriteria = criteria;
3147
3148        return collOnlineSubscriptions;
3149                }
3150                            
3151
3152
3153                          
3154            
3155          /**
3156     * Collection to store aggregation of collSorderItems
3157     */

3158    protected List JavaDoc collSorderItems;
3159
3160    /**
3161     * Temporary storage of collSorderItems to save a possible db hit in
3162     * the event objects are add to the collection, but the
3163     * complete collection is never requested.
3164     */

3165    protected void initSorderItems()
3166    {
3167        if (collSorderItems == null)
3168        {
3169            collSorderItems = new ArrayList JavaDoc();
3170        }
3171    }
3172
3173    /**
3174     * Method called to associate a SorderItem object to this object
3175     * through the SorderItem foreign key attribute
3176     *
3177     * @param l SorderItem
3178     * @throws TorqueException
3179     */

3180    public void addSorderItem(SorderItem l) throws TorqueException
3181    {
3182        getSorderItems().add(l);
3183        l.setSorder((Sorder) this);
3184    }
3185
3186    /**
3187     * The criteria used to select the current contents of collSorderItems
3188     */

3189    private Criteria lastSorderItemsCriteria = null;
3190      
3191    /**
3192     * If this collection has already been initialized, returns
3193     * the collection. Otherwise returns the results of
3194     * getSorderItems(new Criteria())
3195     *
3196     * @throws TorqueException
3197     */

3198    public List JavaDoc getSorderItems() throws TorqueException
3199    {
3200              if (collSorderItems == null)
3201        {
3202            collSorderItems = getSorderItems(new Criteria(10));
3203        }
3204        return collSorderItems;
3205          }
3206
3207    /**
3208     * If this collection has already been initialized with
3209     * an identical criteria, it returns the collection.
3210     * Otherwise if this Sorder has previously
3211     * been saved, it will retrieve related SorderItems from storage.
3212     * If this Sorder is new, it will return
3213     * an empty collection or the current collection, the criteria
3214     * is ignored on a new object.
3215     *
3216     * @throws TorqueException
3217     */

3218    public List JavaDoc getSorderItems(Criteria criteria) throws TorqueException
3219    {
3220              if (collSorderItems == null)
3221        {
3222            if (isNew())
3223            {
3224               collSorderItems = new ArrayList JavaDoc();
3225            }
3226            else
3227            {
3228                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId() );
3229                        collSorderItems = SorderItemPeer.doSelect(criteria);
3230            }
3231        }
3232        else
3233        {
3234            // criteria has no effect for a new object
3235
if (!isNew())
3236            {
3237                // the following code is to determine if a new query is
3238
// called for. If the criteria is the same as the last
3239
// one, just return the collection.
3240
criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3241                            if (!lastSorderItemsCriteria.equals(criteria))
3242                {
3243                    collSorderItems = SorderItemPeer.doSelect(criteria);
3244                }
3245            }
3246        }
3247        lastSorderItemsCriteria = criteria;
3248
3249        return collSorderItems;
3250          }
3251
3252    /**
3253     * If this collection has already been initialized, returns
3254     * the collection. Otherwise returns the results of
3255     * getSorderItems(new Criteria(),Connection)
3256     * This method takes in the Connection also as input so that
3257     * referenced objects can also be obtained using a Connection
3258     * that is taken as input
3259     */

3260    public List JavaDoc getSorderItems(Connection JavaDoc con) throws TorqueException
3261    {
3262              if (collSorderItems == null)
3263        {
3264            collSorderItems = getSorderItems(new Criteria(10), con);
3265        }
3266        return collSorderItems;
3267          }
3268
3269    /**
3270     * If this collection has already been initialized with
3271     * an identical criteria, it returns the collection.
3272     * Otherwise if this Sorder has previously
3273     * been saved, it will retrieve related SorderItems from storage.
3274     * If this Sorder is new, it will return
3275     * an empty collection or the current collection, the criteria
3276     * is ignored on a new object.
3277     * This method takes in the Connection also as input so that
3278     * referenced objects can also be obtained using a Connection
3279     * that is taken as input
3280     */

3281    public List JavaDoc getSorderItems(Criteria criteria, Connection JavaDoc con)
3282            throws TorqueException
3283    {
3284              if (collSorderItems == null)
3285        {
3286            if (isNew())
3287            {
3288               collSorderItems = new ArrayList JavaDoc();
3289            }
3290            else
3291            {
3292                         criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3293                         collSorderItems = SorderItemPeer.doSelect(criteria, con);
3294             }
3295         }
3296         else
3297         {
3298             // criteria has no effect for a new object
3299
if (!isNew())
3300             {
3301                 // the following code is to determine if a new query is
3302
// called for. If the criteria is the same as the last
3303
// one, just return the collection.
3304
criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3305                             if (!lastSorderItemsCriteria.equals(criteria))
3306                 {
3307                     collSorderItems = SorderItemPeer.doSelect(criteria, con);
3308                 }
3309             }
3310         }
3311         lastSorderItemsCriteria = criteria;
3312
3313         return collSorderItems;
3314           }
3315
3316                                                
3317              
3318                    
3319                              
3320                                
3321                                                              
3322                                        
3323                    
3324                    
3325          
3326    /**
3327     * If this collection has already been initialized with
3328     * an identical criteria, it returns the collection.
3329     * Otherwise if this Sorder is new, it will return
3330     * an empty collection; or if this Sorder has previously
3331     * been saved, it will retrieve related SorderItems from storage.
3332     *
3333     * This method is protected by default in order to keep the public
3334     * api reasonable. You can provide public methods for those you
3335     * actually need in Sorder.
3336     */

3337    protected List JavaDoc getSorderItemsJoinSorder(Criteria criteria)
3338        throws TorqueException
3339    {
3340                    if (collSorderItems == null)
3341        {
3342            if (isNew())
3343            {
3344               collSorderItems = new ArrayList JavaDoc();
3345            }
3346            else
3347            {
3348                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3349                              collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
3350            }
3351        }
3352        else
3353        {
3354            // the following code is to determine if a new query is
3355
// called for. If the criteria is the same as the last
3356
// one, just return the collection.
3357

3358                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3359                                    if (!lastSorderItemsCriteria.equals(criteria))
3360            {
3361                collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
3362            }
3363        }
3364        lastSorderItemsCriteria = criteria;
3365
3366        return collSorderItems;
3367                }
3368                  
3369                    
3370                    
3371                                
3372                                                              
3373                                        
3374                    
3375                    
3376          
3377    /**
3378     * If this collection has already been initialized with
3379     * an identical criteria, it returns the collection.
3380     * Otherwise if this Sorder is new, it will return
3381     * an empty collection; or if this Sorder has previously
3382     * been saved, it will retrieve related SorderItems from storage.
3383     *
3384     * This method is protected by default in order to keep the public
3385     * api reasonable. You can provide public methods for those you
3386     * actually need in Sorder.
3387     */

3388    protected List JavaDoc getSorderItemsJoinProduct(Criteria criteria)
3389        throws TorqueException
3390    {
3391                    if (collSorderItems == null)
3392        {
3393            if (isNew())
3394            {
3395               collSorderItems = new ArrayList JavaDoc();
3396            }
3397            else
3398            {
3399                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3400                              collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
3401            }
3402        }
3403        else
3404        {
3405            // the following code is to determine if a new query is
3406
// called for. If the criteria is the same as the last
3407
// one, just return the collection.
3408

3409                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3410                                    if (!lastSorderItemsCriteria.equals(criteria))
3411            {
3412                collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
3413            }
3414        }
3415        lastSorderItemsCriteria = criteria;
3416
3417        return collSorderItems;
3418                }
3419                  
3420                    
3421                    
3422                                            
3423                                                                          
3424                                        
3425                    
3426                    
3427          
3428    /**
3429     * If this collection has already been initialized with
3430     * an identical criteria, it returns the collection.
3431     * Otherwise if this Sorder is new, it will return
3432     * an empty collection; or if this Sorder has previously
3433     * been saved, it will retrieve related SorderItems from storage.
3434     *
3435     * This method is protected by default in order to keep the public
3436     * api reasonable. You can provide public methods for those you
3437     * actually need in Sorder.
3438     */

3439    protected List JavaDoc getSorderItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
3440        throws TorqueException
3441    {
3442                    if (collSorderItems == null)
3443        {
3444            if (isNew())
3445            {
3446               collSorderItems = new ArrayList JavaDoc();
3447            }
3448            else
3449            {
3450                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3451                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
3452            }
3453        }
3454        else
3455        {
3456            // the following code is to determine if a new query is
3457
// called for. If the criteria is the same as the last
3458
// one, just return the collection.
3459

3460                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3461                                    if (!lastSorderItemsCriteria.equals(criteria))
3462            {
3463                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
3464            }
3465        }
3466        lastSorderItemsCriteria = criteria;
3467
3468        return collSorderItems;
3469                }
3470                  
3471                    
3472                    
3473                                            
3474                                                                          
3475                                        
3476                    
3477                    
3478          
3479    /**
3480     * If this collection has already been initialized with
3481     * an identical criteria, it returns the collection.
3482     * Otherwise if this Sorder is new, it will return
3483     * an empty collection; or if this Sorder has previously
3484     * been saved, it will retrieve related SorderItems from storage.
3485     *
3486     * This method is protected by default in order to keep the public
3487     * api reasonable. You can provide public methods for those you
3488     * actually need in Sorder.
3489     */

3490    protected List JavaDoc getSorderItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
3491        throws TorqueException
3492    {
3493                    if (collSorderItems == null)
3494        {
3495            if (isNew())
3496            {
3497               collSorderItems = new ArrayList JavaDoc();
3498            }
3499            else
3500            {
3501                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3502                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
3503            }
3504        }
3505        else
3506        {
3507            // the following code is to determine if a new query is
3508
// called for. If the criteria is the same as the last
3509
// one, just return the collection.
3510

3511                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3512                                    if (!lastSorderItemsCriteria.equals(criteria))
3513            {
3514                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
3515            }
3516        }
3517        lastSorderItemsCriteria = criteria;
3518
3519        return collSorderItems;
3520                }
3521                  
3522                    
3523                    
3524                                
3525                                                              
3526                                        
3527                    
3528                    
3529          
3530    /**
3531     * If this collection has already been initialized with
3532     * an identical criteria, it returns the collection.
3533     * Otherwise if this Sorder is new, it will return
3534     * an empty collection; or if this Sorder has previously
3535     * been saved, it will retrieve related SorderItems from storage.
3536     *
3537     * This method is protected by default in order to keep the public
3538     * api reasonable. You can provide public methods for those you
3539     * actually need in Sorder.
3540     */

3541    protected List JavaDoc getSorderItemsJoinProject(Criteria criteria)
3542        throws TorqueException
3543    {
3544                    if (collSorderItems == null)
3545        {
3546            if (isNew())
3547            {
3548               collSorderItems = new ArrayList JavaDoc();
3549            }
3550            else
3551            {
3552                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3553                              collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
3554            }
3555        }
3556        else
3557        {
3558            // the following code is to determine if a new query is
3559
// called for. If the criteria is the same as the last
3560
// one, just return the collection.
3561

3562                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3563                                    if (!lastSorderItemsCriteria.equals(criteria))
3564            {
3565                collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
3566            }
3567        }
3568        lastSorderItemsCriteria = criteria;
3569
3570        return collSorderItems;
3571                }
3572                  
3573                    
3574                    
3575                                
3576                                                              
3577                                        
3578                    
3579                    
3580          
3581    /**
3582     * If this collection has already been initialized with
3583     * an identical criteria, it returns the collection.
3584     * Otherwise if this Sorder is new, it will return
3585     * an empty collection; or if this Sorder has previously
3586     * been saved, it will retrieve related SorderItems from storage.
3587     *
3588     * This method is protected by default in order to keep the public
3589     * api reasonable. You can provide public methods for those you
3590     * actually need in Sorder.
3591     */

3592    protected List JavaDoc getSorderItemsJoinCurrency(Criteria criteria)
3593        throws TorqueException
3594    {
3595                    if (collSorderItems == null)
3596        {
3597            if (isNew())
3598            {
3599               collSorderItems = new ArrayList JavaDoc();
3600            }
3601            else
3602            {
3603                              criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3604                              collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
3605            }
3606        }
3607        else
3608        {
3609            // the following code is to determine if a new query is
3610
// called for. If the criteria is the same as the last
3611
// one, just return the collection.
3612

3613                        criteria.add(SorderItemPeer.SORDER_ID, getSorderId());
3614                                    if (!lastSorderItemsCriteria.equals(criteria))
3615            {
3616                collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
3617            }
3618        }
3619        lastSorderItemsCriteria = criteria;
3620
3621        return collSorderItems;
3622                }
3623                            
3624
3625
3626                          
3627            
3628          /**
3629     * Collection to store aggregation of collPaymentItems
3630     */

3631    protected List JavaDoc collPaymentItems;
3632
3633    /**
3634     * Temporary storage of collPaymentItems to save a possible db hit in
3635     * the event objects are add to the collection, but the
3636     * complete collection is never requested.
3637     */

3638    protected void initPaymentItems()
3639    {
3640        if (collPaymentItems == null)
3641        {
3642            collPaymentItems = new ArrayList JavaDoc();
3643        }
3644    }
3645
3646    /**
3647     * Method called to associate a PaymentItem object to this object
3648     * through the PaymentItem foreign key attribute
3649     *
3650     * @param l PaymentItem
3651     * @throws TorqueException
3652     */

3653    public void addPaymentItem(PaymentItem l) throws TorqueException
3654    {
3655        getPaymentItems().add(l);
3656        l.setSorder((Sorder) this);
3657    }
3658
3659    /**
3660     * The criteria used to select the current contents of collPaymentItems
3661     */

3662    private Criteria lastPaymentItemsCriteria = null;
3663      
3664    /**
3665     * If this collection has already been initialized, returns
3666     * the collection. Otherwise returns the results of
3667     * getPaymentItems(new Criteria())
3668     *
3669     * @throws TorqueException
3670     */

3671    public List JavaDoc getPaymentItems() throws TorqueException
3672    {
3673              if (collPaymentItems == null)
3674        {
3675            collPaymentItems = getPaymentItems(new Criteria(10));
3676        }
3677        return collPaymentItems;
3678          }
3679
3680    /**
3681     * If this collection has already been initialized with
3682     * an identical criteria, it returns the collection.
3683     * Otherwise if this Sorder has previously
3684     * been saved, it will retrieve related PaymentItems from storage.
3685     * If this Sorder is new, it will return
3686     * an empty collection or the current collection, the criteria
3687     * is ignored on a new object.
3688     *
3689     * @throws TorqueException
3690     */

3691    public List JavaDoc getPaymentItems(Criteria criteria) throws TorqueException
3692    {
3693              if (collPaymentItems == null)
3694        {
3695            if (isNew())
3696            {
3697               collPaymentItems = new ArrayList JavaDoc();
3698            }
3699            else
3700            {
3701                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId() );
3702                        collPaymentItems = PaymentItemPeer.doSelect(criteria);
3703            }
3704        }
3705        else
3706        {
3707            // criteria has no effect for a new object
3708
if (!isNew())
3709            {
3710                // the following code is to determine if a new query is
3711
// called for. If the criteria is the same as the last
3712
// one, just return the collection.
3713
criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3714                            if (!lastPaymentItemsCriteria.equals(criteria))
3715                {
3716                    collPaymentItems = PaymentItemPeer.doSelect(criteria);
3717                }
3718            }
3719        }
3720        lastPaymentItemsCriteria = criteria;
3721
3722        return collPaymentItems;
3723          }
3724
3725    /**
3726     * If this collection has already been initialized, returns
3727     * the collection. Otherwise returns the results of
3728     * getPaymentItems(new Criteria(),Connection)
3729     * This method takes in the Connection also as input so that
3730     * referenced objects can also be obtained using a Connection
3731     * that is taken as input
3732     */

3733    public List JavaDoc getPaymentItems(Connection JavaDoc con) throws TorqueException
3734    {
3735              if (collPaymentItems == null)
3736        {
3737            collPaymentItems = getPaymentItems(new Criteria(10), con);
3738        }
3739        return collPaymentItems;
3740          }
3741
3742    /**
3743     * If this collection has already been initialized with
3744     * an identical criteria, it returns the collection.
3745     * Otherwise if this Sorder has previously
3746     * been saved, it will retrieve related PaymentItems from storage.
3747     * If this Sorder is new, it will return
3748     * an empty collection or the current collection, the criteria
3749     * is ignored on a new object.
3750     * This method takes in the Connection also as input so that
3751     * referenced objects can also be obtained using a Connection
3752     * that is taken as input
3753     */

3754    public List JavaDoc getPaymentItems(Criteria criteria, Connection JavaDoc con)
3755            throws TorqueException
3756    {
3757              if (collPaymentItems == null)
3758        {
3759            if (isNew())
3760            {
3761               collPaymentItems = new ArrayList JavaDoc();
3762            }
3763            else
3764            {
3765                         criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3766                         collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
3767             }
3768         }
3769         else
3770         {
3771             // criteria has no effect for a new object
3772
if (!isNew())
3773             {
3774                 // the following code is to determine if a new query is
3775
// called for. If the criteria is the same as the last
3776
// one, just return the collection.
3777
criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3778                             if (!lastPaymentItemsCriteria.equals(criteria))
3779                 {
3780                     collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
3781                 }
3782             }
3783         }
3784         lastPaymentItemsCriteria = criteria;
3785
3786         return collPaymentItems;
3787           }
3788
3789                                                
3790              
3791                    
3792                    
3793                                
3794                                                              
3795                                        
3796                    
3797                    
3798          
3799    /**
3800     * If this collection has already been initialized with
3801     * an identical criteria, it returns the collection.
3802     * Otherwise if this Sorder is new, it will return
3803     * an empty collection; or if this Sorder has previously
3804     * been saved, it will retrieve related PaymentItems from storage.
3805     *
3806     * This method is protected by default in order to keep the public
3807     * api reasonable. You can provide public methods for those you
3808     * actually need in Sorder.
3809     */

3810    protected List JavaDoc getPaymentItemsJoinPayment(Criteria criteria)
3811        throws TorqueException
3812    {
3813                    if (collPaymentItems == null)
3814        {
3815            if (isNew())
3816            {
3817               collPaymentItems = new ArrayList JavaDoc();
3818            }
3819            else
3820            {
3821                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3822                              collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
3823            }
3824        }
3825        else
3826        {
3827            // the following code is to determine if a new query is
3828
// called for. If the criteria is the same as the last
3829
// one, just return the collection.
3830

3831                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3832                                    if (!lastPaymentItemsCriteria.equals(criteria))
3833            {
3834                collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
3835            }
3836        }
3837        lastPaymentItemsCriteria = criteria;
3838
3839        return collPaymentItems;
3840                }
3841                  
3842                    
3843                              
3844                                
3845                                                              
3846                                        
3847                    
3848                    
3849          
3850    /**
3851     * If this collection has already been initialized with
3852     * an identical criteria, it returns the collection.
3853     * Otherwise if this Sorder is new, it will return
3854     * an empty collection; or if this Sorder has previously
3855     * been saved, it will retrieve related PaymentItems from storage.
3856     *
3857     * This method is protected by default in order to keep the public
3858     * api reasonable. You can provide public methods for those you
3859     * actually need in Sorder.
3860     */

3861    protected List JavaDoc getPaymentItemsJoinSorder(Criteria criteria)
3862        throws TorqueException
3863    {
3864                    if (collPaymentItems == null)
3865        {
3866            if (isNew())
3867            {
3868               collPaymentItems = new ArrayList JavaDoc();
3869            }
3870            else
3871            {
3872                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3873                              collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
3874            }
3875        }
3876        else
3877        {
3878            // the following code is to determine if a new query is
3879
// called for. If the criteria is the same as the last
3880
// one, just return the collection.
3881

3882                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3883                                    if (!lastPaymentItemsCriteria.equals(criteria))
3884            {
3885                collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
3886            }
3887        }
3888        lastPaymentItemsCriteria = criteria;
3889
3890        return collPaymentItems;
3891                }
3892                  
3893                    
3894                    
3895                                
3896                                                              
3897                                        
3898                    
3899                    
3900          
3901    /**
3902     * If this collection has already been initialized with
3903     * an identical criteria, it returns the collection.
3904     * Otherwise if this Sorder is new, it will return
3905     * an empty collection; or if this Sorder has previously
3906     * been saved, it will retrieve related PaymentItems from storage.
3907     *
3908     * This method is protected by default in order to keep the public
3909     * api reasonable. You can provide public methods for those you
3910     * actually need in Sorder.
3911     */

3912    protected List JavaDoc getPaymentItemsJoinProduct(Criteria criteria)
3913        throws TorqueException
3914    {
3915                    if (collPaymentItems == null)
3916        {
3917            if (isNew())
3918            {
3919               collPaymentItems = new ArrayList JavaDoc();
3920            }
3921            else
3922            {
3923                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3924                              collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
3925            }
3926        }
3927        else
3928        {
3929            // the following code is to determine if a new query is
3930
// called for. If the criteria is the same as the last
3931
// one, just return the collection.
3932

3933                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3934                                    if (!lastPaymentItemsCriteria.equals(criteria))
3935            {
3936                collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
3937            }
3938        }
3939        lastPaymentItemsCriteria = criteria;
3940
3941        return collPaymentItems;
3942                }
3943                  
3944                    
3945                    
3946                                
3947                                                              
3948                                        
3949                    
3950                    
3951          
3952    /**
3953     * If this collection has already been initialized with
3954     * an identical criteria, it returns the collection.
3955     * Otherwise if this Sorder is new, it will return
3956     * an empty collection; or if this Sorder has previously
3957     * been saved, it will retrieve related PaymentItems from storage.
3958     *
3959     * This method is protected by default in order to keep the public
3960     * api reasonable. You can provide public methods for those you
3961     * actually need in Sorder.
3962     */

3963    protected List JavaDoc getPaymentItemsJoinCurrency(Criteria criteria)
3964        throws TorqueException
3965    {
3966                    if (collPaymentItems == null)
3967        {
3968            if (isNew())
3969            {
3970               collPaymentItems = new ArrayList JavaDoc();
3971            }
3972            else
3973            {
3974                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3975                              collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
3976            }
3977        }
3978        else
3979        {
3980            // the following code is to determine if a new query is
3981
// called for. If the criteria is the same as the last
3982
// one, just return the collection.
3983

3984                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
3985                                    if (!lastPaymentItemsCriteria.equals(criteria))
3986            {
3987                collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
3988            }
3989        }
3990        lastPaymentItemsCriteria = criteria;
3991
3992        return collPaymentItems;
3993                }
3994                  
3995                    
3996                    
3997                                
3998                                                              
3999                                        
4000                    
4001                    
4002          
4003    /**
4004     * If this collection has already been initialized with
4005     * an identical criteria, it returns the collection.
4006     * Otherwise if this Sorder is new, it will return
4007     * an empty collection; or if this Sorder has previously
4008     * been saved, it will retrieve related PaymentItems from storage.
4009     *
4010     * This method is protected by default in order to keep the public
4011     * api reasonable. You can provide public methods for those you
4012     * actually need in Sorder.
4013     */

4014    protected List JavaDoc getPaymentItemsJoinCustomer(Criteria criteria)
4015        throws TorqueException
4016    {
4017                    if (collPaymentItems == null)
4018        {
4019            if (isNew())
4020            {
4021               collPaymentItems = new ArrayList JavaDoc();
4022            }
4023            else
4024            {
4025                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
4026                              collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
4027            }
4028        }
4029        else
4030        {
4031            // the following code is to determine if a new query is
4032
// called for. If the criteria is the same as the last
4033
// one, just return the collection.
4034

4035                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
4036                                    if (!lastPaymentItemsCriteria.equals(criteria))
4037            {
4038                collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
4039            }
4040        }
4041        lastPaymentItemsCriteria = criteria;
4042
4043        return collPaymentItems;
4044                }
4045                  
4046                    
4047                    
4048                                
4049                                                              
4050                                        
4051                    
4052                    
4053          
4054    /**
4055     * If this collection has already been initialized with
4056     * an identical criteria, it returns the collection.
4057     * Otherwise if this Sorder is new, it will return
4058     * an empty collection; or if this Sorder has previously
4059     * been saved, it will retrieve related PaymentItems from storage.
4060     *
4061     * This method is protected by default in order to keep the public
4062     * api reasonable. You can provide public methods for those you
4063     * actually need in Sorder.
4064     */

4065    protected List JavaDoc getPaymentItemsJoinProject(Criteria criteria)
4066        throws TorqueException
4067    {
4068                    if (collPaymentItems == null)
4069        {
4070            if (isNew())
4071            {
4072               collPaymentItems = new ArrayList JavaDoc();
4073            }
4074            else
4075            {
4076                              criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
4077                              collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
4078            }
4079        }
4080        else
4081        {
4082            // the following code is to determine if a new query is
4083
// called for. If the criteria is the same as the last
4084
// one, just return the collection.
4085

4086                        criteria.add(PaymentItemPeer.SORDER_ID, getSorderId());
4087                                    if (!lastPaymentItemsCriteria.equals(criteria))
4088            {
4089                collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
4090            }
4091        }
4092        lastPaymentItemsCriteria = criteria;
4093
4094        return collPaymentItems;
4095                }
4096                            
4097
4098
4099                          
4100            
4101          /**
4102     * Collection to store aggregation of collShipmentItems
4103     */

4104    protected List JavaDoc collShipmentItems;
4105
4106    /**
4107     * Temporary storage of collShipmentItems to save a possible db hit in
4108     * the event objects are add to the collection, but the
4109     * complete collection is never requested.
4110     */

4111    protected void initShipmentItems()
4112    {
4113        if (collShipmentItems == null)
4114        {
4115            collShipmentItems = new ArrayList JavaDoc();
4116        }
4117    }
4118
4119    /**
4120     * Method called to associate a ShipmentItem object to this object
4121     * through the ShipmentItem foreign key attribute
4122     *
4123     * @param l ShipmentItem
4124     * @throws TorqueException
4125     */

4126    public void addShipmentItem(ShipmentItem l) throws TorqueException
4127    {
4128        getShipmentItems().add(l);
4129        l.setSorder((Sorder) this);
4130    }
4131
4132    /**
4133     * The criteria used to select the current contents of collShipmentItems
4134     */

4135    private Criteria lastShipmentItemsCriteria = null;
4136      
4137    /**
4138     * If this collection has already been initialized, returns
4139     * the collection. Otherwise returns the results of
4140     * getShipmentItems(new Criteria())
4141     *
4142     * @throws TorqueException
4143     */

4144    public List JavaDoc getShipmentItems() throws TorqueException
4145    {
4146              if (collShipmentItems == null)
4147        {
4148            collShipmentItems = getShipmentItems(new Criteria(10));
4149        }
4150        return collShipmentItems;
4151          }
4152
4153    /**
4154     * If this collection has already been initialized with
4155     * an identical criteria, it returns the collection.
4156     * Otherwise if this Sorder has previously
4157     * been saved, it will retrieve related ShipmentItems from storage.
4158     * If this Sorder is new, it will return
4159     * an empty collection or the current collection, the criteria
4160     * is ignored on a new object.
4161     *
4162     * @throws TorqueException
4163     */

4164    public List JavaDoc getShipmentItems(Criteria criteria) throws TorqueException
4165    {
4166              if (collShipmentItems == null)
4167        {
4168            if (isNew())
4169            {
4170               collShipmentItems = new ArrayList JavaDoc();
4171            }
4172            else
4173            {
4174                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId() );
4175                        collShipmentItems = ShipmentItemPeer.doSelect(criteria);
4176            }
4177        }
4178        else
4179        {
4180            // criteria has no effect for a new object
4181
if (!isNew())
4182            {
4183                // the following code is to determine if a new query is
4184
// called for. If the criteria is the same as the last
4185
// one, just return the collection.
4186
criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4187                            if (!lastShipmentItemsCriteria.equals(criteria))
4188                {
4189                    collShipmentItems = ShipmentItemPeer.doSelect(criteria);
4190                }
4191            }
4192        }
4193        lastShipmentItemsCriteria = criteria;
4194
4195        return collShipmentItems;
4196          }
4197
4198    /**
4199     * If this collection has already been initialized, returns
4200     * the collection. Otherwise returns the results of
4201     * getShipmentItems(new Criteria(),Connection)
4202     * This method takes in the Connection also as input so that
4203     * referenced objects can also be obtained using a Connection
4204     * that is taken as input
4205     */

4206    public List JavaDoc getShipmentItems(Connection JavaDoc con) throws TorqueException
4207    {
4208              if (collShipmentItems == null)
4209        {
4210            collShipmentItems = getShipmentItems(new Criteria(10), con);
4211        }
4212        return collShipmentItems;
4213          }
4214
4215    /**
4216     * If this collection has already been initialized with
4217     * an identical criteria, it returns the collection.
4218     * Otherwise if this Sorder has previously
4219     * been saved, it will retrieve related ShipmentItems from storage.
4220     * If this Sorder is new, it will return
4221     * an empty collection or the current collection, the criteria
4222     * is ignored on a new object.
4223     * This method takes in the Connection also as input so that
4224     * referenced objects can also be obtained using a Connection
4225     * that is taken as input
4226     */

4227    public List JavaDoc getShipmentItems(Criteria criteria, Connection JavaDoc con)
4228            throws TorqueException
4229    {
4230              if (collShipmentItems == null)
4231        {
4232            if (isNew())
4233            {
4234               collShipmentItems = new ArrayList JavaDoc();
4235            }
4236            else
4237            {
4238                         criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4239                         collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
4240             }
4241         }
4242         else
4243         {
4244             // criteria has no effect for a new object
4245
if (!isNew())
4246             {
4247                 // the following code is to determine if a new query is
4248
// called for. If the criteria is the same as the last
4249
// one, just return the collection.
4250
criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4251                             if (!lastShipmentItemsCriteria.equals(criteria))
4252                 {
4253                     collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
4254                 }
4255             }
4256         }
4257         lastShipmentItemsCriteria = criteria;
4258
4259         return collShipmentItems;
4260           }
4261
4262                                                
4263              
4264                    
4265                    
4266                                
4267                                                              
4268                                        
4269                    
4270                    
4271          
4272    /**
4273     * If this collection has already been initialized with
4274     * an identical criteria, it returns the collection.
4275     * Otherwise if this Sorder is new, it will return
4276     * an empty collection; or if this Sorder has previously
4277     * been saved, it will retrieve related ShipmentItems from storage.
4278     *
4279     * This method is protected by default in order to keep the public
4280     * api reasonable. You can provide public methods for those you
4281     * actually need in Sorder.
4282     */

4283    protected List JavaDoc getShipmentItemsJoinShipment(Criteria criteria)
4284        throws TorqueException
4285    {
4286                    if (collShipmentItems == null)
4287        {
4288            if (isNew())
4289            {
4290               collShipmentItems = new ArrayList JavaDoc();
4291            }
4292            else
4293            {
4294                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4295                              collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
4296            }
4297        }
4298        else
4299        {
4300            // the following code is to determine if a new query is
4301
// called for. If the criteria is the same as the last
4302
// one, just return the collection.
4303

4304                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4305                                    if (!lastShipmentItemsCriteria.equals(criteria))
4306            {
4307                collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
4308            }
4309        }
4310        lastShipmentItemsCriteria = criteria;
4311
4312        return collShipmentItems;
4313                }
4314                  
4315                    
4316                              
4317                                
4318                                                              
4319                                        
4320                    
4321                    
4322          
4323    /**
4324     * If this collection has already been initialized with
4325     * an identical criteria, it returns the collection.
4326     * Otherwise if this Sorder is new, it will return
4327     * an empty collection; or if this Sorder has previously
4328     * been saved, it will retrieve related ShipmentItems from storage.
4329     *
4330     * This method is protected by default in order to keep the public
4331     * api reasonable. You can provide public methods for those you
4332     * actually need in Sorder.
4333     */

4334    protected List JavaDoc getShipmentItemsJoinSorder(Criteria criteria)
4335        throws TorqueException
4336    {
4337                    if (collShipmentItems == null)
4338        {
4339            if (isNew())
4340            {
4341               collShipmentItems = new ArrayList JavaDoc();
4342            }
4343            else
4344            {
4345                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4346                              collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
4347            }
4348        }
4349        else
4350        {
4351            // the following code is to determine if a new query is
4352
// called for. If the criteria is the same as the last
4353
// one, just return the collection.
4354

4355                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4356                                    if (!lastShipmentItemsCriteria.equals(criteria))
4357            {
4358                collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
4359            }
4360        }
4361        lastShipmentItemsCriteria = criteria;
4362
4363        return collShipmentItems;
4364                }
4365                  
4366                    
4367                    
4368                                
4369                                                              
4370                                        
4371                    
4372                    
4373          
4374    /**
4375     * If this collection has already been initialized with
4376     * an identical criteria, it returns the collection.
4377     * Otherwise if this Sorder is new, it will return
4378     * an empty collection; or if this Sorder has previously
4379     * been saved, it will retrieve related ShipmentItems from storage.
4380     *
4381     * This method is protected by default in order to keep the public
4382     * api reasonable. You can provide public methods for those you
4383     * actually need in Sorder.
4384     */

4385    protected List JavaDoc getShipmentItemsJoinProduct(Criteria criteria)
4386        throws TorqueException
4387    {
4388                    if (collShipmentItems == null)
4389        {
4390            if (isNew())
4391            {
4392               collShipmentItems = new ArrayList JavaDoc();
4393            }
4394            else
4395            {
4396                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4397                              collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
4398            }
4399        }
4400        else
4401        {
4402            // the following code is to determine if a new query is
4403
// called for. If the criteria is the same as the last
4404
// one, just return the collection.
4405

4406                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4407                                    if (!lastShipmentItemsCriteria.equals(criteria))
4408            {
4409                collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
4410            }
4411        }
4412        lastShipmentItemsCriteria = criteria;
4413
4414        return collShipmentItems;
4415                }
4416                  
4417                    
4418                    
4419                                            
4420                                                                          
4421                                        
4422                    
4423                    
4424          
4425    /**
4426     * If this collection has already been initialized with
4427     * an identical criteria, it returns the collection.
4428     * Otherwise if this Sorder is new, it will return
4429     * an empty collection; or if this Sorder has previously
4430     * been saved, it will retrieve related ShipmentItems from storage.
4431     *
4432     * This method is protected by default in order to keep the public
4433     * api reasonable. You can provide public methods for those you
4434     * actually need in Sorder.
4435     */

4436    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
4437        throws TorqueException
4438    {
4439                    if (collShipmentItems == null)
4440        {
4441            if (isNew())
4442            {
4443               collShipmentItems = new ArrayList JavaDoc();
4444            }
4445            else
4446            {
4447                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4448                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4449            }
4450        }
4451        else
4452        {
4453            // the following code is to determine if a new query is
4454
// called for. If the criteria is the same as the last
4455
// one, just return the collection.
4456

4457                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4458                                    if (!lastShipmentItemsCriteria.equals(criteria))
4459            {
4460                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4461            }
4462        }
4463        lastShipmentItemsCriteria = criteria;
4464
4465        return collShipmentItems;
4466                }
4467                  
4468                    
4469                    
4470                                            
4471                                                                          
4472                                        
4473                    
4474                    
4475          
4476    /**
4477     * If this collection has already been initialized with
4478     * an identical criteria, it returns the collection.
4479     * Otherwise if this Sorder is new, it will return
4480     * an empty collection; or if this Sorder has previously
4481     * been saved, it will retrieve related ShipmentItems from storage.
4482     *
4483     * This method is protected by default in order to keep the public
4484     * api reasonable. You can provide public methods for those you
4485     * actually need in Sorder.
4486     */

4487    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
4488        throws TorqueException
4489    {
4490                    if (collShipmentItems == null)
4491        {
4492            if (isNew())
4493            {
4494               collShipmentItems = new ArrayList JavaDoc();
4495            }
4496            else
4497            {
4498                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4499                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4500            }
4501        }
4502        else
4503        {
4504            // the following code is to determine if a new query is
4505
// called for. If the criteria is the same as the last
4506
// one, just return the collection.
4507

4508                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4509                                    if (!lastShipmentItemsCriteria.equals(criteria))
4510            {
4511                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4512            }
4513        }
4514        lastShipmentItemsCriteria = criteria;
4515
4516        return collShipmentItems;
4517                }
4518                  
4519                    
4520                    
4521                                
4522                                                              
4523                                        
4524                    
4525                    
4526          
4527    /**
4528     * If this collection has already been initialized with
4529     * an identical criteria, it returns the collection.
4530     * Otherwise if this Sorder is new, it will return
4531     * an empty collection; or if this Sorder has previously
4532     * been saved, it will retrieve related ShipmentItems from storage.
4533     *
4534     * This method is protected by default in order to keep the public
4535     * api reasonable. You can provide public methods for those you
4536     * actually need in Sorder.
4537     */

4538    protected List JavaDoc getShipmentItemsJoinProject(Criteria criteria)
4539        throws TorqueException
4540    {
4541                    if (collShipmentItems == null)
4542        {
4543            if (isNew())
4544            {
4545               collShipmentItems = new ArrayList JavaDoc();
4546            }
4547            else
4548            {
4549                              criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4550                              collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
4551            }
4552        }
4553        else
4554        {
4555            // the following code is to determine if a new query is
4556
// called for. If the criteria is the same as the last
4557
// one, just return the collection.
4558

4559                        criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId());
4560                                    if (!lastShipmentItemsCriteria.equals(criteria))
4561            {
4562                collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
4563            }
4564        }
4565        lastShipmentItemsCriteria = criteria;
4566
4567        return collShipmentItems;
4568                }
4569                            
4570
4571
4572                          
4573            
4574          /**
4575     * Collection to store aggregation of collServiceItems
4576     */

4577    protected List JavaDoc collServiceItems;
4578
4579    /**
4580     * Temporary storage of collServiceItems to save a possible db hit in
4581     * the event objects are add to the collection, but the
4582     * complete collection is never requested.
4583     */

4584    protected void initServiceItems()
4585    {
4586        if (collServiceItems == null)
4587        {
4588            collServiceItems = new ArrayList JavaDoc();
4589        }
4590    }
4591
4592    /**
4593     * Method called to associate a ServiceItem object to this object
4594     * through the ServiceItem foreign key attribute
4595     *
4596     * @param l ServiceItem
4597     * @throws TorqueException
4598     */

4599    public void addServiceItem(ServiceItem l) throws TorqueException
4600    {
4601        getServiceItems().add(l);
4602        l.setSorder((Sorder) this);
4603    }
4604
4605    /**
4606     * The criteria used to select the current contents of collServiceItems
4607     */

4608    private Criteria lastServiceItemsCriteria = null;
4609      
4610    /**
4611     * If this collection has already been initialized, returns
4612     * the collection. Otherwise returns the results of
4613     * getServiceItems(new Criteria())
4614     *
4615     * @throws TorqueException
4616     */

4617    public List JavaDoc getServiceItems() throws TorqueException
4618    {
4619              if (collServiceItems == null)
4620        {
4621            collServiceItems = getServiceItems(new Criteria(10));
4622        }
4623        return collServiceItems;
4624          }
4625
4626    /**
4627     * If this collection has already been initialized with
4628     * an identical criteria, it returns the collection.
4629     * Otherwise if this Sorder has previously
4630     * been saved, it will retrieve related ServiceItems from storage.
4631     * If this Sorder is new, it will return
4632     * an empty collection or the current collection, the criteria
4633     * is ignored on a new object.
4634     *
4635     * @throws TorqueException
4636     */

4637    public List JavaDoc getServiceItems(Criteria criteria) throws TorqueException
4638    {
4639              if (collServiceItems == null)
4640        {
4641            if (isNew())
4642            {
4643               collServiceItems = new ArrayList JavaDoc();
4644            }
4645            else
4646            {
4647                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId() );
4648                        collServiceItems = ServiceItemPeer.doSelect(criteria);
4649            }
4650        }
4651        else
4652        {
4653            // criteria has no effect for a new object
4654
if (!isNew())
4655            {
4656                // the following code is to determine if a new query is
4657
// called for. If the criteria is the same as the last
4658
// one, just return the collection.
4659
criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4660                            if (!lastServiceItemsCriteria.equals(criteria))
4661                {
4662                    collServiceItems = ServiceItemPeer.doSelect(criteria);
4663                }
4664            }
4665        }
4666        lastServiceItemsCriteria = criteria;
4667
4668        return collServiceItems;
4669          }
4670
4671    /**
4672     * If this collection has already been initialized, returns
4673     * the collection. Otherwise returns the results of
4674     * getServiceItems(new Criteria(),Connection)
4675     * This method takes in the Connection also as input so that
4676     * referenced objects can also be obtained using a Connection
4677     * that is taken as input
4678     */

4679    public List JavaDoc getServiceItems(Connection JavaDoc con) throws TorqueException
4680    {
4681              if (collServiceItems == null)
4682        {
4683            collServiceItems = getServiceItems(new Criteria(10), con);
4684        }
4685        return collServiceItems;
4686          }
4687
4688    /**
4689     * If this collection has already been initialized with
4690     * an identical criteria, it returns the collection.
4691     * Otherwise if this Sorder has previously
4692     * been saved, it will retrieve related ServiceItems from storage.
4693     * If this Sorder is new, it will return
4694     * an empty collection or the current collection, the criteria
4695     * is ignored on a new object.
4696     * This method takes in the Connection also as input so that
4697     * referenced objects can also be obtained using a Connection
4698     * that is taken as input
4699     */

4700    public List JavaDoc getServiceItems(Criteria criteria, Connection JavaDoc con)
4701            throws TorqueException
4702    {
4703              if (collServiceItems == null)
4704        {
4705            if (isNew())
4706            {
4707               collServiceItems = new ArrayList JavaDoc();
4708            }
4709            else
4710            {
4711                         criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4712                         collServiceItems = ServiceItemPeer.doSelect(criteria, con);
4713             }
4714         }
4715         else
4716         {
4717             // criteria has no effect for a new object
4718
if (!isNew())
4719             {
4720                 // the following code is to determine if a new query is
4721
// called for. If the criteria is the same as the last
4722
// one, just return the collection.
4723
criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4724                             if (!lastServiceItemsCriteria.equals(criteria))
4725                 {
4726                     collServiceItems = ServiceItemPeer.doSelect(criteria, con);
4727                 }
4728             }
4729         }
4730         lastServiceItemsCriteria = criteria;
4731
4732         return collServiceItems;
4733           }
4734
4735                                                
4736              
4737                    
4738                    
4739                                
4740                                                              
4741                                        
4742                    
4743                    
4744          
4745    /**
4746     * If this collection has already been initialized with
4747     * an identical criteria, it returns the collection.
4748     * Otherwise if this Sorder is new, it will return
4749     * an empty collection; or if this Sorder has previously
4750     * been saved, it will retrieve related ServiceItems from storage.
4751     *
4752     * This method is protected by default in order to keep the public
4753     * api reasonable. You can provide public methods for those you
4754     * actually need in Sorder.
4755     */

4756    protected List JavaDoc getServiceItemsJoinService(Criteria criteria)
4757        throws TorqueException
4758    {
4759                    if (collServiceItems == null)
4760        {
4761            if (isNew())
4762            {
4763               collServiceItems = new ArrayList JavaDoc();
4764            }
4765            else
4766            {
4767                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4768                              collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
4769            }
4770        }
4771        else
4772        {
4773            // the following code is to determine if a new query is
4774
// called for. If the criteria is the same as the last
4775
// one, just return the collection.
4776

4777                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4778                                    if (!lastServiceItemsCriteria.equals(criteria))
4779            {
4780                collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
4781            }
4782        }
4783        lastServiceItemsCriteria = criteria;
4784
4785        return collServiceItems;
4786                }
4787                  
4788                    
4789                              
4790                                
4791                                                              
4792                                        
4793                    
4794                    
4795          
4796    /**
4797     * If this collection has already been initialized with
4798     * an identical criteria, it returns the collection.
4799     * Otherwise if this Sorder is new, it will return
4800     * an empty collection; or if this Sorder has previously
4801     * been saved, it will retrieve related ServiceItems from storage.
4802     *
4803     * This method is protected by default in order to keep the public
4804     * api reasonable. You can provide public methods for those you
4805     * actually need in Sorder.
4806     */

4807    protected List JavaDoc getServiceItemsJoinSorder(Criteria criteria)
4808        throws TorqueException
4809    {
4810                    if (collServiceItems == null)
4811        {
4812            if (isNew())
4813            {
4814               collServiceItems = new ArrayList JavaDoc();
4815            }
4816            else
4817            {
4818                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4819                              collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
4820            }
4821        }
4822        else
4823        {
4824            // the following code is to determine if a new query is
4825
// called for. If the criteria is the same as the last
4826
// one, just return the collection.
4827

4828                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4829                                    if (!lastServiceItemsCriteria.equals(criteria))
4830            {
4831                collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
4832            }
4833        }
4834        lastServiceItemsCriteria = criteria;
4835
4836        return collServiceItems;
4837                }
4838                  
4839                    
4840                    
4841                                
4842                                                              
4843                                        
4844                    
4845                    
4846          
4847    /**
4848     * If this collection has already been initialized with
4849     * an identical criteria, it returns the collection.
4850     * Otherwise if this Sorder is new, it will return
4851     * an empty collection; or if this Sorder has previously
4852     * been saved, it will retrieve related ServiceItems from storage.
4853     *
4854     * This method is protected by default in order to keep the public
4855     * api reasonable. You can provide public methods for those you
4856     * actually need in Sorder.
4857     */

4858    protected List JavaDoc getServiceItemsJoinProduct(Criteria criteria)
4859        throws TorqueException
4860    {
4861                    if (collServiceItems == null)
4862        {
4863            if (isNew())
4864            {
4865               collServiceItems = new ArrayList JavaDoc();
4866            }
4867            else
4868            {
4869                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4870                              collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
4871            }
4872        }
4873        else
4874        {
4875            // the following code is to determine if a new query is
4876
// called for. If the criteria is the same as the last
4877
// one, just return the collection.
4878

4879                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4880                                    if (!lastServiceItemsCriteria.equals(criteria))
4881            {
4882                collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
4883            }
4884        }
4885        lastServiceItemsCriteria = criteria;
4886
4887        return collServiceItems;
4888                }
4889                  
4890                    
4891                    
4892                                            
4893                                                                          
4894                                        
4895                    
4896                    
4897          
4898    /**
4899     * If this collection has already been initialized with
4900     * an identical criteria, it returns the collection.
4901     * Otherwise if this Sorder is new, it will return
4902     * an empty collection; or if this Sorder has previously
4903     * been saved, it will retrieve related ServiceItems from storage.
4904     *
4905     * This method is protected by default in order to keep the public
4906     * api reasonable. You can provide public methods for those you
4907     * actually need in Sorder.
4908     */

4909    protected List JavaDoc getServiceItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
4910        throws TorqueException
4911    {
4912                    if (collServiceItems == null)
4913        {
4914            if (isNew())
4915            {
4916               collServiceItems = new ArrayList JavaDoc();
4917            }
4918            else
4919            {
4920                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4921                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4922            }
4923        }
4924        else
4925        {
4926            // the following code is to determine if a new query is
4927
// called for. If the criteria is the same as the last
4928
// one, just return the collection.
4929

4930                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4931                                    if (!lastServiceItemsCriteria.equals(criteria))
4932            {
4933                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4934            }
4935        }
4936        lastServiceItemsCriteria = criteria;
4937
4938        return collServiceItems;
4939                }
4940                  
4941                    
4942                    
4943                                            
4944                                                                          
4945                                        
4946                    
4947                    
4948          
4949    /**
4950     * If this collection has already been initialized with
4951     * an identical criteria, it returns the collection.
4952     * Otherwise if this Sorder is new, it will return
4953     * an empty collection; or if this Sorder has previously
4954     * been saved, it will retrieve related ServiceItems from storage.
4955     *
4956     * This method is protected by default in order to keep the public
4957     * api reasonable. You can provide public methods for those you
4958     * actually need in Sorder.
4959     */

4960    protected List JavaDoc getServiceItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
4961        throws TorqueException
4962    {
4963                    if (collServiceItems == null)
4964        {
4965            if (isNew())
4966            {
4967               collServiceItems = new ArrayList JavaDoc();
4968            }
4969            else
4970            {
4971                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4972                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4973            }
4974        }
4975        else
4976        {
4977            // the following code is to determine if a new query is
4978
// called for. If the criteria is the same as the last
4979
// one, just return the collection.
4980

4981                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
4982                                    if (!lastServiceItemsCriteria.equals(criteria))
4983            {
4984                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4985            }
4986        }
4987        lastServiceItemsCriteria = criteria;
4988
4989        return collServiceItems;
4990                }
4991                  
4992                    
4993                    
4994                                
4995                                                              
4996                                        
4997                    
4998                    
4999          
5000    /**
5001     * If this collection has already been initialized with
5002     * an identical criteria, it returns the collection.
5003     * Otherwise if this Sorder is new, it will return
5004     * an empty collection; or if this Sorder has previously
5005     * been saved, it will retrieve related ServiceItems from storage.
5006     *
5007     * This method is protected by default in order to keep the public
5008     * api reasonable. You can provide public methods for those you
5009     * actually need in Sorder.
5010     */

5011    protected List JavaDoc getServiceItemsJoinProject(Criteria criteria)
5012        throws TorqueException
5013    {
5014                    if (collServiceItems == null)
5015        {
5016            if (isNew())
5017            {
5018               collServiceItems = new ArrayList JavaDoc();
5019            }
5020            else
5021            {
5022                              criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
5023                              collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
5024            }
5025        }
5026        else
5027        {
5028            // the following code is to determine if a new query is
5029
// called for. If the criteria is the same as the last
5030
// one, just return the collection.
5031

5032                        criteria.add(ServiceItemPeer.SORDER_ID, getSorderId());
5033                                    if (!lastServiceItemsCriteria.equals(criteria))
5034            {
5035                collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
5036            }
5037        }
5038        lastServiceItemsCriteria = criteria;
5039
5040        return collServiceItems;
5041                }
5042                            
5043
5044
5045          
5046    private static List JavaDoc fieldNames = null;
5047
5048    /**
5049     * Generate a list of field names.
5050     *
5051     * @return a list of field names
5052     */

5053    public static synchronized List JavaDoc getFieldNames()
5054    {
5055        if (fieldNames == null)
5056        {
5057            fieldNames = new ArrayList JavaDoc();
5058              fieldNames.add("SorderId");
5059              fieldNames.add("SorderCode");
5060              fieldNames.add("Status");
5061              fieldNames.add("Priority");
5062              fieldNames.add("IssuedDate");
5063              fieldNames.add("ClosedDate");
5064              fieldNames.add("CustomerId");
5065              fieldNames.add("RecipientId");
5066              fieldNames.add("ProjectId");
5067              fieldNames.add("CarrierId");
5068              fieldNames.add("PayTerm");
5069              fieldNames.add("PayMethod");
5070              fieldNames.add("CurrencyId");
5071              fieldNames.add("CurrencyAmount");
5072              fieldNames.add("Subject");
5073              fieldNames.add("Notes");
5074              fieldNames.add("Created");
5075              fieldNames.add("Modified");
5076              fieldNames.add("CreatedBy");
5077              fieldNames.add("ModifiedBy");
5078              fieldNames = Collections.unmodifiableList(fieldNames);
5079        }
5080        return fieldNames;
5081    }
5082
5083    /**
5084     * Retrieves a field from the object by name passed in as a String.
5085     *
5086     * @param name field name
5087     * @return value
5088     */

5089    public Object JavaDoc getByName(String JavaDoc name)
5090    {
5091          if (name.equals("SorderId"))
5092        {
5093                return new Integer JavaDoc(getSorderId());
5094            }
5095          if (name.equals("SorderCode"))
5096        {
5097                return getSorderCode();
5098            }
5099          if (name.equals("Status"))
5100        {
5101                return new Integer JavaDoc(getStatus());
5102            }
5103          if (name.equals("Priority"))
5104        {
5105                return new Integer JavaDoc(getPriority());
5106            }
5107          if (name.equals("IssuedDate"))
5108        {
5109                return getIssuedDate();
5110            }
5111          if (name.equals("ClosedDate"))
5112        {
5113                return getClosedDate();
5114            }
5115          if (name.equals("CustomerId"))
5116        {
5117                return new Integer JavaDoc(getCustomerId());
5118            }
5119          if (name.equals("RecipientId"))
5120        {
5121                return new Integer JavaDoc(getRecipientId());
5122            }
5123          if (name.equals("ProjectId"))
5124        {
5125                return new Integer JavaDoc(getProjectId());
5126            }
5127          if (name.equals("CarrierId"))
5128        {
5129                return new Integer JavaDoc(getCarrierId());
5130            }
5131          if (name.equals("PayTerm"))
5132        {
5133                return new Integer JavaDoc(getPayTerm());
5134            }
5135          if (name.equals("PayMethod"))
5136        {
5137                return new Integer JavaDoc(getPayMethod());
5138            }
5139          if (name.equals("CurrencyId"))
5140        {
5141                return new Integer JavaDoc(getCurrencyId());
5142            }
5143          if (name.equals("CurrencyAmount"))
5144        {
5145                return getCurrencyAmount();
5146            }
5147          if (name.equals("Subject"))
5148        {
5149                return getSubject();
5150            }
5151          if (name.equals("Notes"))
5152        {
5153                return getNotes();
5154            }
5155          if (name.equals("Created"))
5156        {
5157                return getCreated();
5158            }
5159          if (name.equals("Modified"))
5160        {
5161                return getModified();
5162            }
5163          if (name.equals("CreatedBy"))
5164        {
5165                return getCreatedBy();
5166            }
5167          if (name.equals("ModifiedBy"))
5168        {
5169                return getModifiedBy();
5170            }
5171          return null;
5172    }
5173    
5174    /**
5175     * Retrieves a field from the object by name passed in
5176     * as a String. The String must be one of the static
5177     * Strings defined in this Class' Peer.
5178     *
5179     * @param name peer name
5180     * @return value
5181     */

5182    public Object JavaDoc getByPeerName(String JavaDoc name)
5183    {
5184          if (name.equals(SorderPeer.SORDER_ID))
5185        {
5186                return new Integer JavaDoc(getSorderId());
5187            }
5188          if (name.equals(SorderPeer.SORDER_CODE))
5189        {
5190                return getSorderCode();
5191            }
5192          if (name.equals(SorderPeer.STATUS))
5193        {
5194                return new Integer JavaDoc(getStatus());
5195            }
5196          if (name.equals(SorderPeer.PRIORITY))
5197        {
5198                return new Integer JavaDoc(getPriority());
5199            }
5200          if (name.equals(SorderPeer.ISSUED_DATE))
5201        {
5202                return getIssuedDate();
5203            }
5204          if (name.equals(SorderPeer.CLOSED_DATE))
5205        {
5206                return getClosedDate();
5207            }
5208          if (name.equals(SorderPeer.CUSTOMER_ID))
5209        {
5210                return new Integer JavaDoc(getCustomerId());
5211            }
5212          if (name.equals(SorderPeer.RECIPIENT_ID))
5213        {
5214                return new Integer JavaDoc(getRecipientId());
5215            }
5216          if (name.equals(SorderPeer.PROJECT_ID))
5217        {
5218                return new Integer JavaDoc(getProjectId());
5219            }
5220          if (name.equals(SorderPeer.CARRIER_ID))
5221        {
5222                return new Integer JavaDoc(getCarrierId());
5223            }
5224          if (name.equals(SorderPeer.PAY_TERM))
5225        {
5226                return new Integer JavaDoc(getPayTerm());
5227            }
5228          if (name.equals(SorderPeer.PAY_METHOD))
5229        {
5230                return new Integer JavaDoc(getPayMethod());
5231            }
5232          if (name.equals(SorderPeer.CURRENCY_ID))
5233        {
5234                return new Integer JavaDoc(getCurrencyId());
5235            }
5236          if (name.equals(SorderPeer.CURRENCY_AMOUNT))
5237        {
5238                return getCurrencyAmount();
5239            }
5240          if (name.equals(SorderPeer.SUBJECT))
5241        {
5242                return getSubject();
5243            }
5244          if (name.equals(SorderPeer.NOTES))
5245        {
5246                return getNotes();
5247            }
5248          if (name.equals(SorderPeer.CREATED))
5249        {
5250                return getCreated();
5251            }
5252          if (name.equals(SorderPeer.MODIFIED))
5253        {
5254                return getModified();
5255            }
5256          if (name.equals(SorderPeer.CREATED_BY))
5257        {
5258                return getCreatedBy();
5259            }
5260          if (name.equals(SorderPeer.MODIFIED_BY))
5261        {
5262                return getModifiedBy();
5263            }
5264          return null;
5265    }
5266
5267    /**
5268     * Retrieves a field from the object by Position as specified
5269     * in the xml schema. Zero-based.
5270     *
5271     * @param pos position in xml schema
5272     * @return value
5273     */

5274    public Object JavaDoc getByPosition(int pos)
5275    {
5276            if (pos == 0)
5277        {
5278                return new Integer JavaDoc(getSorderId());
5279            }
5280              if (pos == 1)
5281        {
5282                return getSorderCode();
5283            }
5284              if (pos == 2)
5285        {
5286                return new Integer JavaDoc(getStatus());
5287            }
5288              if (pos == 3)
5289        {
5290                return new Integer JavaDoc(getPriority());
5291            }
5292              if (pos == 4)
5293        {
5294                return getIssuedDate();
5295            }
5296              if (pos == 5)
5297        {
5298                return getClosedDate();
5299            }
5300              if (pos == 6)
5301        {
5302                return new Integer JavaDoc(getCustomerId());
5303            }
5304              if (pos == 7)
5305        {
5306                return new Integer JavaDoc(getRecipientId());
5307            }
5308              if (pos == 8)
5309        {
5310                return new Integer JavaDoc(getProjectId());
5311            }
5312              if (pos == 9)
5313        {
5314                return new Integer JavaDoc(getCarrierId());
5315            }
5316              if (pos == 10)
5317        {
5318                return new Integer JavaDoc(getPayTerm());
5319            }
5320              if (pos == 11)
5321        {
5322                return new Integer JavaDoc(getPayMethod());
5323            }
5324              if (pos == 12)
5325        {
5326                return new Integer JavaDoc(getCurrencyId());
5327            }
5328              if (pos == 13)
5329        {
5330                return getCurrencyAmount();
5331            }
5332              if (pos == 14)
5333        {
5334                return getSubject();
5335            }
5336              if (pos == 15)
5337        {
5338                return getNotes();
5339            }
5340              if (pos == 16)
5341        {
5342                return getCreated();
5343            }
5344              if (pos == 17)
5345        {
5346                return getModified();
5347            }
5348              if (pos == 18)
5349        {
5350                return getCreatedBy();
5351            }
5352              if (pos == 19)
5353        {
5354                return getModifiedBy();
5355            }
5356              return null;
5357    }
5358     
5359    /**
5360     * Stores the object in the database. If the object is new,
5361     * it inserts it; otherwise an update is performed.
5362     *
5363     * @throws Exception
5364     */

5365    public void save() throws Exception JavaDoc
5366    {
5367          save(SorderPeer.getMapBuilder()
5368                .getDatabaseMap().getName());
5369      }
5370
5371    /**
5372     * Stores the object in the database. If the object is new,
5373     * it inserts it; otherwise an update is performed.
5374       * Note: this code is here because the method body is
5375     * auto-generated conditionally and therefore needs to be
5376     * in this file instead of in the super class, BaseObject.
5377       *
5378     * @param dbName
5379     * @throws TorqueException
5380     */

5381    public void save(String JavaDoc dbName) throws TorqueException
5382    {
5383        Connection JavaDoc con = null;
5384          try
5385        {
5386            con = Transaction.begin(dbName);
5387            save(con);
5388            Transaction.commit(con);
5389        }
5390        catch(TorqueException e)
5391        {
5392            Transaction.safeRollback(con);
5393            throw e;
5394        }
5395      }
5396
5397      /** flag to prevent endless save loop, if this object is referenced
5398        by another object which falls in this transaction. */

5399    private boolean alreadyInSave = false;
5400      /**
5401     * Stores the object in the database. If the object is new,
5402     * it inserts it; otherwise an update is performed. This method
5403     * is meant to be used as part of a transaction, otherwise use
5404     * the save() method and the connection details will be handled
5405     * internally
5406     *
5407     * @param con
5408     * @throws TorqueException
5409     */

5410    public void save(Connection JavaDoc con) throws TorqueException
5411    {
5412          if (!alreadyInSave)
5413        {
5414            alreadyInSave = true;
5415
5416
5417  
5418            // If this object has been modified, then save it to the database.
5419
if (isModified())
5420            {
5421                if (isNew())
5422                {
5423                    SorderPeer.doInsert((Sorder) this, con);
5424                    setNew(false);
5425                }
5426                else
5427                {
5428                    SorderPeer.doUpdate((Sorder) this, con);
5429                }
5430            }
5431
5432                                      
5433                
5434                    if (collPayments != null)
5435            {
5436                for (int i = 0; i < collPayments.size(); i++)
5437                {
5438                    ((Payment) collPayments.get(i)).save(con);
5439                }
5440            }
5441                                                  
5442                
5443                    if (collServices != null)
5444            {
5445                for (int i = 0; i < collServices.size(); i++)
5446                {
5447                    ((Service) collServices.get(i)).save(con);
5448                }
5449            }
5450                                                  
5451                
5452                    if (collShipments != null)
5453            {
5454                for (int i = 0; i < collShipments.size(); i++)
5455                {
5456                    ((Shipment) collShipments.get(i)).save(con);
5457                }
5458            }
5459                                                  
5460                
5461                    if (collPrintSubscriptions != null)
5462            {
5463                for (int i = 0; i < collPrintSubscriptions.size(); i++)
5464                {
5465                    ((PrintSubscription) collPrintSubscriptions.get(i)).save(con);
5466                }
5467            }
5468                                                  
5469                
5470                    if (collOnlineSubscriptions != null)
5471            {
5472                for (int i = 0; i < collOnlineSubscriptions.size(); i++)
5473                {
5474                    ((OnlineSubscription) collOnlineSubscriptions.get(i)).save(con);
5475                }
5476            }
5477                                                  
5478                
5479                    if (collSorderItems != null)
5480            {
5481                for (int i = 0; i < collSorderItems.size(); i++)
5482                {
5483                    ((SorderItem) collSorderItems.get(i)).save(con);
5484                }
5485            }
5486                                                  
5487                
5488                    if (collPaymentItems != null)
5489            {
5490                for (int i = 0; i < collPaymentItems.size(); i++)
5491                {
5492                    ((PaymentItem) collPaymentItems.get(i)).save(con);
5493                }
5494            }
5495                                                  
5496                
5497                    if (collShipmentItems != null)
5498            {
5499                for (int i = 0; i < collShipmentItems.size(); i++)
5500                {
5501                    ((ShipmentItem) collShipmentItems.get(i)).save(con);
5502                }
5503            }
5504                                                  
5505                
5506                    if (collServiceItems != null)
5507            {
5508                for (int i = 0; i < collServiceItems.size(); i++)
5509                {
5510                    ((ServiceItem) collServiceItems.get(i)).save(con);
5511                }
5512            }
5513                                  alreadyInSave = false;
5514        }
5515      }
5516
5517                        
5518      /**
5519     * Set the PrimaryKey using ObjectKey.
5520     *
5521     * @param key sorderId ObjectKey
5522     */

5523    public void setPrimaryKey(ObjectKey key)
5524        throws TorqueException
5525    {
5526            setSorderId(((NumberKey) key).intValue());
5527        }
5528
5529    /**
5530     * Set the PrimaryKey using a String.
5531     *
5532     * @param key
5533     */

5534    public void setPrimaryKey(String JavaDoc key) throws TorqueException
5535    {
5536            setSorderId(Integer.parseInt(key));
5537        }
5538
5539  
5540    /**
5541     * returns an id that differentiates this object from others
5542     * of its class.
5543     */

5544    public ObjectKey getPrimaryKey()
5545    {
5546          return SimpleKey.keyFor(getSorderId());
5547      }
5548 
5549    /**
5550     * get an id that differentiates this object from others
5551     * of its class.
5552     */

5553    public String JavaDoc getQueryKey()
5554    {
5555        if (getPrimaryKey() == null)
5556        {
5557            return "";
5558        }
5559        else
5560        {
5561            return getPrimaryKey().toString();
5562        }
5563    }
5564
5565    /**
5566     * set an id that differentiates this object from others
5567     * of its class.
5568     */

5569    public void setQueryKey(String JavaDoc key)
5570        throws TorqueException
5571    {
5572        setPrimaryKey(key);
5573    }
5574
5575    /**
5576     * Makes a copy of this object.
5577     * It creates a new object filling in the simple attributes.
5578       * It then fills all the association collections and sets the
5579     * related objects to isNew=true.
5580       */

5581      public Sorder copy() throws TorqueException
5582    {
5583        return copyInto(new Sorder());
5584    }
5585  
5586    protected Sorder copyInto(Sorder copyObj) throws TorqueException
5587    {
5588          copyObj.setSorderId(sorderId);
5589          copyObj.setSorderCode(sorderCode);
5590          copyObj.setStatus(status);
5591          copyObj.setPriority(priority);
5592          copyObj.setIssuedDate(issuedDate);
5593          copyObj.setClosedDate(closedDate);
5594          copyObj.setCustomerId(customerId);
5595          copyObj.setRecipientId(recipientId);
5596          copyObj.setProjectId(projectId);
5597          copyObj.setCarrierId(carrierId);
5598          copyObj.setPayTerm(payTerm);
5599          copyObj.setPayMethod(payMethod);
5600          copyObj.setCurrencyId(currencyId);
5601          copyObj.setCurrencyAmount(currencyAmount);
5602          copyObj.setSubject(subject);
5603          copyObj.setNotes(notes);
5604          copyObj.setCreated(created);
5605          copyObj.setModified(modified);
5606          copyObj.setCreatedBy(createdBy);
5607          copyObj.setModifiedBy(modifiedBy);
5608  
5609                            copyObj.setSorderId( 0);
5610                                                                                                                              
5611                                      
5612                            
5613        List JavaDoc v = getPayments();
5614        for (int i = 0; i < v.size(); i++)
5615        {
5616            Payment obj = (Payment) v.get(i);
5617            copyObj.addPayment(obj.copy());
5618        }
5619                                                  
5620                            
5621        v = getServices();
5622        for (int i = 0; i < v.size(); i++)
5623        {
5624            Service obj = (Service) v.get(i);
5625            copyObj.addService(obj.copy());
5626        }
5627                                                  
5628                            
5629        v = getShipments();
5630        for (int i = 0; i < v.size(); i++)
5631        {
5632            Shipment obj = (Shipment) v.get(i);
5633            copyObj.addShipment(obj.copy());
5634        }
5635                                                  
5636                            
5637        v = getPrintSubscriptions();
5638        for (int i = 0; i < v.size(); i++)
5639        {
5640            PrintSubscription obj = (PrintSubscription) v.get(i);
5641            copyObj.addPrintSubscription(obj.copy());
5642        }
5643                                                  
5644                            
5645        v = getOnlineSubscriptions();
5646        for (int i = 0; i < v.size(); i++)
5647        {
5648            OnlineSubscription obj = (OnlineSubscription) v.get(i);
5649            copyObj.addOnlineSubscription(obj.copy());
5650        }
5651                                                  
5652                            
5653        v = getSorderItems();
5654        for (int i = 0; i < v.size(); i++)
5655        {
5656            SorderItem obj = (SorderItem) v.get(i);
5657            copyObj.addSorderItem(obj.copy());
5658        }
5659                                                  
5660                            
5661        v = getPaymentItems();
5662        for (int i = 0; i < v.size(); i++)
5663        {
5664            PaymentItem obj = (PaymentItem) v.get(i);
5665            copyObj.addPaymentItem(obj.copy());
5666        }
5667                                                  
5668                            
5669        v = getShipmentItems();
5670        for (int i = 0; i < v.size(); i++)
5671        {
5672            ShipmentItem obj = (ShipmentItem) v.get(i);
5673            copyObj.addShipmentItem(obj.copy());
5674        }
5675                                                  
5676                            
5677        v = getServiceItems();
5678        for (int i = 0; i < v.size(); i++)
5679        {
5680            ServiceItem obj = (ServiceItem) v.get(i);
5681            copyObj.addServiceItem(obj.copy());
5682        }
5683                            return copyObj;
5684    }
5685
5686    /**
5687     * returns a peer instance associated with this om. Since Peer classes
5688     * are not to have any instance attributes, this method returns the
5689     * same instance for all member of this class. The method could therefore
5690     * be static, but this would prevent one from overriding the behavior.
5691     */

5692    public SorderPeer getPeer()
5693    {
5694        return peer;
5695    }
5696
5697    public String JavaDoc toString()
5698    {
5699        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
5700        str.append("Sorder:\n");
5701        str.append("SorderId = ")
5702               .append(getSorderId())
5703             .append("\n");
5704        str.append("SorderCode = ")
5705               .append(getSorderCode())
5706             .append("\n");
5707        str.append("Status = ")
5708               .append(getStatus())
5709             .append("\n");
5710        str.append("Priority = ")
5711               .append(getPriority())
5712             .append("\n");
5713        str.append("IssuedDate = ")
5714               .append(getIssuedDate())
5715             .append("\n");
5716        str.append("ClosedDate = ")
5717               .append(getClosedDate())
5718             .append("\n");
5719        str.append("CustomerId = ")
5720               .append(getCustomerId())
5721             .append("\n");
5722        str.append("RecipientId = ")
5723               .append(getRecipientId())
5724             .append("\n");
5725        str.append("ProjectId = ")
5726               .append(getProjectId())
5727             .append("\n");
5728        str.append("CarrierId = ")
5729               .append(getCarrierId())
5730             .append("\n");
5731        str.append("PayTerm = ")
5732               .append(getPayTerm())
5733             .append("\n");
5734        str.append("PayMethod = ")
5735               .append(getPayMethod())
5736             .append("\n");
5737        str.append("CurrencyId = ")
5738               .append(getCurrencyId())
5739             .append("\n");
5740        str.append("CurrencyAmount = ")
5741               .append(getCurrencyAmount())
5742             .append("\n");
5743        str.append("Subject = ")
5744               .append(getSubject())
5745             .append("\n");
5746        str.append("Notes = ")
5747               .append(getNotes())
5748             .append("\n");
5749        str.append("Created = ")
5750               .append(getCreated())
5751             .append("\n");
5752        str.append("Modified = ")
5753               .append(getModified())
5754             .append("\n");
5755        str.append("CreatedBy = ")
5756               .append(getCreatedBy())
5757             .append("\n");
5758        str.append("ModifiedBy = ")
5759               .append(getModifiedBy())
5760             .append("\n");
5761        return(str.toString());
5762    }
5763}
5764
Popular Tags