KickJava   Java API By Example, From Geeks To Geeks.

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


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  * This class was autogenerated by Torque on:
28  *
29  * [Wed May 04 09:10:56 CEST 2005]
30  *
31  * You should not use this class directly. It should not even be
32  * extended all references should be to Carrier
33  */

34 public abstract class BaseCarrier extends BaseObject
35     implements org.apache.turbine.om.Retrievable
36 {
37     /** The Peer class */
38     private static final CarrierPeer peer =
39         new CarrierPeer();
40
41         
42     /** The value for the carrierId field */
43     private int carrierId;
44       
45     /** The value for the carrierName field */
46     private String JavaDoc carrierName;
47   
48     
49     /**
50      * Get the CarrierId
51      *
52      * @return int
53      */

54     public int getCarrierId()
55     {
56         return carrierId;
57     }
58
59                                               
60     /**
61      * Set the value of CarrierId
62      *
63      * @param v new value
64      */

65     public void setCarrierId(int v) throws TorqueException
66     {
67     
68                   if (this.carrierId != v)
69               {
70             this.carrierId = v;
71             setModified(true);
72         }
73     
74           
75                                   
76                   // update associated Sorder
77
if (collSorders != null)
78         {
79             for (int i = 0; i < collSorders.size(); i++)
80             {
81                 ((Sorder) collSorders.get(i))
82                     .setCarrierId(v);
83             }
84         }
85                                                     
86                   // update associated Shipment
87
if (collShipments != null)
88         {
89             for (int i = 0; i < collShipments.size(); i++)
90             {
91                 ((Shipment) collShipments.get(i))
92                     .setCarrierId(v);
93             }
94         }
95                                                     
96                   // update associated PrintSubscription
97
if (collPrintSubscriptions != null)
98         {
99             for (int i = 0; i < collPrintSubscriptions.size(); i++)
100             {
101                 ((PrintSubscription) collPrintSubscriptions.get(i))
102                     .setCarrierId(v);
103             }
104         }
105                                 }
106   
107     /**
108      * Get the CarrierName
109      *
110      * @return String
111      */

112     public String JavaDoc getCarrierName()
113     {
114         return carrierName;
115     }
116
117                         
118     /**
119      * Set the value of CarrierName
120      *
121      * @param v new value
122      */

123     public void setCarrierName(String JavaDoc v)
124     {
125     
126                   if (!ObjectUtils.equals(this.carrierName, v))
127               {
128             this.carrierName = v;
129             setModified(true);
130         }
131     
132           
133               }
134   
135          
136                                 
137             
138           /**
139      * Collection to store aggregation of collSorders
140      */

141     protected List JavaDoc collSorders;
142
143     /**
144      * Temporary storage of collSorders to save a possible db hit in
145      * the event objects are add to the collection, but the
146      * complete collection is never requested.
147      */

148     protected void initSorders()
149     {
150         if (collSorders == null)
151         {
152             collSorders = new ArrayList JavaDoc();
153         }
154     }
155
156     /**
157      * Method called to associate a Sorder object to this object
158      * through the Sorder foreign key attribute
159      *
160      * @param l Sorder
161      * @throws TorqueException
162      */

163     public void addSorder(Sorder l) throws TorqueException
164     {
165         getSorders().add(l);
166         l.setCarrier((Carrier) this);
167     }
168
169     /**
170      * The criteria used to select the current contents of collSorders
171      */

172     private Criteria lastSordersCriteria = null;
173       
174     /**
175      * If this collection has already been initialized, returns
176      * the collection. Otherwise returns the results of
177      * getSorders(new Criteria())
178      *
179      * @throws TorqueException
180      */

181     public List JavaDoc getSorders() throws TorqueException
182     {
183               if (collSorders == null)
184         {
185             collSorders = getSorders(new Criteria(10));
186         }
187         return collSorders;
188           }
189
190     /**
191      * If this collection has already been initialized with
192      * an identical criteria, it returns the collection.
193      * Otherwise if this Carrier has previously
194      * been saved, it will retrieve related Sorders from storage.
195      * If this Carrier is new, it will return
196      * an empty collection or the current collection, the criteria
197      * is ignored on a new object.
198      *
199      * @throws TorqueException
200      */

201     public List JavaDoc getSorders(Criteria criteria) throws TorqueException
202     {
203               if (collSorders == null)
204         {
205             if (isNew())
206             {
207                collSorders = new ArrayList JavaDoc();
208             }
209             else
210             {
211                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId() );
212                         collSorders = SorderPeer.doSelect(criteria);
213             }
214         }
215         else
216         {
217             // criteria has no effect for a new object
218
if (!isNew())
219             {
220                 // the following code is to determine if a new query is
221
// called for. If the criteria is the same as the last
222
// one, just return the collection.
223
criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
224                             if (!lastSordersCriteria.equals(criteria))
225                 {
226                     collSorders = SorderPeer.doSelect(criteria);
227                 }
228             }
229         }
230         lastSordersCriteria = criteria;
231
232         return collSorders;
233           }
234
235     /**
236      * If this collection has already been initialized, returns
237      * the collection. Otherwise returns the results of
238      * getSorders(new Criteria(),Connection)
239      * This method takes in the Connection also as input so that
240      * referenced objects can also be obtained using a Connection
241      * that is taken as input
242      */

243     public List JavaDoc getSorders(Connection JavaDoc con) throws TorqueException
244     {
245               if (collSorders == null)
246         {
247             collSorders = getSorders(new Criteria(10), con);
248         }
249         return collSorders;
250           }
251
252     /**
253      * If this collection has already been initialized with
254      * an identical criteria, it returns the collection.
255      * Otherwise if this Carrier has previously
256      * been saved, it will retrieve related Sorders from storage.
257      * If this Carrier is new, it will return
258      * an empty collection or the current collection, the criteria
259      * is ignored on a new object.
260      * This method takes in the Connection also as input so that
261      * referenced objects can also be obtained using a Connection
262      * that is taken as input
263      */

264     public List JavaDoc getSorders(Criteria criteria, Connection JavaDoc con)
265             throws TorqueException
266     {
267               if (collSorders == null)
268         {
269             if (isNew())
270             {
271                collSorders = new ArrayList JavaDoc();
272             }
273             else
274             {
275                          criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
276                          collSorders = SorderPeer.doSelect(criteria, con);
277              }
278          }
279          else
280          {
281              // criteria has no effect for a new object
282
if (!isNew())
283              {
284                  // the following code is to determine if a new query is
285
// called for. If the criteria is the same as the last
286
// one, just return the collection.
287
criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
288                              if (!lastSordersCriteria.equals(criteria))
289                  {
290                      collSorders = SorderPeer.doSelect(criteria, con);
291                  }
292              }
293          }
294          lastSordersCriteria = criteria;
295
296          return collSorders;
297            }
298
299                                           
300               
301                     
302                     
303                                             
304                                                                           
305                                         
306                     
307                     
308           
309     /**
310      * If this collection has already been initialized with
311      * an identical criteria, it returns the collection.
312      * Otherwise if this Carrier is new, it will return
313      * an empty collection; or if this Carrier has previously
314      * been saved, it will retrieve related Sorders from storage.
315      *
316      * This method is protected by default in order to keep the public
317      * api reasonable. You can provide public methods for those you
318      * actually need in Carrier.
319      */

320     protected List JavaDoc getSordersJoinCustomerRelatedByCustomerId(Criteria criteria)
321         throws TorqueException
322     {
323                     if (collSorders == null)
324         {
325             if (isNew())
326             {
327                collSorders = new ArrayList JavaDoc();
328             }
329             else
330             {
331                               criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
332                               collSorders = SorderPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
333             }
334         }
335         else
336         {
337             // the following code is to determine if a new query is
338
// called for. If the criteria is the same as the last
339
// one, just return the collection.
340

341                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
342                                     if (!lastSordersCriteria.equals(criteria))
343             {
344                 collSorders = SorderPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
345             }
346         }
347         lastSordersCriteria = criteria;
348
349         return collSorders;
350                 }
351                   
352                     
353                     
354                                             
355                                                                           
356                                         
357                     
358                     
359           
360     /**
361      * If this collection has already been initialized with
362      * an identical criteria, it returns the collection.
363      * Otherwise if this Carrier is new, it will return
364      * an empty collection; or if this Carrier has previously
365      * been saved, it will retrieve related Sorders from storage.
366      *
367      * This method is protected by default in order to keep the public
368      * api reasonable. You can provide public methods for those you
369      * actually need in Carrier.
370      */

371     protected List JavaDoc getSordersJoinCustomerRelatedByRecipientId(Criteria criteria)
372         throws TorqueException
373     {
374                     if (collSorders == null)
375         {
376             if (isNew())
377             {
378                collSorders = new ArrayList JavaDoc();
379             }
380             else
381             {
382                               criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
383                               collSorders = SorderPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
384             }
385         }
386         else
387         {
388             // the following code is to determine if a new query is
389
// called for. If the criteria is the same as the last
390
// one, just return the collection.
391

392                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
393                                     if (!lastSordersCriteria.equals(criteria))
394             {
395                 collSorders = SorderPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
396             }
397         }
398         lastSordersCriteria = criteria;
399
400         return collSorders;
401                 }
402                   
403                     
404                     
405                                 
406                                                               
407                                         
408                     
409                     
410           
411     /**
412      * If this collection has already been initialized with
413      * an identical criteria, it returns the collection.
414      * Otherwise if this Carrier is new, it will return
415      * an empty collection; or if this Carrier has previously
416      * been saved, it will retrieve related Sorders from storage.
417      *
418      * This method is protected by default in order to keep the public
419      * api reasonable. You can provide public methods for those you
420      * actually need in Carrier.
421      */

422     protected List JavaDoc getSordersJoinProject(Criteria criteria)
423         throws TorqueException
424     {
425                     if (collSorders == null)
426         {
427             if (isNew())
428             {
429                collSorders = new ArrayList JavaDoc();
430             }
431             else
432             {
433                               criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
434                               collSorders = SorderPeer.doSelectJoinProject(criteria);
435             }
436         }
437         else
438         {
439             // the following code is to determine if a new query is
440
// called for. If the criteria is the same as the last
441
// one, just return the collection.
442

443                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
444                                     if (!lastSordersCriteria.equals(criteria))
445             {
446                 collSorders = SorderPeer.doSelectJoinProject(criteria);
447             }
448         }
449         lastSordersCriteria = criteria;
450
451         return collSorders;
452                 }
453                   
454                     
455                               
456                                 
457                                                               
458                                         
459                     
460                     
461           
462     /**
463      * If this collection has already been initialized with
464      * an identical criteria, it returns the collection.
465      * Otherwise if this Carrier is new, it will return
466      * an empty collection; or if this Carrier has previously
467      * been saved, it will retrieve related Sorders from storage.
468      *
469      * This method is protected by default in order to keep the public
470      * api reasonable. You can provide public methods for those you
471      * actually need in Carrier.
472      */

473     protected List JavaDoc getSordersJoinCarrier(Criteria criteria)
474         throws TorqueException
475     {
476                     if (collSorders == null)
477         {
478             if (isNew())
479             {
480                collSorders = new ArrayList JavaDoc();
481             }
482             else
483             {
484                               criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
485                               collSorders = SorderPeer.doSelectJoinCarrier(criteria);
486             }
487         }
488         else
489         {
490             // the following code is to determine if a new query is
491
// called for. If the criteria is the same as the last
492
// one, just return the collection.
493

494                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
495                                     if (!lastSordersCriteria.equals(criteria))
496             {
497                 collSorders = SorderPeer.doSelectJoinCarrier(criteria);
498             }
499         }
500         lastSordersCriteria = criteria;
501
502         return collSorders;
503                 }
504                   
505                     
506                     
507                                 
508                                                               
509                                         
510                     
511                     
512           
513     /**
514      * If this collection has already been initialized with
515      * an identical criteria, it returns the collection.
516      * Otherwise if this Carrier is new, it will return
517      * an empty collection; or if this Carrier has previously
518      * been saved, it will retrieve related Sorders from storage.
519      *
520      * This method is protected by default in order to keep the public
521      * api reasonable. You can provide public methods for those you
522      * actually need in Carrier.
523      */

524     protected List JavaDoc getSordersJoinCurrency(Criteria criteria)
525         throws TorqueException
526     {
527                     if (collSorders == null)
528         {
529             if (isNew())
530             {
531                collSorders = new ArrayList JavaDoc();
532             }
533             else
534             {
535                               criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
536                               collSorders = SorderPeer.doSelectJoinCurrency(criteria);
537             }
538         }
539         else
540         {
541             // the following code is to determine if a new query is
542
// called for. If the criteria is the same as the last
543
// one, just return the collection.
544

545                         criteria.add(SorderPeer.CARRIER_ID, getCarrierId());
546                                     if (!lastSordersCriteria.equals(criteria))
547             {
548                 collSorders = SorderPeer.doSelectJoinCurrency(criteria);
549             }
550         }
551         lastSordersCriteria = criteria;
552
553         return collSorders;
554                 }
555                             
556
557
558                           
559             
560           /**
561      * Collection to store aggregation of collShipments
562      */

563     protected List JavaDoc collShipments;
564
565     /**
566      * Temporary storage of collShipments to save a possible db hit in
567      * the event objects are add to the collection, but the
568      * complete collection is never requested.
569      */

570     protected void initShipments()
571     {
572         if (collShipments == null)
573         {
574             collShipments = new ArrayList JavaDoc();
575         }
576     }
577
578     /**
579      * Method called to associate a Shipment object to this object
580      * through the Shipment foreign key attribute
581      *
582      * @param l Shipment
583      * @throws TorqueException
584      */

585     public void addShipment(Shipment l) throws TorqueException
586     {
587         getShipments().add(l);
588         l.setCarrier((Carrier) this);
589     }
590
591     /**
592      * The criteria used to select the current contents of collShipments
593      */

594     private Criteria lastShipmentsCriteria = null;
595       
596     /**
597      * If this collection has already been initialized, returns
598      * the collection. Otherwise returns the results of
599      * getShipments(new Criteria())
600      *
601      * @throws TorqueException
602      */

603     public List JavaDoc getShipments() throws TorqueException
604     {
605               if (collShipments == null)
606         {
607             collShipments = getShipments(new Criteria(10));
608         }
609         return collShipments;
610           }
611
612     /**
613      * If this collection has already been initialized with
614      * an identical criteria, it returns the collection.
615      * Otherwise if this Carrier has previously
616      * been saved, it will retrieve related Shipments from storage.
617      * If this Carrier is new, it will return
618      * an empty collection or the current collection, the criteria
619      * is ignored on a new object.
620      *
621      * @throws TorqueException
622      */

623     public List JavaDoc getShipments(Criteria criteria) throws TorqueException
624     {
625               if (collShipments == null)
626         {
627             if (isNew())
628             {
629                collShipments = new ArrayList JavaDoc();
630             }
631             else
632             {
633                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId() );
634                         collShipments = ShipmentPeer.doSelect(criteria);
635             }
636         }
637         else
638         {
639             // criteria has no effect for a new object
640
if (!isNew())
641             {
642                 // the following code is to determine if a new query is
643
// called for. If the criteria is the same as the last
644
// one, just return the collection.
645
criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
646                             if (!lastShipmentsCriteria.equals(criteria))
647                 {
648                     collShipments = ShipmentPeer.doSelect(criteria);
649                 }
650             }
651         }
652         lastShipmentsCriteria = criteria;
653
654         return collShipments;
655           }
656
657     /**
658      * If this collection has already been initialized, returns
659      * the collection. Otherwise returns the results of
660      * getShipments(new Criteria(),Connection)
661      * This method takes in the Connection also as input so that
662      * referenced objects can also be obtained using a Connection
663      * that is taken as input
664      */

665     public List JavaDoc getShipments(Connection JavaDoc con) throws TorqueException
666     {
667               if (collShipments == null)
668         {
669             collShipments = getShipments(new Criteria(10), con);
670         }
671         return collShipments;
672           }
673
674     /**
675      * If this collection has already been initialized with
676      * an identical criteria, it returns the collection.
677      * Otherwise if this Carrier has previously
678      * been saved, it will retrieve related Shipments from storage.
679      * If this Carrier is new, it will return
680      * an empty collection or the current collection, the criteria
681      * is ignored on a new object.
682      * This method takes in the Connection also as input so that
683      * referenced objects can also be obtained using a Connection
684      * that is taken as input
685      */

686     public List JavaDoc getShipments(Criteria criteria, Connection JavaDoc con)
687             throws TorqueException
688     {
689               if (collShipments == null)
690         {
691             if (isNew())
692             {
693                collShipments = new ArrayList JavaDoc();
694             }
695             else
696             {
697                          criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
698                          collShipments = ShipmentPeer.doSelect(criteria, con);
699              }
700          }
701          else
702          {
703              // criteria has no effect for a new object
704
if (!isNew())
705              {
706                  // the following code is to determine if a new query is
707
// called for. If the criteria is the same as the last
708
// one, just return the collection.
709
criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
710                              if (!lastShipmentsCriteria.equals(criteria))
711                  {
712                      collShipments = ShipmentPeer.doSelect(criteria, con);
713                  }
714              }
715          }
716          lastShipmentsCriteria = criteria;
717
718          return collShipments;
719            }
720
721                                           
722               
723                     
724                     
725                                             
726                                                                           
727                                         
728                     
729                     
730           
731     /**
732      * If this collection has already been initialized with
733      * an identical criteria, it returns the collection.
734      * Otherwise if this Carrier is new, it will return
735      * an empty collection; or if this Carrier has previously
736      * been saved, it will retrieve related Shipments from storage.
737      *
738      * This method is protected by default in order to keep the public
739      * api reasonable. You can provide public methods for those you
740      * actually need in Carrier.
741      */

742     protected List JavaDoc getShipmentsJoinCustomerRelatedByCustomerId(Criteria criteria)
743         throws TorqueException
744     {
745                     if (collShipments == null)
746         {
747             if (isNew())
748             {
749                collShipments = new ArrayList JavaDoc();
750             }
751             else
752             {
753                               criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
754                               collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
755             }
756         }
757         else
758         {
759             // the following code is to determine if a new query is
760
// called for. If the criteria is the same as the last
761
// one, just return the collection.
762

763                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
764                                     if (!lastShipmentsCriteria.equals(criteria))
765             {
766                 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
767             }
768         }
769         lastShipmentsCriteria = criteria;
770
771         return collShipments;
772                 }
773                   
774                     
775                     
776                                             
777                                                                           
778                                         
779                     
780                     
781           
782     /**
783      * If this collection has already been initialized with
784      * an identical criteria, it returns the collection.
785      * Otherwise if this Carrier is new, it will return
786      * an empty collection; or if this Carrier has previously
787      * been saved, it will retrieve related Shipments from storage.
788      *
789      * This method is protected by default in order to keep the public
790      * api reasonable. You can provide public methods for those you
791      * actually need in Carrier.
792      */

793     protected List JavaDoc getShipmentsJoinCustomerRelatedByRecipientId(Criteria criteria)
794         throws TorqueException
795     {
796                     if (collShipments == null)
797         {
798             if (isNew())
799             {
800                collShipments = new ArrayList JavaDoc();
801             }
802             else
803             {
804                               criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
805                               collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
806             }
807         }
808         else
809         {
810             // the following code is to determine if a new query is
811
// called for. If the criteria is the same as the last
812
// one, just return the collection.
813

814                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
815                                     if (!lastShipmentsCriteria.equals(criteria))
816             {
817                 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
818             }
819         }
820         lastShipmentsCriteria = criteria;
821
822         return collShipments;
823                 }
824                   
825                     
826                     
827                                 
828                                                               
829                                         
830                     
831                     
832           
833     /**
834      * If this collection has already been initialized with
835      * an identical criteria, it returns the collection.
836      * Otherwise if this Carrier is new, it will return
837      * an empty collection; or if this Carrier has previously
838      * been saved, it will retrieve related Shipments from storage.
839      *
840      * This method is protected by default in order to keep the public
841      * api reasonable. You can provide public methods for those you
842      * actually need in Carrier.
843      */

844     protected List JavaDoc getShipmentsJoinProject(Criteria criteria)
845         throws TorqueException
846     {
847                     if (collShipments == null)
848         {
849             if (isNew())
850             {
851                collShipments = new ArrayList JavaDoc();
852             }
853             else
854             {
855                               criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
856                               collShipments = ShipmentPeer.doSelectJoinProject(criteria);
857             }
858         }
859         else
860         {
861             // the following code is to determine if a new query is
862
// called for. If the criteria is the same as the last
863
// one, just return the collection.
864

865                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
866                                     if (!lastShipmentsCriteria.equals(criteria))
867             {
868                 collShipments = ShipmentPeer.doSelectJoinProject(criteria);
869             }
870         }
871         lastShipmentsCriteria = criteria;
872
873         return collShipments;
874                 }
875                   
876                     
877                     
878                                 
879                                                               
880                                         
881                     
882                     
883           
884     /**
885      * If this collection has already been initialized with
886      * an identical criteria, it returns the collection.
887      * Otherwise if this Carrier is new, it will return
888      * an empty collection; or if this Carrier has previously
889      * been saved, it will retrieve related Shipments from storage.
890      *
891      * This method is protected by default in order to keep the public
892      * api reasonable. You can provide public methods for those you
893      * actually need in Carrier.
894      */

895     protected List JavaDoc getShipmentsJoinSorder(Criteria criteria)
896         throws TorqueException
897     {
898                     if (collShipments == null)
899         {
900             if (isNew())
901             {
902                collShipments = new ArrayList JavaDoc();
903             }
904             else
905             {
906                               criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
907                               collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
908             }
909         }
910         else
911         {
912             // the following code is to determine if a new query is
913
// called for. If the criteria is the same as the last
914
// one, just return the collection.
915

916                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
917                                     if (!lastShipmentsCriteria.equals(criteria))
918             {
919                 collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
920             }
921         }
922         lastShipmentsCriteria = criteria;
923
924         return collShipments;
925                 }
926                   
927                     
928                               
929                                 
930                                                               
931                                         
932                     
933                     
934           
935     /**
936      * If this collection has already been initialized with
937      * an identical criteria, it returns the collection.
938      * Otherwise if this Carrier is new, it will return
939      * an empty collection; or if this Carrier has previously
940      * been saved, it will retrieve related Shipments from storage.
941      *
942      * This method is protected by default in order to keep the public
943      * api reasonable. You can provide public methods for those you
944      * actually need in Carrier.
945      */

946     protected List JavaDoc getShipmentsJoinCarrier(Criteria criteria)
947         throws TorqueException
948     {
949                     if (collShipments == null)
950         {
951             if (isNew())
952             {
953                collShipments = new ArrayList JavaDoc();
954             }
955             else
956             {
957                               criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
958                               collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
959             }
960         }
961         else
962         {
963             // the following code is to determine if a new query is
964
// called for. If the criteria is the same as the last
965
// one, just return the collection.
966

967                         criteria.add(ShipmentPeer.CARRIER_ID, getCarrierId());
968                                     if (!lastShipmentsCriteria.equals(criteria))
969             {
970                 collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
971             }
972         }
973         lastShipmentsCriteria = criteria;
974
975         return collShipments;
976                 }
977                             
978
979
980                           
981             
982           /**
983      * Collection to store aggregation of collPrintSubscriptions
984      */

985     protected List JavaDoc collPrintSubscriptions;
986
987     /**
988      * Temporary storage of collPrintSubscriptions to save a possible db hit in
989      * the event objects are add to the collection, but the
990      * complete collection is never requested.
991      */

992     protected void initPrintSubscriptions()
993     {
994         if (collPrintSubscriptions == null)
995         {
996             collPrintSubscriptions = new ArrayList JavaDoc();
997         }
998     }
999
1000    /**
1001     * Method called to associate a PrintSubscription object to this object
1002     * through the PrintSubscription foreign key attribute
1003     *
1004     * @param l PrintSubscription
1005     * @throws TorqueException
1006     */

1007    public void addPrintSubscription(PrintSubscription l) throws TorqueException
1008    {
1009        getPrintSubscriptions().add(l);
1010        l.setCarrier((Carrier) this);
1011    }
1012
1013    /**
1014     * The criteria used to select the current contents of collPrintSubscriptions
1015     */

1016    private Criteria lastPrintSubscriptionsCriteria = null;
1017      
1018    /**
1019     * If this collection has already been initialized, returns
1020     * the collection. Otherwise returns the results of
1021     * getPrintSubscriptions(new Criteria())
1022     *
1023     * @throws TorqueException
1024     */

1025    public List JavaDoc getPrintSubscriptions() throws TorqueException
1026    {
1027              if (collPrintSubscriptions == null)
1028        {
1029            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10));
1030        }
1031        return collPrintSubscriptions;
1032          }
1033
1034    /**
1035     * If this collection has already been initialized with
1036     * an identical criteria, it returns the collection.
1037     * Otherwise if this Carrier has previously
1038     * been saved, it will retrieve related PrintSubscriptions from storage.
1039     * If this Carrier is new, it will return
1040     * an empty collection or the current collection, the criteria
1041     * is ignored on a new object.
1042     *
1043     * @throws TorqueException
1044     */

1045    public List JavaDoc getPrintSubscriptions(Criteria criteria) throws TorqueException
1046    {
1047              if (collPrintSubscriptions == null)
1048        {
1049            if (isNew())
1050            {
1051               collPrintSubscriptions = new ArrayList JavaDoc();
1052            }
1053            else
1054            {
1055                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId() );
1056                        collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
1057            }
1058        }
1059        else
1060        {
1061            // criteria has no effect for a new object
1062
if (!isNew())
1063            {
1064                // the following code is to determine if a new query is
1065
// called for. If the criteria is the same as the last
1066
// one, just return the collection.
1067
criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1068                            if (!lastPrintSubscriptionsCriteria.equals(criteria))
1069                {
1070                    collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
1071                }
1072            }
1073        }
1074        lastPrintSubscriptionsCriteria = criteria;
1075
1076        return collPrintSubscriptions;
1077          }
1078
1079    /**
1080     * If this collection has already been initialized, returns
1081     * the collection. Otherwise returns the results of
1082     * getPrintSubscriptions(new Criteria(),Connection)
1083     * This method takes in the Connection also as input so that
1084     * referenced objects can also be obtained using a Connection
1085     * that is taken as input
1086     */

1087    public List JavaDoc getPrintSubscriptions(Connection JavaDoc con) throws TorqueException
1088    {
1089              if (collPrintSubscriptions == null)
1090        {
1091            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con);
1092        }
1093        return collPrintSubscriptions;
1094          }
1095
1096    /**
1097     * If this collection has already been initialized with
1098     * an identical criteria, it returns the collection.
1099     * Otherwise if this Carrier has previously
1100     * been saved, it will retrieve related PrintSubscriptions from storage.
1101     * If this Carrier is new, it will return
1102     * an empty collection or the current collection, the criteria
1103     * is ignored on a new object.
1104     * This method takes in the Connection also as input so that
1105     * referenced objects can also be obtained using a Connection
1106     * that is taken as input
1107     */

1108    public List JavaDoc getPrintSubscriptions(Criteria criteria, Connection JavaDoc con)
1109            throws TorqueException
1110    {
1111              if (collPrintSubscriptions == null)
1112        {
1113            if (isNew())
1114            {
1115               collPrintSubscriptions = new ArrayList JavaDoc();
1116            }
1117            else
1118            {
1119                         criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1120                         collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
1121             }
1122         }
1123         else
1124         {
1125             // criteria has no effect for a new object
1126
if (!isNew())
1127             {
1128                 // the following code is to determine if a new query is
1129
// called for. If the criteria is the same as the last
1130
// one, just return the collection.
1131
criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1132                             if (!lastPrintSubscriptionsCriteria.equals(criteria))
1133                 {
1134                     collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
1135                 }
1136             }
1137         }
1138         lastPrintSubscriptionsCriteria = criteria;
1139
1140         return collPrintSubscriptions;
1141           }
1142
1143                                                
1144              
1145                    
1146                    
1147                                            
1148                                                                          
1149                                        
1150                    
1151                    
1152          
1153    /**
1154     * If this collection has already been initialized with
1155     * an identical criteria, it returns the collection.
1156     * Otherwise if this Carrier is new, it will return
1157     * an empty collection; or if this Carrier has previously
1158     * been saved, it will retrieve related PrintSubscriptions from storage.
1159     *
1160     * This method is protected by default in order to keep the public
1161     * api reasonable. You can provide public methods for those you
1162     * actually need in Carrier.
1163     */

1164    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
1165        throws TorqueException
1166    {
1167                    if (collPrintSubscriptions == null)
1168        {
1169            if (isNew())
1170            {
1171               collPrintSubscriptions = new ArrayList JavaDoc();
1172            }
1173            else
1174            {
1175                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1176                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1177            }
1178        }
1179        else
1180        {
1181            // the following code is to determine if a new query is
1182
// called for. If the criteria is the same as the last
1183
// one, just return the collection.
1184

1185                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1186                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1187            {
1188                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1189            }
1190        }
1191        lastPrintSubscriptionsCriteria = criteria;
1192
1193        return collPrintSubscriptions;
1194                }
1195                  
1196                    
1197                    
1198                                            
1199                                                                          
1200                                        
1201                    
1202                    
1203          
1204    /**
1205     * If this collection has already been initialized with
1206     * an identical criteria, it returns the collection.
1207     * Otherwise if this Carrier is new, it will return
1208     * an empty collection; or if this Carrier has previously
1209     * been saved, it will retrieve related PrintSubscriptions from storage.
1210     *
1211     * This method is protected by default in order to keep the public
1212     * api reasonable. You can provide public methods for those you
1213     * actually need in Carrier.
1214     */

1215    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
1216        throws TorqueException
1217    {
1218                    if (collPrintSubscriptions == null)
1219        {
1220            if (isNew())
1221            {
1222               collPrintSubscriptions = new ArrayList JavaDoc();
1223            }
1224            else
1225            {
1226                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1227                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1228            }
1229        }
1230        else
1231        {
1232            // the following code is to determine if a new query is
1233
// called for. If the criteria is the same as the last
1234
// one, just return the collection.
1235

1236                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1237                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1238            {
1239                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1240            }
1241        }
1242        lastPrintSubscriptionsCriteria = criteria;
1243
1244        return collPrintSubscriptions;
1245                }
1246                  
1247                    
1248                              
1249                                
1250                                                              
1251                                        
1252                    
1253                    
1254          
1255    /**
1256     * If this collection has already been initialized with
1257     * an identical criteria, it returns the collection.
1258     * Otherwise if this Carrier is new, it will return
1259     * an empty collection; or if this Carrier has previously
1260     * been saved, it will retrieve related PrintSubscriptions from storage.
1261     *
1262     * This method is protected by default in order to keep the public
1263     * api reasonable. You can provide public methods for those you
1264     * actually need in Carrier.
1265     */

1266    protected List JavaDoc getPrintSubscriptionsJoinCarrier(Criteria criteria)
1267        throws TorqueException
1268    {
1269                    if (collPrintSubscriptions == null)
1270        {
1271            if (isNew())
1272            {
1273               collPrintSubscriptions = new ArrayList JavaDoc();
1274            }
1275            else
1276            {
1277                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1278                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
1279            }
1280        }
1281        else
1282        {
1283            // the following code is to determine if a new query is
1284
// called for. If the criteria is the same as the last
1285
// one, just return the collection.
1286

1287                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1288                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1289            {
1290                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
1291            }
1292        }
1293        lastPrintSubscriptionsCriteria = criteria;
1294
1295        return collPrintSubscriptions;
1296                }
1297                  
1298                    
1299                    
1300                                
1301                                                              
1302                                        
1303                    
1304                    
1305          
1306    /**
1307     * If this collection has already been initialized with
1308     * an identical criteria, it returns the collection.
1309     * Otherwise if this Carrier is new, it will return
1310     * an empty collection; or if this Carrier has previously
1311     * been saved, it will retrieve related PrintSubscriptions from storage.
1312     *
1313     * This method is protected by default in order to keep the public
1314     * api reasonable. You can provide public methods for those you
1315     * actually need in Carrier.
1316     */

1317    protected List JavaDoc getPrintSubscriptionsJoinProject(Criteria criteria)
1318        throws TorqueException
1319    {
1320                    if (collPrintSubscriptions == null)
1321        {
1322            if (isNew())
1323            {
1324               collPrintSubscriptions = new ArrayList JavaDoc();
1325            }
1326            else
1327            {
1328                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1329                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
1330            }
1331        }
1332        else
1333        {
1334            // the following code is to determine if a new query is
1335
// called for. If the criteria is the same as the last
1336
// one, just return the collection.
1337

1338                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1339                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1340            {
1341                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
1342            }
1343        }
1344        lastPrintSubscriptionsCriteria = criteria;
1345
1346        return collPrintSubscriptions;
1347                }
1348                  
1349                    
1350                    
1351                                
1352                                                              
1353                                        
1354                    
1355                    
1356          
1357    /**
1358     * If this collection has already been initialized with
1359     * an identical criteria, it returns the collection.
1360     * Otherwise if this Carrier is new, it will return
1361     * an empty collection; or if this Carrier has previously
1362     * been saved, it will retrieve related PrintSubscriptions from storage.
1363     *
1364     * This method is protected by default in order to keep the public
1365     * api reasonable. You can provide public methods for those you
1366     * actually need in Carrier.
1367     */

1368    protected List JavaDoc getPrintSubscriptionsJoinProduct(Criteria criteria)
1369        throws TorqueException
1370    {
1371                    if (collPrintSubscriptions == null)
1372        {
1373            if (isNew())
1374            {
1375               collPrintSubscriptions = new ArrayList JavaDoc();
1376            }
1377            else
1378            {
1379                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1380                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
1381            }
1382        }
1383        else
1384        {
1385            // the following code is to determine if a new query is
1386
// called for. If the criteria is the same as the last
1387
// one, just return the collection.
1388

1389                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1390                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1391            {
1392                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
1393            }
1394        }
1395        lastPrintSubscriptionsCriteria = criteria;
1396
1397        return collPrintSubscriptions;
1398                }
1399                  
1400                    
1401                    
1402                                
1403                                                              
1404                                        
1405                    
1406                    
1407          
1408    /**
1409     * If this collection has already been initialized with
1410     * an identical criteria, it returns the collection.
1411     * Otherwise if this Carrier is new, it will return
1412     * an empty collection; or if this Carrier has previously
1413     * been saved, it will retrieve related PrintSubscriptions from storage.
1414     *
1415     * This method is protected by default in order to keep the public
1416     * api reasonable. You can provide public methods for those you
1417     * actually need in Carrier.
1418     */

1419    protected List JavaDoc getPrintSubscriptionsJoinSorder(Criteria criteria)
1420        throws TorqueException
1421    {
1422                    if (collPrintSubscriptions == null)
1423        {
1424            if (isNew())
1425            {
1426               collPrintSubscriptions = new ArrayList JavaDoc();
1427            }
1428            else
1429            {
1430                              criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1431                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
1432            }
1433        }
1434        else
1435        {
1436            // the following code is to determine if a new query is
1437
// called for. If the criteria is the same as the last
1438
// one, just return the collection.
1439

1440                        criteria.add(PrintSubscriptionPeer.CARRIER_ID, getCarrierId());
1441                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1442            {
1443                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
1444            }
1445        }
1446        lastPrintSubscriptionsCriteria = criteria;
1447
1448        return collPrintSubscriptions;
1449                }
1450                            
1451
1452
1453          
1454    private static List JavaDoc fieldNames = null;
1455
1456    /**
1457     * Generate a list of field names.
1458     *
1459     * @return a list of field names
1460     */

1461    public static synchronized List JavaDoc getFieldNames()
1462    {
1463        if (fieldNames == null)
1464        {
1465            fieldNames = new ArrayList JavaDoc();
1466              fieldNames.add("CarrierId");
1467              fieldNames.add("CarrierName");
1468              fieldNames = Collections.unmodifiableList(fieldNames);
1469        }
1470        return fieldNames;
1471    }
1472
1473    /**
1474     * Retrieves a field from the object by name passed in as a String.
1475     *
1476     * @param name field name
1477     * @return value
1478     */

1479    public Object JavaDoc getByName(String JavaDoc name)
1480    {
1481          if (name.equals("CarrierId"))
1482        {
1483                return new Integer JavaDoc(getCarrierId());
1484            }
1485          if (name.equals("CarrierName"))
1486        {
1487                return getCarrierName();
1488            }
1489          return null;
1490    }
1491    
1492    /**
1493     * Retrieves a field from the object by name passed in
1494     * as a String. The String must be one of the static
1495     * Strings defined in this Class' Peer.
1496     *
1497     * @param name peer name
1498     * @return value
1499     */

1500    public Object JavaDoc getByPeerName(String JavaDoc name)
1501    {
1502          if (name.equals(CarrierPeer.CARRIER_ID))
1503        {
1504                return new Integer JavaDoc(getCarrierId());
1505            }
1506          if (name.equals(CarrierPeer.CARRIER_NAME))
1507        {
1508                return getCarrierName();
1509            }
1510          return null;
1511    }
1512
1513    /**
1514     * Retrieves a field from the object by Position as specified
1515     * in the xml schema. Zero-based.
1516     *
1517     * @param pos position in xml schema
1518     * @return value
1519     */

1520    public Object JavaDoc getByPosition(int pos)
1521    {
1522            if (pos == 0)
1523        {
1524                return new Integer JavaDoc(getCarrierId());
1525            }
1526              if (pos == 1)
1527        {
1528                return getCarrierName();
1529            }
1530              return null;
1531    }
1532     
1533    /**
1534     * Stores the object in the database. If the object is new,
1535     * it inserts it; otherwise an update is performed.
1536     *
1537     * @throws Exception
1538     */

1539    public void save() throws Exception JavaDoc
1540    {
1541          save(CarrierPeer.getMapBuilder()
1542                .getDatabaseMap().getName());
1543      }
1544
1545    /**
1546     * Stores the object in the database. If the object is new,
1547     * it inserts it; otherwise an update is performed.
1548       * Note: this code is here because the method body is
1549     * auto-generated conditionally and therefore needs to be
1550     * in this file instead of in the super class, BaseObject.
1551       *
1552     * @param dbName
1553     * @throws TorqueException
1554     */

1555    public void save(String JavaDoc dbName) throws TorqueException
1556    {
1557        Connection JavaDoc con = null;
1558          try
1559        {
1560            con = Transaction.begin(dbName);
1561            save(con);
1562            Transaction.commit(con);
1563        }
1564        catch(TorqueException e)
1565        {
1566            Transaction.safeRollback(con);
1567            throw e;
1568        }
1569      }
1570
1571      /** flag to prevent endless save loop, if this object is referenced
1572        by another object which falls in this transaction. */

1573    private boolean alreadyInSave = false;
1574      /**
1575     * Stores the object in the database. If the object is new,
1576     * it inserts it; otherwise an update is performed. This method
1577     * is meant to be used as part of a transaction, otherwise use
1578     * the save() method and the connection details will be handled
1579     * internally
1580     *
1581     * @param con
1582     * @throws TorqueException
1583     */

1584    public void save(Connection JavaDoc con) throws TorqueException
1585    {
1586          if (!alreadyInSave)
1587        {
1588            alreadyInSave = true;
1589
1590
1591  
1592            // If this object has been modified, then save it to the database.
1593
if (isModified())
1594            {
1595                if (isNew())
1596                {
1597                    CarrierPeer.doInsert((Carrier) this, con);
1598                    setNew(false);
1599                }
1600                else
1601                {
1602                    CarrierPeer.doUpdate((Carrier) this, con);
1603                }
1604            }
1605
1606                                      
1607                
1608                    if (collSorders != null)
1609            {
1610                for (int i = 0; i < collSorders.size(); i++)
1611                {
1612                    ((Sorder) collSorders.get(i)).save(con);
1613                }
1614            }
1615                                                  
1616                
1617                    if (collShipments != null)
1618            {
1619                for (int i = 0; i < collShipments.size(); i++)
1620                {
1621                    ((Shipment) collShipments.get(i)).save(con);
1622                }
1623            }
1624                                                  
1625                
1626                    if (collPrintSubscriptions != null)
1627            {
1628                for (int i = 0; i < collPrintSubscriptions.size(); i++)
1629                {
1630                    ((PrintSubscription) collPrintSubscriptions.get(i)).save(con);
1631                }
1632            }
1633                                  alreadyInSave = false;
1634        }
1635      }
1636
1637                        
1638      /**
1639     * Set the PrimaryKey using ObjectKey.
1640     *
1641     * @param key carrierId ObjectKey
1642     */

1643    public void setPrimaryKey(ObjectKey key)
1644        throws TorqueException
1645    {
1646            setCarrierId(((NumberKey) key).intValue());
1647        }
1648
1649    /**
1650     * Set the PrimaryKey using a String.
1651     *
1652     * @param key
1653     */

1654    public void setPrimaryKey(String JavaDoc key) throws TorqueException
1655    {
1656            setCarrierId(Integer.parseInt(key));
1657        }
1658
1659  
1660    /**
1661     * returns an id that differentiates this object from others
1662     * of its class.
1663     */

1664    public ObjectKey getPrimaryKey()
1665    {
1666          return SimpleKey.keyFor(getCarrierId());
1667      }
1668 
1669    /**
1670     * get an id that differentiates this object from others
1671     * of its class.
1672     */

1673    public String JavaDoc getQueryKey()
1674    {
1675        if (getPrimaryKey() == null)
1676        {
1677            return "";
1678        }
1679        else
1680        {
1681            return getPrimaryKey().toString();
1682        }
1683    }
1684
1685    /**
1686     * set an id that differentiates this object from others
1687     * of its class.
1688     */

1689    public void setQueryKey(String JavaDoc key)
1690        throws TorqueException
1691    {
1692        setPrimaryKey(key);
1693    }
1694
1695    /**
1696     * Makes a copy of this object.
1697     * It creates a new object filling in the simple attributes.
1698       * It then fills all the association collections and sets the
1699     * related objects to isNew=true.
1700       */

1701      public Carrier copy() throws TorqueException
1702    {
1703        return copyInto(new Carrier());
1704    }
1705  
1706    protected Carrier copyInto(Carrier copyObj) throws TorqueException
1707    {
1708          copyObj.setCarrierId(carrierId);
1709          copyObj.setCarrierName(carrierName);
1710  
1711                            copyObj.setCarrierId( 0);
1712                  
1713                                      
1714                            
1715        List JavaDoc v = getSorders();
1716        for (int i = 0; i < v.size(); i++)
1717        {
1718            Sorder obj = (Sorder) v.get(i);
1719            copyObj.addSorder(obj.copy());
1720        }
1721                                                  
1722                            
1723        v = getShipments();
1724        for (int i = 0; i < v.size(); i++)
1725        {
1726            Shipment obj = (Shipment) v.get(i);
1727            copyObj.addShipment(obj.copy());
1728        }
1729                                                  
1730                            
1731        v = getPrintSubscriptions();
1732        for (int i = 0; i < v.size(); i++)
1733        {
1734            PrintSubscription obj = (PrintSubscription) v.get(i);
1735            copyObj.addPrintSubscription(obj.copy());
1736        }
1737                            return copyObj;
1738    }
1739
1740    /**
1741     * returns a peer instance associated with this om. Since Peer classes
1742     * are not to have any instance attributes, this method returns the
1743     * same instance for all member of this class. The method could therefore
1744     * be static, but this would prevent one from overriding the behavior.
1745     */

1746    public CarrierPeer getPeer()
1747    {
1748        return peer;
1749    }
1750
1751    public String JavaDoc toString()
1752    {
1753        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
1754        str.append("Carrier:\n");
1755        str.append("CarrierId = ")
1756               .append(getCarrierId())
1757             .append("\n");
1758        str.append("CarrierName = ")
1759               .append(getCarrierName())
1760             .append("\n");
1761        return(str.toString());
1762    }
1763}
1764
Popular Tags