KickJava   Java API By Example, From Geeks To Geeks.

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


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

37 public abstract class BaseProduct extends BaseObject
38     implements org.apache.turbine.om.Retrievable
39 {
40     /** The Peer class */
41     private static final ProductPeer peer =
42         new ProductPeer();
43
44         
45     /** The value for the productId field */
46     private int productId;
47                                                 
48     /** The value for the productCode field */
49     private String JavaDoc productCode = "AUTO";
50                                           
51     /** The value for the status field */
52     private int status = 30;
53                                           
54     /** The value for the priority field */
55     private int priority = 30;
56                                           
57     /** The value for the productType field */
58     private int productType = 10;
59                                           
60     /** The value for the productCatId field */
61     private int productCatId = 1000;
62       
63     /** The value for the productDescription field */
64     private String JavaDoc productDescription;
65       
66     /** The value for the productDisplay field */
67     private String JavaDoc productDisplay;
68                                           
69     /** The value for the basePrice field */
70     private double basePrice = 0;
71                                           
72     /** The value for the uomId field */
73     private int uomId = 1000;
74       
75     /** The value for the webUrl field */
76     private String JavaDoc webUrl;
77                                           
78     /** The value for the showOnPricelist field */
79     private int showOnPricelist = 20;
80                                           
81     /** The value for the vendorId field */
82     private int vendorId = 1000;
83       
84     /** The value for the vendorsCode field */
85     private String JavaDoc vendorsCode;
86       
87     /** The value for the eanUpcCode field */
88     private String JavaDoc eanUpcCode;
89       
90     /** The value for the location field */
91     private String JavaDoc location;
92       
93     /** The value for the custom1 field */
94     private String JavaDoc custom1;
95       
96     /** The value for the custom2 field */
97     private String JavaDoc custom2;
98       
99     /** The value for the custom3 field */
100     private String JavaDoc custom3;
101       
102     /** The value for the custom4 field */
103     private String JavaDoc custom4;
104       
105     /** The value for the custom5 field */
106     private String JavaDoc custom5;
107       
108     /** The value for the custom6 field */
109     private String JavaDoc custom6;
110       
111     /** The value for the notes field */
112     private String JavaDoc notes;
113       
114     /** The value for the created field */
115     private Date JavaDoc created;
116       
117     /** The value for the modified field */
118     private Date JavaDoc modified;
119       
120     /** The value for the createdBy field */
121     private String JavaDoc createdBy;
122       
123     /** The value for the modifiedBy field */
124     private String JavaDoc modifiedBy;
125   
126     
127     /**
128      * Get the ProductId
129      *
130      * @return int
131      */

132     public int getProductId()
133     {
134         return productId;
135     }
136
137                                               
138     /**
139      * Set the value of ProductId
140      *
141      * @param v new value
142      */

143     public void setProductId(int v) throws TorqueException
144     {
145     
146                   if (this.productId != v)
147               {
148             this.productId = v;
149             setModified(true);
150         }
151     
152           
153                                   
154                   // update associated PrintSubscription
155
if (collPrintSubscriptions != null)
156         {
157             for (int i = 0; i < collPrintSubscriptions.size(); i++)
158             {
159                 ((PrintSubscription) collPrintSubscriptions.get(i))
160                     .setProductId(v);
161             }
162         }
163                                                     
164                   // update associated OnlineSubscription
165
if (collOnlineSubscriptions != null)
166         {
167             for (int i = 0; i < collOnlineSubscriptions.size(); i++)
168             {
169                 ((OnlineSubscription) collOnlineSubscriptions.get(i))
170                     .setProductId(v);
171             }
172         }
173                                                     
174                   // update associated InboxEvent
175
if (collInboxEvents != null)
176         {
177             for (int i = 0; i < collInboxEvents.size(); i++)
178             {
179                 ((InboxEvent) collInboxEvents.get(i))
180                     .setProductId(v);
181             }
182         }
183                                                     
184                   // update associated OutboxEvent
185
if (collOutboxEvents != null)
186         {
187             for (int i = 0; i < collOutboxEvents.size(); i++)
188             {
189                 ((OutboxEvent) collOutboxEvents.get(i))
190                     .setProductId(v);
191             }
192         }
193                                                     
194                   // update associated NewsSubscription
195
if (collNewsSubscriptions != null)
196         {
197             for (int i = 0; i < collNewsSubscriptions.size(); i++)
198             {
199                 ((NewsSubscription) collNewsSubscriptions.get(i))
200                     .setProductId(v);
201             }
202         }
203                                                     
204                   // update associated Newsletter
205
if (collNewslettersRelatedByProductId != null)
206         {
207             for (int i = 0; i < collNewslettersRelatedByProductId.size(); i++)
208             {
209                 ((Newsletter) collNewslettersRelatedByProductId.get(i))
210                     .setProductId(v);
211             }
212         }
213                                                     
214                   // update associated Newsletter
215
if (collNewslettersRelatedByRelProductId != null)
216         {
217             for (int i = 0; i < collNewslettersRelatedByRelProductId.size(); i++)
218             {
219                 ((Newsletter) collNewslettersRelatedByRelProductId.get(i))
220                     .setRelProductId(v);
221             }
222         }
223                                                     
224                   // update associated SorderItem
225
if (collSorderItems != null)
226         {
227             for (int i = 0; i < collSorderItems.size(); i++)
228             {
229                 ((SorderItem) collSorderItems.get(i))
230                     .setProductId(v);
231             }
232         }
233                                                     
234                   // update associated PaymentItem
235
if (collPaymentItems != null)
236         {
237             for (int i = 0; i < collPaymentItems.size(); i++)
238             {
239                 ((PaymentItem) collPaymentItems.get(i))
240                     .setProductId(v);
241             }
242         }
243                                                     
244                   // update associated ShipmentItem
245
if (collShipmentItems != null)
246         {
247             for (int i = 0; i < collShipmentItems.size(); i++)
248             {
249                 ((ShipmentItem) collShipmentItems.get(i))
250                     .setProductId(v);
251             }
252         }
253                                                     
254                   // update associated ServiceItem
255
if (collServiceItems != null)
256         {
257             for (int i = 0; i < collServiceItems.size(); i++)
258             {
259                 ((ServiceItem) collServiceItems.get(i))
260                     .setProductId(v);
261             }
262         }
263                                 }
264   
265     /**
266      * Get the ProductCode
267      *
268      * @return String
269      */

270     public String JavaDoc getProductCode()
271     {
272         return productCode;
273     }
274
275                         
276     /**
277      * Set the value of ProductCode
278      *
279      * @param v new value
280      */

281     public void setProductCode(String JavaDoc v)
282     {
283     
284                   if (!ObjectUtils.equals(this.productCode, v))
285               {
286             this.productCode = v;
287             setModified(true);
288         }
289     
290           
291               }
292   
293     /**
294      * Get the Status
295      *
296      * @return int
297      */

298     public int getStatus()
299     {
300         return status;
301     }
302
303                         
304     /**
305      * Set the value of Status
306      *
307      * @param v new value
308      */

309     public void setStatus(int v)
310     {
311     
312                   if (this.status != v)
313               {
314             this.status = v;
315             setModified(true);
316         }
317     
318           
319               }
320   
321     /**
322      * Get the Priority
323      *
324      * @return int
325      */

326     public int getPriority()
327     {
328         return priority;
329     }
330
331                         
332     /**
333      * Set the value of Priority
334      *
335      * @param v new value
336      */

337     public void setPriority(int v)
338     {
339     
340                   if (this.priority != v)
341               {
342             this.priority = v;
343             setModified(true);
344         }
345     
346           
347               }
348   
349     /**
350      * Get the ProductType
351      *
352      * @return int
353      */

354     public int getProductType()
355     {
356         return productType;
357     }
358
359                         
360     /**
361      * Set the value of ProductType
362      *
363      * @param v new value
364      */

365     public void setProductType(int v)
366     {
367     
368                   if (this.productType != v)
369               {
370             this.productType = v;
371             setModified(true);
372         }
373     
374           
375               }
376   
377     /**
378      * Get the ProductCatId
379      *
380      * @return int
381      */

382     public int getProductCatId()
383     {
384         return productCatId;
385     }
386
387                               
388     /**
389      * Set the value of ProductCatId
390      *
391      * @param v new value
392      */

393     public void setProductCatId(int v) throws TorqueException
394     {
395     
396                   if (this.productCatId != v)
397               {
398             this.productCatId = v;
399             setModified(true);
400         }
401     
402                           
403                 if (aProductCategory != null && !(aProductCategory.getProductCatId() == v))
404                 {
405             aProductCategory = null;
406         }
407       
408               }
409   
410     /**
411      * Get the ProductDescription
412      *
413      * @return String
414      */

415     public String JavaDoc getProductDescription()
416     {
417         return productDescription;
418     }
419
420                         
421     /**
422      * Set the value of ProductDescription
423      *
424      * @param v new value
425      */

426     public void setProductDescription(String JavaDoc v)
427     {
428     
429                   if (!ObjectUtils.equals(this.productDescription, v))
430               {
431             this.productDescription = v;
432             setModified(true);
433         }
434     
435           
436               }
437   
438     /**
439      * Get the ProductDisplay
440      *
441      * @return String
442      */

443     public String JavaDoc getProductDisplay()
444     {
445         return productDisplay;
446     }
447
448                         
449     /**
450      * Set the value of ProductDisplay
451      *
452      * @param v new value
453      */

454     public void setProductDisplay(String JavaDoc v)
455     {
456     
457                   if (!ObjectUtils.equals(this.productDisplay, v))
458               {
459             this.productDisplay = v;
460             setModified(true);
461         }
462     
463           
464               }
465   
466     /**
467      * Get the BasePrice
468      *
469      * @return double
470      */

471     public double getBasePrice()
472     {
473         return basePrice;
474     }
475
476                         
477     /**
478      * Set the value of BasePrice
479      *
480      * @param v new value
481      */

482     public void setBasePrice(double v)
483     {
484     
485                   if (this.basePrice != v)
486               {
487             this.basePrice = v;
488             setModified(true);
489         }
490     
491           
492               }
493   
494     /**
495      * Get the UomId
496      *
497      * @return int
498      */

499     public int getUomId()
500     {
501         return uomId;
502     }
503
504                               
505     /**
506      * Set the value of UomId
507      *
508      * @param v new value
509      */

510     public void setUomId(int v) throws TorqueException
511     {
512     
513                   if (this.uomId != v)
514               {
515             this.uomId = v;
516             setModified(true);
517         }
518     
519                           
520                 if (aUom != null && !(aUom.getUomId() == v))
521                 {
522             aUom = null;
523         }
524       
525               }
526   
527     /**
528      * Get the WebUrl
529      *
530      * @return String
531      */

532     public String JavaDoc getWebUrl()
533     {
534         return webUrl;
535     }
536
537                         
538     /**
539      * Set the value of WebUrl
540      *
541      * @param v new value
542      */

543     public void setWebUrl(String JavaDoc v)
544     {
545     
546                   if (!ObjectUtils.equals(this.webUrl, v))
547               {
548             this.webUrl = v;
549             setModified(true);
550         }
551     
552           
553               }
554   
555     /**
556      * Get the ShowOnPricelist
557      *
558      * @return int
559      */

560     public int getShowOnPricelist()
561     {
562         return showOnPricelist;
563     }
564
565                         
566     /**
567      * Set the value of ShowOnPricelist
568      *
569      * @param v new value
570      */

571     public void setShowOnPricelist(int v)
572     {
573     
574                   if (this.showOnPricelist != v)
575               {
576             this.showOnPricelist = v;
577             setModified(true);
578         }
579     
580           
581               }
582   
583     /**
584      * Get the VendorId
585      *
586      * @return int
587      */

588     public int getVendorId()
589     {
590         return vendorId;
591     }
592
593                               
594     /**
595      * Set the value of VendorId
596      *
597      * @param v new value
598      */

599     public void setVendorId(int v) throws TorqueException
600     {
601     
602                   if (this.vendorId != v)
603               {
604             this.vendorId = v;
605             setModified(true);
606         }
607     
608                           
609                 if (aVendor != null && !(aVendor.getVendorId() == v))
610                 {
611             aVendor = null;
612         }
613       
614               }
615   
616     /**
617      * Get the VendorsCode
618      *
619      * @return String
620      */

621     public String JavaDoc getVendorsCode()
622     {
623         return vendorsCode;
624     }
625
626                         
627     /**
628      * Set the value of VendorsCode
629      *
630      * @param v new value
631      */

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

649     public String JavaDoc getEanUpcCode()
650     {
651         return eanUpcCode;
652     }
653
654                         
655     /**
656      * Set the value of EanUpcCode
657      *
658      * @param v new value
659      */

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

677     public String JavaDoc getLocation()
678     {
679         return location;
680     }
681
682                         
683     /**
684      * Set the value of Location
685      *
686      * @param v new value
687      */

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

705     public String JavaDoc getCustom1()
706     {
707         return custom1;
708     }
709
710                         
711     /**
712      * Set the value of Custom1
713      *
714      * @param v new value
715      */

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

733     public String JavaDoc getCustom2()
734     {
735         return custom2;
736     }
737
738                         
739     /**
740      * Set the value of Custom2
741      *
742      * @param v new value
743      */

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

761     public String JavaDoc getCustom3()
762     {
763         return custom3;
764     }
765
766                         
767     /**
768      * Set the value of Custom3
769      *
770      * @param v new value
771      */

772     public void setCustom3(String JavaDoc v)
773     {
774     
775                   if (!ObjectUtils.equals(this.custom3, v))
776               {
777             this.custom3 = v;
778             setModified(true);
779         }
780     
781           
782               }
783   
784     /**
785      * Get the Custom4
786      *
787      * @return String
788      */

789     public String JavaDoc getCustom4()
790     {
791         return custom4;
792     }
793
794                         
795     /**
796      * Set the value of Custom4
797      *
798      * @param v new value
799      */

800     public void setCustom4(String JavaDoc v)
801     {
802     
803                   if (!ObjectUtils.equals(this.custom4, v))
804               {
805             this.custom4 = v;
806             setModified(true);
807         }
808     
809           
810               }
811   
812     /**
813      * Get the Custom5
814      *
815      * @return String
816      */

817     public String JavaDoc getCustom5()
818     {
819         return custom5;
820     }
821
822                         
823     /**
824      * Set the value of Custom5
825      *
826      * @param v new value
827      */

828     public void setCustom5(String JavaDoc v)
829     {
830     
831                   if (!ObjectUtils.equals(this.custom5, v))
832               {
833             this.custom5 = v;
834             setModified(true);
835         }
836     
837           
838               }
839   
840     /**
841      * Get the Custom6
842      *
843      * @return String
844      */

845     public String JavaDoc getCustom6()
846     {
847         return custom6;
848     }
849
850                         
851     /**
852      * Set the value of Custom6
853      *
854      * @param v new value
855      */

856     public void setCustom6(String JavaDoc v)
857     {
858     
859                   if (!ObjectUtils.equals(this.custom6, v))
860               {
861             this.custom6 = v;
862             setModified(true);
863         }
864     
865           
866               }
867   
868     /**
869      * Get the Notes
870      *
871      * @return String
872      */

873     public String JavaDoc getNotes()
874     {
875         return notes;
876     }
877
878                         
879     /**
880      * Set the value of Notes
881      *
882      * @param v new value
883      */

884     public void setNotes(String JavaDoc v)
885     {
886     
887                   if (!ObjectUtils.equals(this.notes, v))
888               {
889             this.notes = v;
890             setModified(true);
891         }
892     
893           
894               }
895   
896     /**
897      * Get the Created
898      *
899      * @return Date
900      */

901     public Date JavaDoc getCreated()
902     {
903         return created;
904     }
905
906                         
907     /**
908      * Set the value of Created
909      *
910      * @param v new value
911      */

912     public void setCreated(Date JavaDoc v)
913     {
914     
915                   if (!ObjectUtils.equals(this.created, v))
916               {
917             this.created = v;
918             setModified(true);
919         }
920     
921           
922               }
923   
924     /**
925      * Get the Modified
926      *
927      * @return Date
928      */

929     public Date JavaDoc getModified()
930     {
931         return modified;
932     }
933
934                         
935     /**
936      * Set the value of Modified
937      *
938      * @param v new value
939      */

940     public void setModified(Date JavaDoc v)
941     {
942     
943                   if (!ObjectUtils.equals(this.modified, v))
944               {
945             this.modified = v;
946             setModified(true);
947         }
948     
949           
950               }
951   
952     /**
953      * Get the CreatedBy
954      *
955      * @return String
956      */

957     public String JavaDoc getCreatedBy()
958     {
959         return createdBy;
960     }
961
962                         
963     /**
964      * Set the value of CreatedBy
965      *
966      * @param v new value
967      */

968     public void setCreatedBy(String JavaDoc v)
969     {
970     
971                   if (!ObjectUtils.equals(this.createdBy, v))
972               {
973             this.createdBy = v;
974             setModified(true);
975         }
976     
977           
978               }
979   
980     /**
981      * Get the ModifiedBy
982      *
983      * @return String
984      */

985     public String JavaDoc getModifiedBy()
986     {
987         return modifiedBy;
988     }
989
990                         
991     /**
992      * Set the value of ModifiedBy
993      *
994      * @param v new value
995      */

996     public void setModifiedBy(String JavaDoc v)
997     {
998     
999                   if (!ObjectUtils.equals(this.modifiedBy, v))
1000              {
1001            this.modifiedBy = v;
1002            setModified(true);
1003        }
1004    
1005          
1006              }
1007  
1008      
1009    
1010                  
1011    
1012        private ProductCategory aProductCategory;
1013
1014    /**
1015     * Declares an association between this object and a ProductCategory object
1016     *
1017     * @param v ProductCategory
1018     * @throws TorqueException
1019     */

1020    public void setProductCategory(ProductCategory v) throws TorqueException
1021    {
1022            if (v == null)
1023        {
1024                          setProductCatId( 1000);
1025              }
1026        else
1027        {
1028            setProductCatId(v.getProductCatId());
1029        }
1030            aProductCategory = v;
1031    }
1032
1033                                            
1034    /**
1035     * Get the associated ProductCategory object
1036     *
1037     * @return the associated ProductCategory object
1038     * @throws TorqueException
1039     */

1040    public ProductCategory getProductCategory() throws TorqueException
1041    {
1042        if (aProductCategory == null && (this.productCatId != 0))
1043        {
1044                          aProductCategory = ProductCategoryPeer.retrieveByPK(SimpleKey.keyFor(this.productCatId));
1045              
1046            /* The following can be used instead of the line above to
1047               guarantee the related object contains a reference
1048               to this object, but this level of coupling
1049               may be undesirable in many circumstances.
1050               As it can lead to a db query with many results that may
1051               never be used.
1052               ProductCategory obj = ProductCategoryPeer.retrieveByPK(this.productCatId);
1053               obj.addProducts(this);
1054            */

1055        }
1056        return aProductCategory;
1057    }
1058
1059    /**
1060     * Provides convenient way to set a relationship based on a
1061     * ObjectKey, for example
1062     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
1063     *
1064         */

1065    public void setProductCategoryKey(ObjectKey key) throws TorqueException
1066    {
1067      
1068                        setProductCatId(((NumberKey) key).intValue());
1069                  }
1070    
1071    
1072                  
1073    
1074        private Uom aUom;
1075
1076    /**
1077     * Declares an association between this object and a Uom object
1078     *
1079     * @param v Uom
1080     * @throws TorqueException
1081     */

1082    public void setUom(Uom v) throws TorqueException
1083    {
1084            if (v == null)
1085        {
1086                          setUomId( 1000);
1087              }
1088        else
1089        {
1090            setUomId(v.getUomId());
1091        }
1092            aUom = v;
1093    }
1094
1095                                            
1096    /**
1097     * Get the associated Uom object
1098     *
1099     * @return the associated Uom object
1100     * @throws TorqueException
1101     */

1102    public Uom getUom() throws TorqueException
1103    {
1104        if (aUom == null && (this.uomId != 0))
1105        {
1106                          aUom = UomPeer.retrieveByPK(SimpleKey.keyFor(this.uomId));
1107              
1108            /* The following can be used instead of the line above to
1109               guarantee the related object contains a reference
1110               to this object, but this level of coupling
1111               may be undesirable in many circumstances.
1112               As it can lead to a db query with many results that may
1113               never be used.
1114               Uom obj = UomPeer.retrieveByPK(this.uomId);
1115               obj.addProducts(this);
1116            */

1117        }
1118        return aUom;
1119    }
1120
1121    /**
1122     * Provides convenient way to set a relationship based on a
1123     * ObjectKey, for example
1124     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
1125     *
1126         */

1127    public void setUomKey(ObjectKey key) throws TorqueException
1128    {
1129      
1130                        setUomId(((NumberKey) key).intValue());
1131                  }
1132    
1133    
1134                  
1135    
1136        private Vendor aVendor;
1137
1138    /**
1139     * Declares an association between this object and a Vendor object
1140     *
1141     * @param v Vendor
1142     * @throws TorqueException
1143     */

1144    public void setVendor(Vendor v) throws TorqueException
1145    {
1146            if (v == null)
1147        {
1148                          setVendorId( 1000);
1149              }
1150        else
1151        {
1152            setVendorId(v.getVendorId());
1153        }
1154            aVendor = v;
1155    }
1156
1157                                            
1158    /**
1159     * Get the associated Vendor object
1160     *
1161     * @return the associated Vendor object
1162     * @throws TorqueException
1163     */

1164    public Vendor getVendor() throws TorqueException
1165    {
1166        if (aVendor == null && (this.vendorId != 0))
1167        {
1168                          aVendor = VendorPeer.retrieveByPK(SimpleKey.keyFor(this.vendorId));
1169              
1170            /* The following can be used instead of the line above to
1171               guarantee the related object contains a reference
1172               to this object, but this level of coupling
1173               may be undesirable in many circumstances.
1174               As it can lead to a db query with many results that may
1175               never be used.
1176               Vendor obj = VendorPeer.retrieveByPK(this.vendorId);
1177               obj.addProducts(this);
1178            */

1179        }
1180        return aVendor;
1181    }
1182
1183    /**
1184     * Provides convenient way to set a relationship based on a
1185     * ObjectKey, for example
1186     * <code>bar.setFooKey(foo.getPrimaryKey())</code>
1187     *
1188         */

1189    public void setVendorKey(ObjectKey key) throws TorqueException
1190    {
1191      
1192                        setVendorId(((NumberKey) key).intValue());
1193                  }
1194       
1195                                
1196            
1197          /**
1198     * Collection to store aggregation of collPrintSubscriptions
1199     */

1200    protected List JavaDoc collPrintSubscriptions;
1201
1202    /**
1203     * Temporary storage of collPrintSubscriptions to save a possible db hit in
1204     * the event objects are add to the collection, but the
1205     * complete collection is never requested.
1206     */

1207    protected void initPrintSubscriptions()
1208    {
1209        if (collPrintSubscriptions == null)
1210        {
1211            collPrintSubscriptions = new ArrayList JavaDoc();
1212        }
1213    }
1214
1215    /**
1216     * Method called to associate a PrintSubscription object to this object
1217     * through the PrintSubscription foreign key attribute
1218     *
1219     * @param l PrintSubscription
1220     * @throws TorqueException
1221     */

1222    public void addPrintSubscription(PrintSubscription l) throws TorqueException
1223    {
1224        getPrintSubscriptions().add(l);
1225        l.setProduct((Product) this);
1226    }
1227
1228    /**
1229     * The criteria used to select the current contents of collPrintSubscriptions
1230     */

1231    private Criteria lastPrintSubscriptionsCriteria = null;
1232      
1233    /**
1234     * If this collection has already been initialized, returns
1235     * the collection. Otherwise returns the results of
1236     * getPrintSubscriptions(new Criteria())
1237     *
1238     * @throws TorqueException
1239     */

1240    public List JavaDoc getPrintSubscriptions() throws TorqueException
1241    {
1242              if (collPrintSubscriptions == null)
1243        {
1244            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10));
1245        }
1246        return collPrintSubscriptions;
1247          }
1248
1249    /**
1250     * If this collection has already been initialized with
1251     * an identical criteria, it returns the collection.
1252     * Otherwise if this Product has previously
1253     * been saved, it will retrieve related PrintSubscriptions from storage.
1254     * If this Product is new, it will return
1255     * an empty collection or the current collection, the criteria
1256     * is ignored on a new object.
1257     *
1258     * @throws TorqueException
1259     */

1260    public List JavaDoc getPrintSubscriptions(Criteria criteria) throws TorqueException
1261    {
1262              if (collPrintSubscriptions == null)
1263        {
1264            if (isNew())
1265            {
1266               collPrintSubscriptions = new ArrayList JavaDoc();
1267            }
1268            else
1269            {
1270                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId() );
1271                        collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
1272            }
1273        }
1274        else
1275        {
1276            // criteria has no effect for a new object
1277
if (!isNew())
1278            {
1279                // the following code is to determine if a new query is
1280
// called for. If the criteria is the same as the last
1281
// one, just return the collection.
1282
criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1283                            if (!lastPrintSubscriptionsCriteria.equals(criteria))
1284                {
1285                    collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
1286                }
1287            }
1288        }
1289        lastPrintSubscriptionsCriteria = criteria;
1290
1291        return collPrintSubscriptions;
1292          }
1293
1294    /**
1295     * If this collection has already been initialized, returns
1296     * the collection. Otherwise returns the results of
1297     * getPrintSubscriptions(new Criteria(),Connection)
1298     * This method takes in the Connection also as input so that
1299     * referenced objects can also be obtained using a Connection
1300     * that is taken as input
1301     */

1302    public List JavaDoc getPrintSubscriptions(Connection JavaDoc con) throws TorqueException
1303    {
1304              if (collPrintSubscriptions == null)
1305        {
1306            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con);
1307        }
1308        return collPrintSubscriptions;
1309          }
1310
1311    /**
1312     * If this collection has already been initialized with
1313     * an identical criteria, it returns the collection.
1314     * Otherwise if this Product has previously
1315     * been saved, it will retrieve related PrintSubscriptions from storage.
1316     * If this Product is new, it will return
1317     * an empty collection or the current collection, the criteria
1318     * is ignored on a new object.
1319     * This method takes in the Connection also as input so that
1320     * referenced objects can also be obtained using a Connection
1321     * that is taken as input
1322     */

1323    public List JavaDoc getPrintSubscriptions(Criteria criteria, Connection JavaDoc con)
1324            throws TorqueException
1325    {
1326              if (collPrintSubscriptions == null)
1327        {
1328            if (isNew())
1329            {
1330               collPrintSubscriptions = new ArrayList JavaDoc();
1331            }
1332            else
1333            {
1334                         criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1335                         collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
1336             }
1337         }
1338         else
1339         {
1340             // criteria has no effect for a new object
1341
if (!isNew())
1342             {
1343                 // the following code is to determine if a new query is
1344
// called for. If the criteria is the same as the last
1345
// one, just return the collection.
1346
criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1347                             if (!lastPrintSubscriptionsCriteria.equals(criteria))
1348                 {
1349                     collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
1350                 }
1351             }
1352         }
1353         lastPrintSubscriptionsCriteria = criteria;
1354
1355         return collPrintSubscriptions;
1356           }
1357
1358                                                
1359              
1360                    
1361                    
1362                                            
1363                                                                          
1364                                        
1365                    
1366                    
1367          
1368    /**
1369     * If this collection has already been initialized with
1370     * an identical criteria, it returns the collection.
1371     * Otherwise if this Product is new, it will return
1372     * an empty collection; or if this Product has previously
1373     * been saved, it will retrieve related PrintSubscriptions from storage.
1374     *
1375     * This method is protected by default in order to keep the public
1376     * api reasonable. You can provide public methods for those you
1377     * actually need in Product.
1378     */

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

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

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

1451                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1452                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1453            {
1454                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1455            }
1456        }
1457        lastPrintSubscriptionsCriteria = criteria;
1458
1459        return collPrintSubscriptions;
1460                }
1461                  
1462                    
1463                    
1464                                
1465                                                              
1466                                        
1467                    
1468                    
1469          
1470    /**
1471     * If this collection has already been initialized with
1472     * an identical criteria, it returns the collection.
1473     * Otherwise if this Product is new, it will return
1474     * an empty collection; or if this Product has previously
1475     * been saved, it will retrieve related PrintSubscriptions from storage.
1476     *
1477     * This method is protected by default in order to keep the public
1478     * api reasonable. You can provide public methods for those you
1479     * actually need in Product.
1480     */

1481    protected List JavaDoc getPrintSubscriptionsJoinCarrier(Criteria criteria)
1482        throws TorqueException
1483    {
1484                    if (collPrintSubscriptions == null)
1485        {
1486            if (isNew())
1487            {
1488               collPrintSubscriptions = new ArrayList JavaDoc();
1489            }
1490            else
1491            {
1492                              criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1493                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
1494            }
1495        }
1496        else
1497        {
1498            // the following code is to determine if a new query is
1499
// called for. If the criteria is the same as the last
1500
// one, just return the collection.
1501

1502                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1503                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1504            {
1505                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
1506            }
1507        }
1508        lastPrintSubscriptionsCriteria = criteria;
1509
1510        return collPrintSubscriptions;
1511                }
1512                  
1513                    
1514                    
1515                                
1516                                                              
1517                                        
1518                    
1519                    
1520          
1521    /**
1522     * If this collection has already been initialized with
1523     * an identical criteria, it returns the collection.
1524     * Otherwise if this Product is new, it will return
1525     * an empty collection; or if this Product has previously
1526     * been saved, it will retrieve related PrintSubscriptions from storage.
1527     *
1528     * This method is protected by default in order to keep the public
1529     * api reasonable. You can provide public methods for those you
1530     * actually need in Product.
1531     */

1532    protected List JavaDoc getPrintSubscriptionsJoinProject(Criteria criteria)
1533        throws TorqueException
1534    {
1535                    if (collPrintSubscriptions == null)
1536        {
1537            if (isNew())
1538            {
1539               collPrintSubscriptions = new ArrayList JavaDoc();
1540            }
1541            else
1542            {
1543                              criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1544                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
1545            }
1546        }
1547        else
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

1553                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1554                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1555            {
1556                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
1557            }
1558        }
1559        lastPrintSubscriptionsCriteria = criteria;
1560
1561        return collPrintSubscriptions;
1562                }
1563                  
1564                    
1565                              
1566                                
1567                                                              
1568                                        
1569                    
1570                    
1571          
1572    /**
1573     * If this collection has already been initialized with
1574     * an identical criteria, it returns the collection.
1575     * Otherwise if this Product is new, it will return
1576     * an empty collection; or if this Product has previously
1577     * been saved, it will retrieve related PrintSubscriptions from storage.
1578     *
1579     * This method is protected by default in order to keep the public
1580     * api reasonable. You can provide public methods for those you
1581     * actually need in Product.
1582     */

1583    protected List JavaDoc getPrintSubscriptionsJoinProduct(Criteria criteria)
1584        throws TorqueException
1585    {
1586                    if (collPrintSubscriptions == null)
1587        {
1588            if (isNew())
1589            {
1590               collPrintSubscriptions = new ArrayList JavaDoc();
1591            }
1592            else
1593            {
1594                              criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1595                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
1596            }
1597        }
1598        else
1599        {
1600            // the following code is to determine if a new query is
1601
// called for. If the criteria is the same as the last
1602
// one, just return the collection.
1603

1604                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1605                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1606            {
1607                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
1608            }
1609        }
1610        lastPrintSubscriptionsCriteria = criteria;
1611
1612        return collPrintSubscriptions;
1613                }
1614                  
1615                    
1616                    
1617                                
1618                                                              
1619                                        
1620                    
1621                    
1622          
1623    /**
1624     * If this collection has already been initialized with
1625     * an identical criteria, it returns the collection.
1626     * Otherwise if this Product is new, it will return
1627     * an empty collection; or if this Product has previously
1628     * been saved, it will retrieve related PrintSubscriptions from storage.
1629     *
1630     * This method is protected by default in order to keep the public
1631     * api reasonable. You can provide public methods for those you
1632     * actually need in Product.
1633     */

1634    protected List JavaDoc getPrintSubscriptionsJoinSorder(Criteria criteria)
1635        throws TorqueException
1636    {
1637                    if (collPrintSubscriptions == null)
1638        {
1639            if (isNew())
1640            {
1641               collPrintSubscriptions = new ArrayList JavaDoc();
1642            }
1643            else
1644            {
1645                              criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1646                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
1647            }
1648        }
1649        else
1650        {
1651            // the following code is to determine if a new query is
1652
// called for. If the criteria is the same as the last
1653
// one, just return the collection.
1654

1655                        criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId());
1656                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
1657            {
1658                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
1659            }
1660        }
1661        lastPrintSubscriptionsCriteria = criteria;
1662
1663        return collPrintSubscriptions;
1664                }
1665                            
1666
1667
1668                          
1669            
1670          /**
1671     * Collection to store aggregation of collOnlineSubscriptions
1672     */

1673    protected List JavaDoc collOnlineSubscriptions;
1674
1675    /**
1676     * Temporary storage of collOnlineSubscriptions to save a possible db hit in
1677     * the event objects are add to the collection, but the
1678     * complete collection is never requested.
1679     */

1680    protected void initOnlineSubscriptions()
1681    {
1682        if (collOnlineSubscriptions == null)
1683        {
1684            collOnlineSubscriptions = new ArrayList JavaDoc();
1685        }
1686    }
1687
1688    /**
1689     * Method called to associate a OnlineSubscription object to this object
1690     * through the OnlineSubscription foreign key attribute
1691     *
1692     * @param l OnlineSubscription
1693     * @throws TorqueException
1694     */

1695    public void addOnlineSubscription(OnlineSubscription l) throws TorqueException
1696    {
1697        getOnlineSubscriptions().add(l);
1698        l.setProduct((Product) this);
1699    }
1700
1701    /**
1702     * The criteria used to select the current contents of collOnlineSubscriptions
1703     */

1704    private Criteria lastOnlineSubscriptionsCriteria = null;
1705      
1706    /**
1707     * If this collection has already been initialized, returns
1708     * the collection. Otherwise returns the results of
1709     * getOnlineSubscriptions(new Criteria())
1710     *
1711     * @throws TorqueException
1712     */

1713    public List JavaDoc getOnlineSubscriptions() throws TorqueException
1714    {
1715              if (collOnlineSubscriptions == null)
1716        {
1717            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10));
1718        }
1719        return collOnlineSubscriptions;
1720          }
1721
1722    /**
1723     * If this collection has already been initialized with
1724     * an identical criteria, it returns the collection.
1725     * Otherwise if this Product has previously
1726     * been saved, it will retrieve related OnlineSubscriptions from storage.
1727     * If this Product is new, it will return
1728     * an empty collection or the current collection, the criteria
1729     * is ignored on a new object.
1730     *
1731     * @throws TorqueException
1732     */

1733    public List JavaDoc getOnlineSubscriptions(Criteria criteria) throws TorqueException
1734    {
1735              if (collOnlineSubscriptions == null)
1736        {
1737            if (isNew())
1738            {
1739               collOnlineSubscriptions = new ArrayList JavaDoc();
1740            }
1741            else
1742            {
1743                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId() );
1744                        collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
1745            }
1746        }
1747        else
1748        {
1749            // criteria has no effect for a new object
1750
if (!isNew())
1751            {
1752                // the following code is to determine if a new query is
1753
// called for. If the criteria is the same as the last
1754
// one, just return the collection.
1755
criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1756                            if (!lastOnlineSubscriptionsCriteria.equals(criteria))
1757                {
1758                    collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
1759                }
1760            }
1761        }
1762        lastOnlineSubscriptionsCriteria = criteria;
1763
1764        return collOnlineSubscriptions;
1765          }
1766
1767    /**
1768     * If this collection has already been initialized, returns
1769     * the collection. Otherwise returns the results of
1770     * getOnlineSubscriptions(new Criteria(),Connection)
1771     * This method takes in the Connection also as input so that
1772     * referenced objects can also be obtained using a Connection
1773     * that is taken as input
1774     */

1775    public List JavaDoc getOnlineSubscriptions(Connection JavaDoc con) throws TorqueException
1776    {
1777              if (collOnlineSubscriptions == null)
1778        {
1779            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10), con);
1780        }
1781        return collOnlineSubscriptions;
1782          }
1783
1784    /**
1785     * If this collection has already been initialized with
1786     * an identical criteria, it returns the collection.
1787     * Otherwise if this Product has previously
1788     * been saved, it will retrieve related OnlineSubscriptions from storage.
1789     * If this Product is new, it will return
1790     * an empty collection or the current collection, the criteria
1791     * is ignored on a new object.
1792     * This method takes in the Connection also as input so that
1793     * referenced objects can also be obtained using a Connection
1794     * that is taken as input
1795     */

1796    public List JavaDoc getOnlineSubscriptions(Criteria criteria, Connection JavaDoc con)
1797            throws TorqueException
1798    {
1799              if (collOnlineSubscriptions == null)
1800        {
1801            if (isNew())
1802            {
1803               collOnlineSubscriptions = new ArrayList JavaDoc();
1804            }
1805            else
1806            {
1807                         criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1808                         collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
1809             }
1810         }
1811         else
1812         {
1813             // criteria has no effect for a new object
1814
if (!isNew())
1815             {
1816                 // the following code is to determine if a new query is
1817
// called for. If the criteria is the same as the last
1818
// one, just return the collection.
1819
criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1820                             if (!lastOnlineSubscriptionsCriteria.equals(criteria))
1821                 {
1822                     collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
1823                 }
1824             }
1825         }
1826         lastOnlineSubscriptionsCriteria = criteria;
1827
1828         return collOnlineSubscriptions;
1829           }
1830
1831                                          
1832              
1833                    
1834                    
1835                                            
1836                                                                          
1837                                        
1838                    
1839                    
1840          
1841    /**
1842     * If this collection has already been initialized with
1843     * an identical criteria, it returns the collection.
1844     * Otherwise if this Product is new, it will return
1845     * an empty collection; or if this Product has previously
1846     * been saved, it will retrieve related OnlineSubscriptions from storage.
1847     *
1848     * This method is protected by default in order to keep the public
1849     * api reasonable. You can provide public methods for those you
1850     * actually need in Product.
1851     */

1852    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
1853        throws TorqueException
1854    {
1855                    if (collOnlineSubscriptions == null)
1856        {
1857            if (isNew())
1858            {
1859               collOnlineSubscriptions = new ArrayList JavaDoc();
1860            }
1861            else
1862            {
1863                              criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1864                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1865            }
1866        }
1867        else
1868        {
1869            // the following code is to determine if a new query is
1870
// called for. If the criteria is the same as the last
1871
// one, just return the collection.
1872

1873                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1874                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
1875            {
1876                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1877            }
1878        }
1879        lastOnlineSubscriptionsCriteria = criteria;
1880
1881        return collOnlineSubscriptions;
1882                }
1883                  
1884                    
1885                    
1886                                            
1887                                                                          
1888                                        
1889                    
1890                    
1891          
1892    /**
1893     * If this collection has already been initialized with
1894     * an identical criteria, it returns the collection.
1895     * Otherwise if this Product is new, it will return
1896     * an empty collection; or if this Product has previously
1897     * been saved, it will retrieve related OnlineSubscriptions from storage.
1898     *
1899     * This method is protected by default in order to keep the public
1900     * api reasonable. You can provide public methods for those you
1901     * actually need in Product.
1902     */

1903    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
1904        throws TorqueException
1905    {
1906                    if (collOnlineSubscriptions == null)
1907        {
1908            if (isNew())
1909            {
1910               collOnlineSubscriptions = new ArrayList JavaDoc();
1911            }
1912            else
1913            {
1914                              criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1915                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1916            }
1917        }
1918        else
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

1924                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1925                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
1926            {
1927                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1928            }
1929        }
1930        lastOnlineSubscriptionsCriteria = criteria;
1931
1932        return collOnlineSubscriptions;
1933                }
1934                  
1935                    
1936                    
1937                                
1938                                                              
1939                                        
1940                    
1941                    
1942          
1943    /**
1944     * If this collection has already been initialized with
1945     * an identical criteria, it returns the collection.
1946     * Otherwise if this Product is new, it will return
1947     * an empty collection; or if this Product has previously
1948     * been saved, it will retrieve related OnlineSubscriptions from storage.
1949     *
1950     * This method is protected by default in order to keep the public
1951     * api reasonable. You can provide public methods for those you
1952     * actually need in Product.
1953     */

1954    protected List JavaDoc getOnlineSubscriptionsJoinProject(Criteria criteria)
1955        throws TorqueException
1956    {
1957                    if (collOnlineSubscriptions == null)
1958        {
1959            if (isNew())
1960            {
1961               collOnlineSubscriptions = new ArrayList JavaDoc();
1962            }
1963            else
1964            {
1965                              criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1966                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
1967            }
1968        }
1969        else
1970        {
1971            // the following code is to determine if a new query is
1972
// called for. If the criteria is the same as the last
1973
// one, just return the collection.
1974

1975                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
1976                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
1977            {
1978                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
1979            }
1980        }
1981        lastOnlineSubscriptionsCriteria = criteria;
1982
1983        return collOnlineSubscriptions;
1984                }
1985                  
1986                    
1987                              
1988                                
1989                                                              
1990                                        
1991                    
1992                    
1993          
1994    /**
1995     * If this collection has already been initialized with
1996     * an identical criteria, it returns the collection.
1997     * Otherwise if this Product is new, it will return
1998     * an empty collection; or if this Product has previously
1999     * been saved, it will retrieve related OnlineSubscriptions from storage.
2000     *
2001     * This method is protected by default in order to keep the public
2002     * api reasonable. You can provide public methods for those you
2003     * actually need in Product.
2004     */

2005    protected List JavaDoc getOnlineSubscriptionsJoinProduct(Criteria criteria)
2006        throws TorqueException
2007    {
2008                    if (collOnlineSubscriptions == null)
2009        {
2010            if (isNew())
2011            {
2012               collOnlineSubscriptions = new ArrayList JavaDoc();
2013            }
2014            else
2015            {
2016                              criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
2017                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
2018            }
2019        }
2020        else
2021        {
2022            // the following code is to determine if a new query is
2023
// called for. If the criteria is the same as the last
2024
// one, just return the collection.
2025

2026                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
2027                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2028            {
2029                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
2030            }
2031        }
2032        lastOnlineSubscriptionsCriteria = criteria;
2033
2034        return collOnlineSubscriptions;
2035                }
2036                  
2037                    
2038                    
2039                                
2040                                                              
2041                                        
2042                    
2043                    
2044          
2045    /**
2046     * If this collection has already been initialized with
2047     * an identical criteria, it returns the collection.
2048     * Otherwise if this Product is new, it will return
2049     * an empty collection; or if this Product has previously
2050     * been saved, it will retrieve related OnlineSubscriptions from storage.
2051     *
2052     * This method is protected by default in order to keep the public
2053     * api reasonable. You can provide public methods for those you
2054     * actually need in Product.
2055     */

2056    protected List JavaDoc getOnlineSubscriptionsJoinSorder(Criteria criteria)
2057        throws TorqueException
2058    {
2059                    if (collOnlineSubscriptions == null)
2060        {
2061            if (isNew())
2062            {
2063               collOnlineSubscriptions = new ArrayList JavaDoc();
2064            }
2065            else
2066            {
2067                              criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
2068                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
2069            }
2070        }
2071        else
2072        {
2073            // the following code is to determine if a new query is
2074
// called for. If the criteria is the same as the last
2075
// one, just return the collection.
2076

2077                        criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId());
2078                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
2079            {
2080                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
2081            }
2082        }
2083        lastOnlineSubscriptionsCriteria = criteria;
2084
2085        return collOnlineSubscriptions;
2086                }
2087                            
2088
2089
2090                          
2091            
2092          /**
2093     * Collection to store aggregation of collInboxEvents
2094     */

2095    protected List JavaDoc collInboxEvents;
2096
2097    /**
2098     * Temporary storage of collInboxEvents to save a possible db hit in
2099     * the event objects are add to the collection, but the
2100     * complete collection is never requested.
2101     */

2102    protected void initInboxEvents()
2103    {
2104        if (collInboxEvents == null)
2105        {
2106            collInboxEvents = new ArrayList JavaDoc();
2107        }
2108    }
2109
2110    /**
2111     * Method called to associate a InboxEvent object to this object
2112     * through the InboxEvent foreign key attribute
2113     *
2114     * @param l InboxEvent
2115     * @throws TorqueException
2116     */

2117    public void addInboxEvent(InboxEvent l) throws TorqueException
2118    {
2119        getInboxEvents().add(l);
2120        l.setProduct((Product) this);
2121    }
2122
2123    /**
2124     * The criteria used to select the current contents of collInboxEvents
2125     */

2126    private Criteria lastInboxEventsCriteria = null;
2127      
2128    /**
2129     * If this collection has already been initialized, returns
2130     * the collection. Otherwise returns the results of
2131     * getInboxEvents(new Criteria())
2132     *
2133     * @throws TorqueException
2134     */

2135    public List JavaDoc getInboxEvents() throws TorqueException
2136    {
2137              if (collInboxEvents == null)
2138        {
2139            collInboxEvents = getInboxEvents(new Criteria(10));
2140        }
2141        return collInboxEvents;
2142          }
2143
2144    /**
2145     * If this collection has already been initialized with
2146     * an identical criteria, it returns the collection.
2147     * Otherwise if this Product has previously
2148     * been saved, it will retrieve related InboxEvents from storage.
2149     * If this Product is new, it will return
2150     * an empty collection or the current collection, the criteria
2151     * is ignored on a new object.
2152     *
2153     * @throws TorqueException
2154     */

2155    public List JavaDoc getInboxEvents(Criteria criteria) throws TorqueException
2156    {
2157              if (collInboxEvents == null)
2158        {
2159            if (isNew())
2160            {
2161               collInboxEvents = new ArrayList JavaDoc();
2162            }
2163            else
2164            {
2165                        criteria.add(InboxEventPeer.PRODUCT_ID, getProductId() );
2166                        collInboxEvents = InboxEventPeer.doSelect(criteria);
2167            }
2168        }
2169        else
2170        {
2171            // criteria has no effect for a new object
2172
if (!isNew())
2173            {
2174                // the following code is to determine if a new query is
2175
// called for. If the criteria is the same as the last
2176
// one, just return the collection.
2177
criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2178                            if (!lastInboxEventsCriteria.equals(criteria))
2179                {
2180                    collInboxEvents = InboxEventPeer.doSelect(criteria);
2181                }
2182            }
2183        }
2184        lastInboxEventsCriteria = criteria;
2185
2186        return collInboxEvents;
2187          }
2188
2189    /**
2190     * If this collection has already been initialized, returns
2191     * the collection. Otherwise returns the results of
2192     * getInboxEvents(new Criteria(),Connection)
2193     * This method takes in the Connection also as input so that
2194     * referenced objects can also be obtained using a Connection
2195     * that is taken as input
2196     */

2197    public List JavaDoc getInboxEvents(Connection JavaDoc con) throws TorqueException
2198    {
2199              if (collInboxEvents == null)
2200        {
2201            collInboxEvents = getInboxEvents(new Criteria(10), con);
2202        }
2203        return collInboxEvents;
2204          }
2205
2206    /**
2207     * If this collection has already been initialized with
2208     * an identical criteria, it returns the collection.
2209     * Otherwise if this Product has previously
2210     * been saved, it will retrieve related InboxEvents from storage.
2211     * If this Product is new, it will return
2212     * an empty collection or the current collection, the criteria
2213     * is ignored on a new object.
2214     * This method takes in the Connection also as input so that
2215     * referenced objects can also be obtained using a Connection
2216     * that is taken as input
2217     */

2218    public List JavaDoc getInboxEvents(Criteria criteria, Connection JavaDoc con)
2219            throws TorqueException
2220    {
2221              if (collInboxEvents == null)
2222        {
2223            if (isNew())
2224            {
2225               collInboxEvents = new ArrayList JavaDoc();
2226            }
2227            else
2228            {
2229                         criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2230                         collInboxEvents = InboxEventPeer.doSelect(criteria, con);
2231             }
2232         }
2233         else
2234         {
2235             // criteria has no effect for a new object
2236
if (!isNew())
2237             {
2238                 // the following code is to determine if a new query is
2239
// called for. If the criteria is the same as the last
2240
// one, just return the collection.
2241
criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2242                             if (!lastInboxEventsCriteria.equals(criteria))
2243                 {
2244                     collInboxEvents = InboxEventPeer.doSelect(criteria, con);
2245                 }
2246             }
2247         }
2248         lastInboxEventsCriteria = criteria;
2249
2250         return collInboxEvents;
2251           }
2252
2253                              
2254              
2255                    
2256                    
2257                                
2258                                                              
2259                                        
2260                    
2261                    
2262          
2263    /**
2264     * If this collection has already been initialized with
2265     * an identical criteria, it returns the collection.
2266     * Otherwise if this Product is new, it will return
2267     * an empty collection; or if this Product has previously
2268     * been saved, it will retrieve related InboxEvents from storage.
2269     *
2270     * This method is protected by default in order to keep the public
2271     * api reasonable. You can provide public methods for those you
2272     * actually need in Product.
2273     */

2274    protected List JavaDoc getInboxEventsJoinCustomer(Criteria criteria)
2275        throws TorqueException
2276    {
2277                    if (collInboxEvents == null)
2278        {
2279            if (isNew())
2280            {
2281               collInboxEvents = new ArrayList JavaDoc();
2282            }
2283            else
2284            {
2285                              criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2286                              collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria);
2287            }
2288        }
2289        else
2290        {
2291            // the following code is to determine if a new query is
2292
// called for. If the criteria is the same as the last
2293
// one, just return the collection.
2294

2295                        criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2296                                    if (!lastInboxEventsCriteria.equals(criteria))
2297            {
2298                collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria);
2299            }
2300        }
2301        lastInboxEventsCriteria = criteria;
2302
2303        return collInboxEvents;
2304                }
2305                  
2306                    
2307                    
2308                                
2309                                                              
2310                                        
2311                    
2312                    
2313          
2314    /**
2315     * If this collection has already been initialized with
2316     * an identical criteria, it returns the collection.
2317     * Otherwise if this Product is new, it will return
2318     * an empty collection; or if this Product has previously
2319     * been saved, it will retrieve related InboxEvents from storage.
2320     *
2321     * This method is protected by default in order to keep the public
2322     * api reasonable. You can provide public methods for those you
2323     * actually need in Product.
2324     */

2325    protected List JavaDoc getInboxEventsJoinProject(Criteria criteria)
2326        throws TorqueException
2327    {
2328                    if (collInboxEvents == null)
2329        {
2330            if (isNew())
2331            {
2332               collInboxEvents = new ArrayList JavaDoc();
2333            }
2334            else
2335            {
2336                              criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2337                              collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria);
2338            }
2339        }
2340        else
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

2346                        criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2347                                    if (!lastInboxEventsCriteria.equals(criteria))
2348            {
2349                collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria);
2350            }
2351        }
2352        lastInboxEventsCriteria = criteria;
2353
2354        return collInboxEvents;
2355                }
2356                  
2357                    
2358                              
2359                                
2360                                                              
2361                                        
2362                    
2363                    
2364          
2365    /**
2366     * If this collection has already been initialized with
2367     * an identical criteria, it returns the collection.
2368     * Otherwise if this Product is new, it will return
2369     * an empty collection; or if this Product has previously
2370     * been saved, it will retrieve related InboxEvents from storage.
2371     *
2372     * This method is protected by default in order to keep the public
2373     * api reasonable. You can provide public methods for those you
2374     * actually need in Product.
2375     */

2376    protected List JavaDoc getInboxEventsJoinProduct(Criteria criteria)
2377        throws TorqueException
2378    {
2379                    if (collInboxEvents == null)
2380        {
2381            if (isNew())
2382            {
2383               collInboxEvents = new ArrayList JavaDoc();
2384            }
2385            else
2386            {
2387                              criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2388                              collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria);
2389            }
2390        }
2391        else
2392        {
2393            // the following code is to determine if a new query is
2394
// called for. If the criteria is the same as the last
2395
// one, just return the collection.
2396

2397                        criteria.add(InboxEventPeer.PRODUCT_ID, getProductId());
2398                                    if (!lastInboxEventsCriteria.equals(criteria))
2399            {
2400                collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria);
2401            }
2402        }
2403        lastInboxEventsCriteria = criteria;
2404
2405        return collInboxEvents;
2406                }
2407                            
2408
2409
2410                          
2411            
2412          /**
2413     * Collection to store aggregation of collOutboxEvents
2414     */

2415    protected List JavaDoc collOutboxEvents;
2416
2417    /**
2418     * Temporary storage of collOutboxEvents to save a possible db hit in
2419     * the event objects are add to the collection, but the
2420     * complete collection is never requested.
2421     */

2422    protected void initOutboxEvents()
2423    {
2424        if (collOutboxEvents == null)
2425        {
2426            collOutboxEvents = new ArrayList JavaDoc();
2427        }
2428    }
2429
2430    /**
2431     * Method called to associate a OutboxEvent object to this object
2432     * through the OutboxEvent foreign key attribute
2433     *
2434     * @param l OutboxEvent
2435     * @throws TorqueException
2436     */

2437    public void addOutboxEvent(OutboxEvent l) throws TorqueException
2438    {
2439        getOutboxEvents().add(l);
2440        l.setProduct((Product) this);
2441    }
2442
2443    /**
2444     * The criteria used to select the current contents of collOutboxEvents
2445     */

2446    private Criteria lastOutboxEventsCriteria = null;
2447      
2448    /**
2449     * If this collection has already been initialized, returns
2450     * the collection. Otherwise returns the results of
2451     * getOutboxEvents(new Criteria())
2452     *
2453     * @throws TorqueException
2454     */

2455    public List JavaDoc getOutboxEvents() throws TorqueException
2456    {
2457              if (collOutboxEvents == null)
2458        {
2459            collOutboxEvents = getOutboxEvents(new Criteria(10));
2460        }
2461        return collOutboxEvents;
2462          }
2463
2464    /**
2465     * If this collection has already been initialized with
2466     * an identical criteria, it returns the collection.
2467     * Otherwise if this Product has previously
2468     * been saved, it will retrieve related OutboxEvents from storage.
2469     * If this Product is new, it will return
2470     * an empty collection or the current collection, the criteria
2471     * is ignored on a new object.
2472     *
2473     * @throws TorqueException
2474     */

2475    public List JavaDoc getOutboxEvents(Criteria criteria) throws TorqueException
2476    {
2477              if (collOutboxEvents == null)
2478        {
2479            if (isNew())
2480            {
2481               collOutboxEvents = new ArrayList JavaDoc();
2482            }
2483            else
2484            {
2485                        criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId() );
2486                        collOutboxEvents = OutboxEventPeer.doSelect(criteria);
2487            }
2488        }
2489        else
2490        {
2491            // criteria has no effect for a new object
2492
if (!isNew())
2493            {
2494                // the following code is to determine if a new query is
2495
// called for. If the criteria is the same as the last
2496
// one, just return the collection.
2497
criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId());
2498                            if (!lastOutboxEventsCriteria.equals(criteria))
2499                {
2500                    collOutboxEvents = OutboxEventPeer.doSelect(criteria);
2501                }
2502            }
2503        }
2504        lastOutboxEventsCriteria = criteria;
2505
2506        return collOutboxEvents;
2507          }
2508
2509    /**
2510     * If this collection has already been initialized, returns
2511     * the collection. Otherwise returns the results of
2512     * getOutboxEvents(new Criteria(),Connection)
2513     * This method takes in the Connection also as input so that
2514     * referenced objects can also be obtained using a Connection
2515     * that is taken as input
2516     */

2517    public List JavaDoc getOutboxEvents(Connection JavaDoc con) throws TorqueException
2518    {
2519              if (collOutboxEvents == null)
2520        {
2521            collOutboxEvents = getOutboxEvents(new Criteria(10), con);
2522        }
2523        return collOutboxEvents;
2524          }
2525
2526    /**
2527     * If this collection has already been initialized with
2528     * an identical criteria, it returns the collection.
2529     * Otherwise if this Product has previously
2530     * been saved, it will retrieve related OutboxEvents from storage.
2531     * If this Product is new, it will return
2532     * an empty collection or the current collection, the criteria
2533     * is ignored on a new object.
2534     * This method takes in the Connection also as input so that
2535     * referenced objects can also be obtained using a Connection
2536     * that is taken as input
2537     */

2538    public List JavaDoc getOutboxEvents(Criteria criteria, Connection JavaDoc con)
2539            throws TorqueException
2540    {
2541              if (collOutboxEvents == null)
2542        {
2543            if (isNew())
2544            {
2545               collOutboxEvents = new ArrayList JavaDoc();
2546            }
2547            else
2548            {
2549                         criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId());
2550                         collOutboxEvents = OutboxEventPeer.doSelect(criteria, con);
2551             }
2552         }
2553         else
2554         {
2555             // criteria has no effect for a new object
2556
if (!isNew())
2557             {
2558                 // the following code is to determine if a new query is
2559
// called for. If the criteria is the same as the last
2560
// one, just return the collection.
2561
criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId());
2562                             if (!lastOutboxEventsCriteria.equals(criteria))
2563                 {
2564                     collOutboxEvents = OutboxEventPeer.doSelect(criteria, con);
2565                 }
2566             }
2567         }
2568         lastOutboxEventsCriteria = criteria;
2569
2570         return collOutboxEvents;
2571           }
2572
2573                              
2574              
2575                    
2576                    
2577                                
2578                                                              
2579                                        
2580                    
2581                    
2582          
2583    /**
2584     * If this collection has already been initialized with
2585     * an identical criteria, it returns the collection.
2586     * Otherwise if this Product is new, it will return
2587     * an empty collection; or if this Product has previously
2588     * been saved, it will retrieve related OutboxEvents from storage.
2589     *
2590     * This method is protected by default in order to keep the public
2591     * api reasonable. You can provide public methods for those you
2592     * actually need in Product.
2593     */

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

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

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

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

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

2717                        criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId());
2718                                    if (!lastOutboxEventsCriteria.equals(criteria))
2719            {
2720                collOutboxEvents = OutboxEventPeer.doSelectJoinProduct(criteria);
2721            }
2722        }
2723        lastOutboxEventsCriteria = criteria;
2724
2725        return collOutboxEvents;
2726                }
2727                            
2728
2729
2730                          
2731            
2732          /**
2733     * Collection to store aggregation of collNewsSubscriptions
2734     */

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

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

2757    public void addNewsSubscription(NewsSubscription l) throws TorqueException
2758    {
2759        getNewsSubscriptions().add(l);
2760        l.setProduct((Product) this);
2761    }
2762
2763    /**
2764     * The criteria used to select the current contents of collNewsSubscriptions
2765     */

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

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

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

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

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

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

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

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

2986                        criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId());
2987                                    if (!lastNewsSubscriptionsCriteria.equals(criteria))
2988            {
2989                collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProduct(criteria);
2990            }
2991        }
2992        lastNewsSubscriptionsCriteria = criteria;
2993
2994        return collNewsSubscriptions;
2995                }
2996                            
2997
2998
2999                                  
3000            
3001          /**
3002     * Collection to store aggregation of collNewslettersRelatedByProductId
3003     */

3004    protected List JavaDoc collNewslettersRelatedByProductId;
3005
3006    /**
3007     * Temporary storage of collNewslettersRelatedByProductId to save a possible db hit in
3008     * the event objects are add to the collection, but the
3009     * complete collection is never requested.
3010     */

3011    protected void initNewslettersRelatedByProductId()
3012    {
3013        if (collNewslettersRelatedByProductId == null)
3014        {
3015            collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3016        }
3017    }
3018
3019    /**
3020     * Method called to associate a Newsletter object to this object
3021     * through the Newsletter foreign key attribute
3022     *
3023     * @param l Newsletter
3024     * @throws TorqueException
3025     */

3026    public void addNewsletterRelatedByProductId(Newsletter l) throws TorqueException
3027    {
3028        getNewslettersRelatedByProductId().add(l);
3029        l.setProductRelatedByProductId((Product) this);
3030    }
3031
3032    /**
3033     * The criteria used to select the current contents of collNewslettersRelatedByProductId
3034     */

3035    private Criteria lastNewslettersRelatedByProductIdCriteria = null;
3036      
3037    /**
3038     * If this collection has already been initialized, returns
3039     * the collection. Otherwise returns the results of
3040     * getNewslettersRelatedByProductId(new Criteria())
3041     *
3042     * @throws TorqueException
3043     */

3044    public List JavaDoc getNewslettersRelatedByProductId() throws TorqueException
3045    {
3046              if (collNewslettersRelatedByProductId == null)
3047        {
3048            collNewslettersRelatedByProductId = getNewslettersRelatedByProductId(new Criteria(10));
3049        }
3050        return collNewslettersRelatedByProductId;
3051          }
3052
3053    /**
3054     * If this collection has already been initialized with
3055     * an identical criteria, it returns the collection.
3056     * Otherwise if this Product has previously
3057     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3058     * If this Product is new, it will return
3059     * an empty collection or the current collection, the criteria
3060     * is ignored on a new object.
3061     *
3062     * @throws TorqueException
3063     */

3064    public List JavaDoc getNewslettersRelatedByProductId(Criteria criteria) throws TorqueException
3065    {
3066              if (collNewslettersRelatedByProductId == null)
3067        {
3068            if (isNew())
3069            {
3070               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3071            }
3072            else
3073            {
3074                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId() );
3075                        collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria);
3076            }
3077        }
3078        else
3079        {
3080            // criteria has no effect for a new object
3081
if (!isNew())
3082            {
3083                // the following code is to determine if a new query is
3084
// called for. If the criteria is the same as the last
3085
// one, just return the collection.
3086
criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3087                            if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3088                {
3089                    collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria);
3090                }
3091            }
3092        }
3093        lastNewslettersRelatedByProductIdCriteria = criteria;
3094
3095        return collNewslettersRelatedByProductId;
3096          }
3097
3098    /**
3099     * If this collection has already been initialized, returns
3100     * the collection. Otherwise returns the results of
3101     * getNewslettersRelatedByProductId(new Criteria(),Connection)
3102     * This method takes in the Connection also as input so that
3103     * referenced objects can also be obtained using a Connection
3104     * that is taken as input
3105     */

3106    public List JavaDoc getNewslettersRelatedByProductId(Connection JavaDoc con) throws TorqueException
3107    {
3108              if (collNewslettersRelatedByProductId == null)
3109        {
3110            collNewslettersRelatedByProductId = getNewslettersRelatedByProductId(new Criteria(10), con);
3111        }
3112        return collNewslettersRelatedByProductId;
3113          }
3114
3115    /**
3116     * If this collection has already been initialized with
3117     * an identical criteria, it returns the collection.
3118     * Otherwise if this Product has previously
3119     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3120     * If this Product is new, it will return
3121     * an empty collection or the current collection, the criteria
3122     * is ignored on a new object.
3123     * This method takes in the Connection also as input so that
3124     * referenced objects can also be obtained using a Connection
3125     * that is taken as input
3126     */

3127    public List JavaDoc getNewslettersRelatedByProductId(Criteria criteria, Connection JavaDoc con)
3128            throws TorqueException
3129    {
3130              if (collNewslettersRelatedByProductId == null)
3131        {
3132            if (isNew())
3133            {
3134               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3135            }
3136            else
3137            {
3138                         criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3139                         collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria, con);
3140             }
3141         }
3142         else
3143         {
3144             // criteria has no effect for a new object
3145
if (!isNew())
3146             {
3147                 // the following code is to determine if a new query is
3148
// called for. If the criteria is the same as the last
3149
// one, just return the collection.
3150
criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3151                             if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3152                 {
3153                     collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria, con);
3154                 }
3155             }
3156         }
3157         lastNewslettersRelatedByProductIdCriteria = criteria;
3158
3159         return collNewslettersRelatedByProductId;
3160           }
3161
3162                                                            
3163              
3164                    
3165                    
3166                                
3167                                                              
3168                                        
3169                    
3170                                
3171          
3172    /**
3173     * If this collection has already been initialized with
3174     * an identical criteria, it returns the collection.
3175     * Otherwise if this Product is new, it will return
3176     * an empty collection; or if this Product has previously
3177     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3178     *
3179     * This method is protected by default in order to keep the public
3180     * api reasonable. You can provide public methods for those you
3181     * actually need in Product.
3182     */

3183    protected List JavaDoc getNewslettersRelatedByProductIdJoinCustomerCategory(Criteria criteria)
3184        throws TorqueException
3185    {
3186                    if (collNewslettersRelatedByProductId == null)
3187        {
3188            if (isNew())
3189            {
3190               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3191            }
3192            else
3193            {
3194                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3195                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
3196            }
3197        }
3198        else
3199        {
3200            // the following code is to determine if a new query is
3201
// called for. If the criteria is the same as the last
3202
// one, just return the collection.
3203

3204                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3205                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3206            {
3207                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
3208            }
3209        }
3210        lastNewslettersRelatedByProductIdCriteria = criteria;
3211
3212        return collNewslettersRelatedByProductId;
3213                }
3214                  
3215                    
3216                    
3217                                            
3218                                                                          
3219                                        
3220                    
3221                                
3222          
3223    /**
3224     * If this collection has already been initialized with
3225     * an identical criteria, it returns the collection.
3226     * Otherwise if this Product is new, it will return
3227     * an empty collection; or if this Product has previously
3228     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3229     *
3230     * This method is protected by default in order to keep the public
3231     * api reasonable. You can provide public methods for those you
3232     * actually need in Product.
3233     */

3234    protected List JavaDoc getNewslettersRelatedByProductIdJoinProjectRelatedByProjectId(Criteria criteria)
3235        throws TorqueException
3236    {
3237                    if (collNewslettersRelatedByProductId == null)
3238        {
3239            if (isNew())
3240            {
3241               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3242            }
3243            else
3244            {
3245                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3246                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
3247            }
3248        }
3249        else
3250        {
3251            // the following code is to determine if a new query is
3252
// called for. If the criteria is the same as the last
3253
// one, just return the collection.
3254

3255                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3256                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3257            {
3258                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
3259            }
3260        }
3261        lastNewslettersRelatedByProductIdCriteria = criteria;
3262
3263        return collNewslettersRelatedByProductId;
3264                }
3265                  
3266                    
3267                              
3268                                            
3269                                                                          
3270                                        
3271                    
3272                                            
3273                  
3274                    
3275                    
3276                                            
3277                                                                          
3278                                        
3279                    
3280                                
3281          
3282    /**
3283     * If this collection has already been initialized with
3284     * an identical criteria, it returns the collection.
3285     * Otherwise if this Product is new, it will return
3286     * an empty collection; or if this Product has previously
3287     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3288     *
3289     * This method is protected by default in order to keep the public
3290     * api reasonable. You can provide public methods for those you
3291     * actually need in Product.
3292     */

3293    protected List JavaDoc getNewslettersRelatedByProductIdJoinProjectRelatedByRelProjectId(Criteria criteria)
3294        throws TorqueException
3295    {
3296                    if (collNewslettersRelatedByProductId == null)
3297        {
3298            if (isNew())
3299            {
3300               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3301            }
3302            else
3303            {
3304                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3305                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
3306            }
3307        }
3308        else
3309        {
3310            // the following code is to determine if a new query is
3311
// called for. If the criteria is the same as the last
3312
// one, just return the collection.
3313

3314                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3315                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3316            {
3317                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
3318            }
3319        }
3320        lastNewslettersRelatedByProductIdCriteria = criteria;
3321
3322        return collNewslettersRelatedByProductId;
3323                }
3324                  
3325                    
3326                              
3327                                            
3328                                                                          
3329                                        
3330                    
3331                                
3332          
3333    /**
3334     * If this collection has already been initialized with
3335     * an identical criteria, it returns the collection.
3336     * Otherwise if this Product is new, it will return
3337     * an empty collection; or if this Product has previously
3338     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3339     *
3340     * This method is protected by default in order to keep the public
3341     * api reasonable. You can provide public methods for those you
3342     * actually need in Product.
3343     */

3344    protected List JavaDoc getNewslettersRelatedByProductIdJoinProductRelatedByRelProductId(Criteria criteria)
3345        throws TorqueException
3346    {
3347                    if (collNewslettersRelatedByProductId == null)
3348        {
3349            if (isNew())
3350            {
3351               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3352            }
3353            else
3354            {
3355                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3356                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
3357            }
3358        }
3359        else
3360        {
3361            // the following code is to determine if a new query is
3362
// called for. If the criteria is the same as the last
3363
// one, just return the collection.
3364

3365                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3366                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3367            {
3368                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
3369            }
3370        }
3371        lastNewslettersRelatedByProductIdCriteria = criteria;
3372
3373        return collNewslettersRelatedByProductId;
3374                }
3375                  
3376                    
3377                    
3378                                
3379                                                              
3380                                        
3381                    
3382                                
3383          
3384    /**
3385     * If this collection has already been initialized with
3386     * an identical criteria, it returns the collection.
3387     * Otherwise if this Product is new, it will return
3388     * an empty collection; or if this Product has previously
3389     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3390     *
3391     * This method is protected by default in order to keep the public
3392     * api reasonable. You can provide public methods for those you
3393     * actually need in Product.
3394     */

3395    protected List JavaDoc getNewslettersRelatedByProductIdJoinCountry(Criteria criteria)
3396        throws TorqueException
3397    {
3398                    if (collNewslettersRelatedByProductId == null)
3399        {
3400            if (isNew())
3401            {
3402               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3403            }
3404            else
3405            {
3406                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3407                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCountry(criteria);
3408            }
3409        }
3410        else
3411        {
3412            // the following code is to determine if a new query is
3413
// called for. If the criteria is the same as the last
3414
// one, just return the collection.
3415

3416                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3417                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3418            {
3419                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCountry(criteria);
3420            }
3421        }
3422        lastNewslettersRelatedByProductIdCriteria = criteria;
3423
3424        return collNewslettersRelatedByProductId;
3425                }
3426                  
3427                    
3428                    
3429                                            
3430                                                                          
3431                                        
3432                    
3433                                
3434          
3435    /**
3436     * If this collection has already been initialized with
3437     * an identical criteria, it returns the collection.
3438     * Otherwise if this Product is new, it will return
3439     * an empty collection; or if this Product has previously
3440     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3441     *
3442     * This method is protected by default in order to keep the public
3443     * api reasonable. You can provide public methods for those you
3444     * actually need in Product.
3445     */

3446    protected List JavaDoc getNewslettersRelatedByProductIdJoinLanguageRelatedByCustLanguageId(Criteria criteria)
3447        throws TorqueException
3448    {
3449                    if (collNewslettersRelatedByProductId == null)
3450        {
3451            if (isNew())
3452            {
3453               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3454            }
3455            else
3456            {
3457                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3458                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
3459            }
3460        }
3461        else
3462        {
3463            // the following code is to determine if a new query is
3464
// called for. If the criteria is the same as the last
3465
// one, just return the collection.
3466

3467                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3468                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3469            {
3470                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
3471            }
3472        }
3473        lastNewslettersRelatedByProductIdCriteria = criteria;
3474
3475        return collNewslettersRelatedByProductId;
3476                }
3477                  
3478                    
3479                    
3480                                            
3481                                                                          
3482                                        
3483                    
3484                                
3485          
3486    /**
3487     * If this collection has already been initialized with
3488     * an identical criteria, it returns the collection.
3489     * Otherwise if this Product is new, it will return
3490     * an empty collection; or if this Product has previously
3491     * been saved, it will retrieve related NewslettersRelatedByProductId from storage.
3492     *
3493     * This method is protected by default in order to keep the public
3494     * api reasonable. You can provide public methods for those you
3495     * actually need in Product.
3496     */

3497    protected List JavaDoc getNewslettersRelatedByProductIdJoinLanguageRelatedByLanguageId(Criteria criteria)
3498        throws TorqueException
3499    {
3500                    if (collNewslettersRelatedByProductId == null)
3501        {
3502            if (isNew())
3503            {
3504               collNewslettersRelatedByProductId = new ArrayList JavaDoc();
3505            }
3506            else
3507            {
3508                              criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3509                              collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
3510            }
3511        }
3512        else
3513        {
3514            // the following code is to determine if a new query is
3515
// called for. If the criteria is the same as the last
3516
// one, just return the collection.
3517

3518                        criteria.add(NewsletterPeer.PRODUCT_ID, getProductId());
3519                                    if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria))
3520            {
3521                collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
3522            }
3523        }
3524        lastNewslettersRelatedByProductIdCriteria = criteria;
3525
3526        return collNewslettersRelatedByProductId;
3527                }
3528                            
3529
3530
3531                                  
3532            
3533          /**
3534     * Collection to store aggregation of collNewslettersRelatedByRelProductId
3535     */

3536    protected List JavaDoc collNewslettersRelatedByRelProductId;
3537
3538    /**
3539     * Temporary storage of collNewslettersRelatedByRelProductId to save a possible db hit in
3540     * the event objects are add to the collection, but the
3541     * complete collection is never requested.
3542     */

3543    protected void initNewslettersRelatedByRelProductId()
3544    {
3545        if (collNewslettersRelatedByRelProductId == null)
3546        {
3547            collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3548        }
3549    }
3550
3551    /**
3552     * Method called to associate a Newsletter object to this object
3553     * through the Newsletter foreign key attribute
3554     *
3555     * @param l Newsletter
3556     * @throws TorqueException
3557     */

3558    public void addNewsletterRelatedByRelProductId(Newsletter l) throws TorqueException
3559    {
3560        getNewslettersRelatedByRelProductId().add(l);
3561        l.setProductRelatedByRelProductId((Product) this);
3562    }
3563
3564    /**
3565     * The criteria used to select the current contents of collNewslettersRelatedByRelProductId
3566     */

3567    private Criteria lastNewslettersRelatedByRelProductIdCriteria = null;
3568      
3569    /**
3570     * If this collection has already been initialized, returns
3571     * the collection. Otherwise returns the results of
3572     * getNewslettersRelatedByRelProductId(new Criteria())
3573     *
3574     * @throws TorqueException
3575     */

3576    public List JavaDoc getNewslettersRelatedByRelProductId() throws TorqueException
3577    {
3578              if (collNewslettersRelatedByRelProductId == null)
3579        {
3580            collNewslettersRelatedByRelProductId = getNewslettersRelatedByRelProductId(new Criteria(10));
3581        }
3582        return collNewslettersRelatedByRelProductId;
3583          }
3584
3585    /**
3586     * If this collection has already been initialized with
3587     * an identical criteria, it returns the collection.
3588     * Otherwise if this Product has previously
3589     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3590     * If this Product is new, it will return
3591     * an empty collection or the current collection, the criteria
3592     * is ignored on a new object.
3593     *
3594     * @throws TorqueException
3595     */

3596    public List JavaDoc getNewslettersRelatedByRelProductId(Criteria criteria) throws TorqueException
3597    {
3598              if (collNewslettersRelatedByRelProductId == null)
3599        {
3600            if (isNew())
3601            {
3602               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3603            }
3604            else
3605            {
3606                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId() );
3607                        collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria);
3608            }
3609        }
3610        else
3611        {
3612            // criteria has no effect for a new object
3613
if (!isNew())
3614            {
3615                // the following code is to determine if a new query is
3616
// called for. If the criteria is the same as the last
3617
// one, just return the collection.
3618
criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3619                            if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3620                {
3621                    collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria);
3622                }
3623            }
3624        }
3625        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3626
3627        return collNewslettersRelatedByRelProductId;
3628          }
3629
3630    /**
3631     * If this collection has already been initialized, returns
3632     * the collection. Otherwise returns the results of
3633     * getNewslettersRelatedByRelProductId(new Criteria(),Connection)
3634     * This method takes in the Connection also as input so that
3635     * referenced objects can also be obtained using a Connection
3636     * that is taken as input
3637     */

3638    public List JavaDoc getNewslettersRelatedByRelProductId(Connection JavaDoc con) throws TorqueException
3639    {
3640              if (collNewslettersRelatedByRelProductId == null)
3641        {
3642            collNewslettersRelatedByRelProductId = getNewslettersRelatedByRelProductId(new Criteria(10), con);
3643        }
3644        return collNewslettersRelatedByRelProductId;
3645          }
3646
3647    /**
3648     * If this collection has already been initialized with
3649     * an identical criteria, it returns the collection.
3650     * Otherwise if this Product has previously
3651     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3652     * If this Product is new, it will return
3653     * an empty collection or the current collection, the criteria
3654     * is ignored on a new object.
3655     * This method takes in the Connection also as input so that
3656     * referenced objects can also be obtained using a Connection
3657     * that is taken as input
3658     */

3659    public List JavaDoc getNewslettersRelatedByRelProductId(Criteria criteria, Connection JavaDoc con)
3660            throws TorqueException
3661    {
3662              if (collNewslettersRelatedByRelProductId == null)
3663        {
3664            if (isNew())
3665            {
3666               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3667            }
3668            else
3669            {
3670                         criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3671                         collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria, con);
3672             }
3673         }
3674         else
3675         {
3676             // criteria has no effect for a new object
3677
if (!isNew())
3678             {
3679                 // the following code is to determine if a new query is
3680
// called for. If the criteria is the same as the last
3681
// one, just return the collection.
3682
criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3683                             if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3684                 {
3685                     collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria, con);
3686                 }
3687             }
3688         }
3689         lastNewslettersRelatedByRelProductIdCriteria = criteria;
3690
3691         return collNewslettersRelatedByRelProductId;
3692           }
3693
3694                                                            
3695              
3696                    
3697                    
3698                                
3699                                                              
3700                                        
3701                    
3702                                
3703          
3704    /**
3705     * If this collection has already been initialized with
3706     * an identical criteria, it returns the collection.
3707     * Otherwise if this Product is new, it will return
3708     * an empty collection; or if this Product has previously
3709     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3710     *
3711     * This method is protected by default in order to keep the public
3712     * api reasonable. You can provide public methods for those you
3713     * actually need in Product.
3714     */

3715    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinCustomerCategory(Criteria criteria)
3716        throws TorqueException
3717    {
3718                    if (collNewslettersRelatedByRelProductId == null)
3719        {
3720            if (isNew())
3721            {
3722               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3723            }
3724            else
3725            {
3726                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3727                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
3728            }
3729        }
3730        else
3731        {
3732            // the following code is to determine if a new query is
3733
// called for. If the criteria is the same as the last
3734
// one, just return the collection.
3735

3736                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3737                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3738            {
3739                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
3740            }
3741        }
3742        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3743
3744        return collNewslettersRelatedByRelProductId;
3745                }
3746                  
3747                    
3748                    
3749                                            
3750                                                                          
3751                                        
3752                    
3753                                
3754          
3755    /**
3756     * If this collection has already been initialized with
3757     * an identical criteria, it returns the collection.
3758     * Otherwise if this Product is new, it will return
3759     * an empty collection; or if this Product has previously
3760     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3761     *
3762     * This method is protected by default in order to keep the public
3763     * api reasonable. You can provide public methods for those you
3764     * actually need in Product.
3765     */

3766    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinProjectRelatedByProjectId(Criteria criteria)
3767        throws TorqueException
3768    {
3769                    if (collNewslettersRelatedByRelProductId == null)
3770        {
3771            if (isNew())
3772            {
3773               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3774            }
3775            else
3776            {
3777                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3778                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
3779            }
3780        }
3781        else
3782        {
3783            // the following code is to determine if a new query is
3784
// called for. If the criteria is the same as the last
3785
// one, just return the collection.
3786

3787                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3788                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3789            {
3790                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
3791            }
3792        }
3793        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3794
3795        return collNewslettersRelatedByRelProductId;
3796                }
3797                  
3798                    
3799                              
3800                                            
3801                                                                          
3802                                        
3803                    
3804                                
3805          
3806    /**
3807     * If this collection has already been initialized with
3808     * an identical criteria, it returns the collection.
3809     * Otherwise if this Product is new, it will return
3810     * an empty collection; or if this Product has previously
3811     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3812     *
3813     * This method is protected by default in order to keep the public
3814     * api reasonable. You can provide public methods for those you
3815     * actually need in Product.
3816     */

3817    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinProductRelatedByProductId(Criteria criteria)
3818        throws TorqueException
3819    {
3820                    if (collNewslettersRelatedByRelProductId == null)
3821        {
3822            if (isNew())
3823            {
3824               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3825            }
3826            else
3827            {
3828                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3829                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
3830            }
3831        }
3832        else
3833        {
3834            // the following code is to determine if a new query is
3835
// called for. If the criteria is the same as the last
3836
// one, just return the collection.
3837

3838                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3839                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3840            {
3841                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
3842            }
3843        }
3844        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3845
3846        return collNewslettersRelatedByRelProductId;
3847                }
3848                  
3849                    
3850                    
3851                                            
3852                                                                          
3853                                        
3854                    
3855                                
3856          
3857    /**
3858     * If this collection has already been initialized with
3859     * an identical criteria, it returns the collection.
3860     * Otherwise if this Product is new, it will return
3861     * an empty collection; or if this Product has previously
3862     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3863     *
3864     * This method is protected by default in order to keep the public
3865     * api reasonable. You can provide public methods for those you
3866     * actually need in Product.
3867     */

3868    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinProjectRelatedByRelProjectId(Criteria criteria)
3869        throws TorqueException
3870    {
3871                    if (collNewslettersRelatedByRelProductId == null)
3872        {
3873            if (isNew())
3874            {
3875               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3876            }
3877            else
3878            {
3879                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3880                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
3881            }
3882        }
3883        else
3884        {
3885            // the following code is to determine if a new query is
3886
// called for. If the criteria is the same as the last
3887
// one, just return the collection.
3888

3889                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3890                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3891            {
3892                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
3893            }
3894        }
3895        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3896
3897        return collNewslettersRelatedByRelProductId;
3898                }
3899                  
3900                    
3901                              
3902                                            
3903                                                                          
3904                                        
3905                    
3906                                            
3907                  
3908                    
3909                    
3910                                
3911                                                              
3912                                        
3913                    
3914                                
3915          
3916    /**
3917     * If this collection has already been initialized with
3918     * an identical criteria, it returns the collection.
3919     * Otherwise if this Product is new, it will return
3920     * an empty collection; or if this Product has previously
3921     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3922     *
3923     * This method is protected by default in order to keep the public
3924     * api reasonable. You can provide public methods for those you
3925     * actually need in Product.
3926     */

3927    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinCountry(Criteria criteria)
3928        throws TorqueException
3929    {
3930                    if (collNewslettersRelatedByRelProductId == null)
3931        {
3932            if (isNew())
3933            {
3934               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3935            }
3936            else
3937            {
3938                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3939                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCountry(criteria);
3940            }
3941        }
3942        else
3943        {
3944            // the following code is to determine if a new query is
3945
// called for. If the criteria is the same as the last
3946
// one, just return the collection.
3947

3948                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3949                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
3950            {
3951                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCountry(criteria);
3952            }
3953        }
3954        lastNewslettersRelatedByRelProductIdCriteria = criteria;
3955
3956        return collNewslettersRelatedByRelProductId;
3957                }
3958                  
3959                    
3960                    
3961                                            
3962                                                                          
3963                                        
3964                    
3965                                
3966          
3967    /**
3968     * If this collection has already been initialized with
3969     * an identical criteria, it returns the collection.
3970     * Otherwise if this Product is new, it will return
3971     * an empty collection; or if this Product has previously
3972     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
3973     *
3974     * This method is protected by default in order to keep the public
3975     * api reasonable. You can provide public methods for those you
3976     * actually need in Product.
3977     */

3978    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinLanguageRelatedByCustLanguageId(Criteria criteria)
3979        throws TorqueException
3980    {
3981                    if (collNewslettersRelatedByRelProductId == null)
3982        {
3983            if (isNew())
3984            {
3985               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
3986            }
3987            else
3988            {
3989                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
3990                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
3991            }
3992        }
3993        else
3994        {
3995            // the following code is to determine if a new query is
3996
// called for. If the criteria is the same as the last
3997
// one, just return the collection.
3998

3999                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
4000                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
4001            {
4002                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
4003            }
4004        }
4005        lastNewslettersRelatedByRelProductIdCriteria = criteria;
4006
4007        return collNewslettersRelatedByRelProductId;
4008                }
4009                  
4010                    
4011                    
4012                                            
4013                                                                          
4014                                        
4015                    
4016                                
4017          
4018    /**
4019     * If this collection has already been initialized with
4020     * an identical criteria, it returns the collection.
4021     * Otherwise if this Product is new, it will return
4022     * an empty collection; or if this Product has previously
4023     * been saved, it will retrieve related NewslettersRelatedByRelProductId from storage.
4024     *
4025     * This method is protected by default in order to keep the public
4026     * api reasonable. You can provide public methods for those you
4027     * actually need in Product.
4028     */

4029    protected List JavaDoc getNewslettersRelatedByRelProductIdJoinLanguageRelatedByLanguageId(Criteria criteria)
4030        throws TorqueException
4031    {
4032                    if (collNewslettersRelatedByRelProductId == null)
4033        {
4034            if (isNew())
4035            {
4036               collNewslettersRelatedByRelProductId = new ArrayList JavaDoc();
4037            }
4038            else
4039            {
4040                              criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
4041                              collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
4042            }
4043        }
4044        else
4045        {
4046            // the following code is to determine if a new query is
4047
// called for. If the criteria is the same as the last
4048
// one, just return the collection.
4049

4050                        criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId());
4051                                    if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria))
4052            {
4053                collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
4054            }
4055        }
4056        lastNewslettersRelatedByRelProductIdCriteria = criteria;
4057
4058        return collNewslettersRelatedByRelProductId;
4059                }
4060                            
4061
4062
4063                          
4064            
4065          /**
4066     * Collection to store aggregation of collSorderItems
4067     */

4068    protected List JavaDoc collSorderItems;
4069
4070    /**
4071     * Temporary storage of collSorderItems to save a possible db hit in
4072     * the event objects are add to the collection, but the
4073     * complete collection is never requested.
4074     */

4075    protected void initSorderItems()
4076    {
4077        if (collSorderItems == null)
4078        {
4079            collSorderItems = new ArrayList JavaDoc();
4080        }
4081    }
4082
4083    /**
4084     * Method called to associate a SorderItem object to this object
4085     * through the SorderItem foreign key attribute
4086     *
4087     * @param l SorderItem
4088     * @throws TorqueException
4089     */

4090    public void addSorderItem(SorderItem l) throws TorqueException
4091    {
4092        getSorderItems().add(l);
4093        l.setProduct((Product) this);
4094    }
4095
4096    /**
4097     * The criteria used to select the current contents of collSorderItems
4098     */

4099    private Criteria lastSorderItemsCriteria = null;
4100      
4101    /**
4102     * If this collection has already been initialized, returns
4103     * the collection. Otherwise returns the results of
4104     * getSorderItems(new Criteria())
4105     *
4106     * @throws TorqueException
4107     */

4108    public List JavaDoc getSorderItems() throws TorqueException
4109    {
4110              if (collSorderItems == null)
4111        {
4112            collSorderItems = getSorderItems(new Criteria(10));
4113        }
4114        return collSorderItems;
4115          }
4116
4117    /**
4118     * If this collection has already been initialized with
4119     * an identical criteria, it returns the collection.
4120     * Otherwise if this Product has previously
4121     * been saved, it will retrieve related SorderItems from storage.
4122     * If this Product is new, it will return
4123     * an empty collection or the current collection, the criteria
4124     * is ignored on a new object.
4125     *
4126     * @throws TorqueException
4127     */

4128    public List JavaDoc getSorderItems(Criteria criteria) throws TorqueException
4129    {
4130              if (collSorderItems == null)
4131        {
4132            if (isNew())
4133            {
4134               collSorderItems = new ArrayList JavaDoc();
4135            }
4136            else
4137            {
4138                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId() );
4139                        collSorderItems = SorderItemPeer.doSelect(criteria);
4140            }
4141        }
4142        else
4143        {
4144            // criteria has no effect for a new object
4145
if (!isNew())
4146            {
4147                // the following code is to determine if a new query is
4148
// called for. If the criteria is the same as the last
4149
// one, just return the collection.
4150
criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4151                            if (!lastSorderItemsCriteria.equals(criteria))
4152                {
4153                    collSorderItems = SorderItemPeer.doSelect(criteria);
4154                }
4155            }
4156        }
4157        lastSorderItemsCriteria = criteria;
4158
4159        return collSorderItems;
4160          }
4161
4162    /**
4163     * If this collection has already been initialized, returns
4164     * the collection. Otherwise returns the results of
4165     * getSorderItems(new Criteria(),Connection)
4166     * This method takes in the Connection also as input so that
4167     * referenced objects can also be obtained using a Connection
4168     * that is taken as input
4169     */

4170    public List JavaDoc getSorderItems(Connection JavaDoc con) throws TorqueException
4171    {
4172              if (collSorderItems == null)
4173        {
4174            collSorderItems = getSorderItems(new Criteria(10), con);
4175        }
4176        return collSorderItems;
4177          }
4178
4179    /**
4180     * If this collection has already been initialized with
4181     * an identical criteria, it returns the collection.
4182     * Otherwise if this Product has previously
4183     * been saved, it will retrieve related SorderItems from storage.
4184     * If this Product is new, it will return
4185     * an empty collection or the current collection, the criteria
4186     * is ignored on a new object.
4187     * This method takes in the Connection also as input so that
4188     * referenced objects can also be obtained using a Connection
4189     * that is taken as input
4190     */

4191    public List JavaDoc getSorderItems(Criteria criteria, Connection JavaDoc con)
4192            throws TorqueException
4193    {
4194              if (collSorderItems == null)
4195        {
4196            if (isNew())
4197            {
4198               collSorderItems = new ArrayList JavaDoc();
4199            }
4200            else
4201            {
4202                         criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4203                         collSorderItems = SorderItemPeer.doSelect(criteria, con);
4204             }
4205         }
4206         else
4207         {
4208             // criteria has no effect for a new object
4209
if (!isNew())
4210             {
4211                 // the following code is to determine if a new query is
4212
// called for. If the criteria is the same as the last
4213
// one, just return the collection.
4214
criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4215                             if (!lastSorderItemsCriteria.equals(criteria))
4216                 {
4217                     collSorderItems = SorderItemPeer.doSelect(criteria, con);
4218                 }
4219             }
4220         }
4221         lastSorderItemsCriteria = criteria;
4222
4223         return collSorderItems;
4224           }
4225
4226                                                
4227              
4228                    
4229                    
4230                                
4231                                                              
4232                                        
4233                    
4234                    
4235          
4236    /**
4237     * If this collection has already been initialized with
4238     * an identical criteria, it returns the collection.
4239     * Otherwise if this Product is new, it will return
4240     * an empty collection; or if this Product has previously
4241     * been saved, it will retrieve related SorderItems from storage.
4242     *
4243     * This method is protected by default in order to keep the public
4244     * api reasonable. You can provide public methods for those you
4245     * actually need in Product.
4246     */

4247    protected List JavaDoc getSorderItemsJoinSorder(Criteria criteria)
4248        throws TorqueException
4249    {
4250                    if (collSorderItems == null)
4251        {
4252            if (isNew())
4253            {
4254               collSorderItems = new ArrayList JavaDoc();
4255            }
4256            else
4257            {
4258                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4259                              collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
4260            }
4261        }
4262        else
4263        {
4264            // the following code is to determine if a new query is
4265
// called for. If the criteria is the same as the last
4266
// one, just return the collection.
4267

4268                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4269                                    if (!lastSorderItemsCriteria.equals(criteria))
4270            {
4271                collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
4272            }
4273        }
4274        lastSorderItemsCriteria = criteria;
4275
4276        return collSorderItems;
4277                }
4278                  
4279                    
4280                              
4281                                
4282                                                              
4283                                        
4284                    
4285                    
4286          
4287    /**
4288     * If this collection has already been initialized with
4289     * an identical criteria, it returns the collection.
4290     * Otherwise if this Product is new, it will return
4291     * an empty collection; or if this Product has previously
4292     * been saved, it will retrieve related SorderItems from storage.
4293     *
4294     * This method is protected by default in order to keep the public
4295     * api reasonable. You can provide public methods for those you
4296     * actually need in Product.
4297     */

4298    protected List JavaDoc getSorderItemsJoinProduct(Criteria criteria)
4299        throws TorqueException
4300    {
4301                    if (collSorderItems == null)
4302        {
4303            if (isNew())
4304            {
4305               collSorderItems = new ArrayList JavaDoc();
4306            }
4307            else
4308            {
4309                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4310                              collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
4311            }
4312        }
4313        else
4314        {
4315            // the following code is to determine if a new query is
4316
// called for. If the criteria is the same as the last
4317
// one, just return the collection.
4318

4319                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4320                                    if (!lastSorderItemsCriteria.equals(criteria))
4321            {
4322                collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
4323            }
4324        }
4325        lastSorderItemsCriteria = criteria;
4326
4327        return collSorderItems;
4328                }
4329                  
4330                    
4331                    
4332                                            
4333                                                                          
4334                                        
4335                    
4336                    
4337          
4338    /**
4339     * If this collection has already been initialized with
4340     * an identical criteria, it returns the collection.
4341     * Otherwise if this Product is new, it will return
4342     * an empty collection; or if this Product has previously
4343     * been saved, it will retrieve related SorderItems from storage.
4344     *
4345     * This method is protected by default in order to keep the public
4346     * api reasonable. You can provide public methods for those you
4347     * actually need in Product.
4348     */

4349    protected List JavaDoc getSorderItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
4350        throws TorqueException
4351    {
4352                    if (collSorderItems == null)
4353        {
4354            if (isNew())
4355            {
4356               collSorderItems = new ArrayList JavaDoc();
4357            }
4358            else
4359            {
4360                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4361                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4362            }
4363        }
4364        else
4365        {
4366            // the following code is to determine if a new query is
4367
// called for. If the criteria is the same as the last
4368
// one, just return the collection.
4369

4370                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4371                                    if (!lastSorderItemsCriteria.equals(criteria))
4372            {
4373                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
4374            }
4375        }
4376        lastSorderItemsCriteria = criteria;
4377
4378        return collSorderItems;
4379                }
4380                  
4381                    
4382                    
4383                                            
4384                                                                          
4385                                        
4386                    
4387                    
4388          
4389    /**
4390     * If this collection has already been initialized with
4391     * an identical criteria, it returns the collection.
4392     * Otherwise if this Product is new, it will return
4393     * an empty collection; or if this Product has previously
4394     * been saved, it will retrieve related SorderItems from storage.
4395     *
4396     * This method is protected by default in order to keep the public
4397     * api reasonable. You can provide public methods for those you
4398     * actually need in Product.
4399     */

4400    protected List JavaDoc getSorderItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
4401        throws TorqueException
4402    {
4403                    if (collSorderItems == null)
4404        {
4405            if (isNew())
4406            {
4407               collSorderItems = new ArrayList JavaDoc();
4408            }
4409            else
4410            {
4411                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4412                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4413            }
4414        }
4415        else
4416        {
4417            // the following code is to determine if a new query is
4418
// called for. If the criteria is the same as the last
4419
// one, just return the collection.
4420

4421                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4422                                    if (!lastSorderItemsCriteria.equals(criteria))
4423            {
4424                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
4425            }
4426        }
4427        lastSorderItemsCriteria = criteria;
4428
4429        return collSorderItems;
4430                }
4431                  
4432                    
4433                    
4434                                
4435                                                              
4436                                        
4437                    
4438                    
4439          
4440    /**
4441     * If this collection has already been initialized with
4442     * an identical criteria, it returns the collection.
4443     * Otherwise if this Product is new, it will return
4444     * an empty collection; or if this Product has previously
4445     * been saved, it will retrieve related SorderItems from storage.
4446     *
4447     * This method is protected by default in order to keep the public
4448     * api reasonable. You can provide public methods for those you
4449     * actually need in Product.
4450     */

4451    protected List JavaDoc getSorderItemsJoinProject(Criteria criteria)
4452        throws TorqueException
4453    {
4454                    if (collSorderItems == null)
4455        {
4456            if (isNew())
4457            {
4458               collSorderItems = new ArrayList JavaDoc();
4459            }
4460            else
4461            {
4462                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4463                              collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
4464            }
4465        }
4466        else
4467        {
4468            // the following code is to determine if a new query is
4469
// called for. If the criteria is the same as the last
4470
// one, just return the collection.
4471

4472                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4473                                    if (!lastSorderItemsCriteria.equals(criteria))
4474            {
4475                collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
4476            }
4477        }
4478        lastSorderItemsCriteria = criteria;
4479
4480        return collSorderItems;
4481                }
4482                  
4483                    
4484                    
4485                                
4486                                                              
4487                                        
4488                    
4489                    
4490          
4491    /**
4492     * If this collection has already been initialized with
4493     * an identical criteria, it returns the collection.
4494     * Otherwise if this Product is new, it will return
4495     * an empty collection; or if this Product has previously
4496     * been saved, it will retrieve related SorderItems from storage.
4497     *
4498     * This method is protected by default in order to keep the public
4499     * api reasonable. You can provide public methods for those you
4500     * actually need in Product.
4501     */

4502    protected List JavaDoc getSorderItemsJoinCurrency(Criteria criteria)
4503        throws TorqueException
4504    {
4505                    if (collSorderItems == null)
4506        {
4507            if (isNew())
4508            {
4509               collSorderItems = new ArrayList JavaDoc();
4510            }
4511            else
4512            {
4513                              criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4514                              collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
4515            }
4516        }
4517        else
4518        {
4519            // the following code is to determine if a new query is
4520
// called for. If the criteria is the same as the last
4521
// one, just return the collection.
4522

4523                        criteria.add(SorderItemPeer.PRODUCT_ID, getProductId());
4524                                    if (!lastSorderItemsCriteria.equals(criteria))
4525            {
4526                collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
4527            }
4528        }
4529        lastSorderItemsCriteria = criteria;
4530
4531        return collSorderItems;
4532                }
4533                            
4534
4535
4536                          
4537            
4538          /**
4539     * Collection to store aggregation of collPaymentItems
4540     */

4541    protected List JavaDoc collPaymentItems;
4542
4543    /**
4544     * Temporary storage of collPaymentItems to save a possible db hit in
4545     * the event objects are add to the collection, but the
4546     * complete collection is never requested.
4547     */

4548    protected void initPaymentItems()
4549    {
4550        if (collPaymentItems == null)
4551        {
4552            collPaymentItems = new ArrayList JavaDoc();
4553        }
4554    }
4555
4556    /**
4557     * Method called to associate a PaymentItem object to this object
4558     * through the PaymentItem foreign key attribute
4559     *
4560     * @param l PaymentItem
4561     * @throws TorqueException
4562     */

4563    public void addPaymentItem(PaymentItem l) throws TorqueException
4564    {
4565        getPaymentItems().add(l);
4566        l.setProduct((Product) this);
4567    }
4568
4569    /**
4570     * The criteria used to select the current contents of collPaymentItems
4571     */

4572    private Criteria lastPaymentItemsCriteria = null;
4573      
4574    /**
4575     * If this collection has already been initialized, returns
4576     * the collection. Otherwise returns the results of
4577     * getPaymentItems(new Criteria())
4578     *
4579     * @throws TorqueException
4580     */

4581    public List JavaDoc getPaymentItems() throws TorqueException
4582    {
4583              if (collPaymentItems == null)
4584        {
4585            collPaymentItems = getPaymentItems(new Criteria(10));
4586        }
4587        return collPaymentItems;
4588          }
4589
4590    /**
4591     * If this collection has already been initialized with
4592     * an identical criteria, it returns the collection.
4593     * Otherwise if this Product has previously
4594     * been saved, it will retrieve related PaymentItems from storage.
4595     * If this Product is new, it will return
4596     * an empty collection or the current collection, the criteria
4597     * is ignored on a new object.
4598     *
4599     * @throws TorqueException
4600     */

4601    public List JavaDoc getPaymentItems(Criteria criteria) throws TorqueException
4602    {
4603              if (collPaymentItems == null)
4604        {
4605            if (isNew())
4606            {
4607               collPaymentItems = new ArrayList JavaDoc();
4608            }
4609            else
4610            {
4611                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId() );
4612                        collPaymentItems = PaymentItemPeer.doSelect(criteria);
4613            }
4614        }
4615        else
4616        {
4617            // criteria has no effect for a new object
4618
if (!isNew())
4619            {
4620                // the following code is to determine if a new query is
4621
// called for. If the criteria is the same as the last
4622
// one, just return the collection.
4623
criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4624                            if (!lastPaymentItemsCriteria.equals(criteria))
4625                {
4626                    collPaymentItems = PaymentItemPeer.doSelect(criteria);
4627                }
4628            }
4629        }
4630        lastPaymentItemsCriteria = criteria;
4631
4632        return collPaymentItems;
4633          }
4634
4635    /**
4636     * If this collection has already been initialized, returns
4637     * the collection. Otherwise returns the results of
4638     * getPaymentItems(new Criteria(),Connection)
4639     * This method takes in the Connection also as input so that
4640     * referenced objects can also be obtained using a Connection
4641     * that is taken as input
4642     */

4643    public List JavaDoc getPaymentItems(Connection JavaDoc con) throws TorqueException
4644    {
4645              if (collPaymentItems == null)
4646        {
4647            collPaymentItems = getPaymentItems(new Criteria(10), con);
4648        }
4649        return collPaymentItems;
4650          }
4651
4652    /**
4653     * If this collection has already been initialized with
4654     * an identical criteria, it returns the collection.
4655     * Otherwise if this Product has previously
4656     * been saved, it will retrieve related PaymentItems from storage.
4657     * If this Product is new, it will return
4658     * an empty collection or the current collection, the criteria
4659     * is ignored on a new object.
4660     * This method takes in the Connection also as input so that
4661     * referenced objects can also be obtained using a Connection
4662     * that is taken as input
4663     */

4664    public List JavaDoc getPaymentItems(Criteria criteria, Connection JavaDoc con)
4665            throws TorqueException
4666    {
4667              if (collPaymentItems == null)
4668        {
4669            if (isNew())
4670            {
4671               collPaymentItems = new ArrayList JavaDoc();
4672            }
4673            else
4674            {
4675                         criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4676                         collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
4677             }
4678         }
4679         else
4680         {
4681             // criteria has no effect for a new object
4682
if (!isNew())
4683             {
4684                 // the following code is to determine if a new query is
4685
// called for. If the criteria is the same as the last
4686
// one, just return the collection.
4687
criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4688                             if (!lastPaymentItemsCriteria.equals(criteria))
4689                 {
4690                     collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
4691                 }
4692             }
4693         }
4694         lastPaymentItemsCriteria = criteria;
4695
4696         return collPaymentItems;
4697           }
4698
4699                                                
4700              
4701                    
4702                    
4703                                
4704                                                              
4705                                        
4706                    
4707                    
4708          
4709    /**
4710     * If this collection has already been initialized with
4711     * an identical criteria, it returns the collection.
4712     * Otherwise if this Product is new, it will return
4713     * an empty collection; or if this Product has previously
4714     * been saved, it will retrieve related PaymentItems from storage.
4715     *
4716     * This method is protected by default in order to keep the public
4717     * api reasonable. You can provide public methods for those you
4718     * actually need in Product.
4719     */

4720    protected List JavaDoc getPaymentItemsJoinPayment(Criteria criteria)
4721        throws TorqueException
4722    {
4723                    if (collPaymentItems == null)
4724        {
4725            if (isNew())
4726            {
4727               collPaymentItems = new ArrayList JavaDoc();
4728            }
4729            else
4730            {
4731                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4732                              collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
4733            }
4734        }
4735        else
4736        {
4737            // the following code is to determine if a new query is
4738
// called for. If the criteria is the same as the last
4739
// one, just return the collection.
4740

4741                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4742                                    if (!lastPaymentItemsCriteria.equals(criteria))
4743            {
4744                collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
4745            }
4746        }
4747        lastPaymentItemsCriteria = criteria;
4748
4749        return collPaymentItems;
4750                }
4751                  
4752                    
4753                    
4754                                
4755                                                              
4756                                        
4757                    
4758                    
4759          
4760    /**
4761     * If this collection has already been initialized with
4762     * an identical criteria, it returns the collection.
4763     * Otherwise if this Product is new, it will return
4764     * an empty collection; or if this Product has previously
4765     * been saved, it will retrieve related PaymentItems from storage.
4766     *
4767     * This method is protected by default in order to keep the public
4768     * api reasonable. You can provide public methods for those you
4769     * actually need in Product.
4770     */

4771    protected List JavaDoc getPaymentItemsJoinSorder(Criteria criteria)
4772        throws TorqueException
4773    {
4774                    if (collPaymentItems == null)
4775        {
4776            if (isNew())
4777            {
4778               collPaymentItems = new ArrayList JavaDoc();
4779            }
4780            else
4781            {
4782                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4783                              collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
4784            }
4785        }
4786        else
4787        {
4788            // the following code is to determine if a new query is
4789
// called for. If the criteria is the same as the last
4790
// one, just return the collection.
4791

4792                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4793                                    if (!lastPaymentItemsCriteria.equals(criteria))
4794            {
4795                collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
4796            }
4797        }
4798        lastPaymentItemsCriteria = criteria;
4799
4800        return collPaymentItems;
4801                }
4802                  
4803                    
4804                              
4805                                
4806                                                              
4807                                        
4808                    
4809                    
4810          
4811    /**
4812     * If this collection has already been initialized with
4813     * an identical criteria, it returns the collection.
4814     * Otherwise if this Product is new, it will return
4815     * an empty collection; or if this Product has previously
4816     * been saved, it will retrieve related PaymentItems from storage.
4817     *
4818     * This method is protected by default in order to keep the public
4819     * api reasonable. You can provide public methods for those you
4820     * actually need in Product.
4821     */

4822    protected List JavaDoc getPaymentItemsJoinProduct(Criteria criteria)
4823        throws TorqueException
4824    {
4825                    if (collPaymentItems == null)
4826        {
4827            if (isNew())
4828            {
4829               collPaymentItems = new ArrayList JavaDoc();
4830            }
4831            else
4832            {
4833                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4834                              collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
4835            }
4836        }
4837        else
4838        {
4839            // the following code is to determine if a new query is
4840
// called for. If the criteria is the same as the last
4841
// one, just return the collection.
4842

4843                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4844                                    if (!lastPaymentItemsCriteria.equals(criteria))
4845            {
4846                collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
4847            }
4848        }
4849        lastPaymentItemsCriteria = criteria;
4850
4851        return collPaymentItems;
4852                }
4853                  
4854                    
4855                    
4856                                
4857                                                              
4858                                        
4859                    
4860                    
4861          
4862    /**
4863     * If this collection has already been initialized with
4864     * an identical criteria, it returns the collection.
4865     * Otherwise if this Product is new, it will return
4866     * an empty collection; or if this Product has previously
4867     * been saved, it will retrieve related PaymentItems from storage.
4868     *
4869     * This method is protected by default in order to keep the public
4870     * api reasonable. You can provide public methods for those you
4871     * actually need in Product.
4872     */

4873    protected List JavaDoc getPaymentItemsJoinCurrency(Criteria criteria)
4874        throws TorqueException
4875    {
4876                    if (collPaymentItems == null)
4877        {
4878            if (isNew())
4879            {
4880               collPaymentItems = new ArrayList JavaDoc();
4881            }
4882            else
4883            {
4884                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4885                              collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
4886            }
4887        }
4888        else
4889        {
4890            // the following code is to determine if a new query is
4891
// called for. If the criteria is the same as the last
4892
// one, just return the collection.
4893

4894                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4895                                    if (!lastPaymentItemsCriteria.equals(criteria))
4896            {
4897                collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
4898            }
4899        }
4900        lastPaymentItemsCriteria = criteria;
4901
4902        return collPaymentItems;
4903                }
4904                  
4905                    
4906                    
4907                                
4908                                                              
4909                                        
4910                    
4911                    
4912          
4913    /**
4914     * If this collection has already been initialized with
4915     * an identical criteria, it returns the collection.
4916     * Otherwise if this Product is new, it will return
4917     * an empty collection; or if this Product has previously
4918     * been saved, it will retrieve related PaymentItems from storage.
4919     *
4920     * This method is protected by default in order to keep the public
4921     * api reasonable. You can provide public methods for those you
4922     * actually need in Product.
4923     */

4924    protected List JavaDoc getPaymentItemsJoinCustomer(Criteria criteria)
4925        throws TorqueException
4926    {
4927                    if (collPaymentItems == null)
4928        {
4929            if (isNew())
4930            {
4931               collPaymentItems = new ArrayList JavaDoc();
4932            }
4933            else
4934            {
4935                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4936                              collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
4937            }
4938        }
4939        else
4940        {
4941            // the following code is to determine if a new query is
4942
// called for. If the criteria is the same as the last
4943
// one, just return the collection.
4944

4945                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4946                                    if (!lastPaymentItemsCriteria.equals(criteria))
4947            {
4948                collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
4949            }
4950        }
4951        lastPaymentItemsCriteria = criteria;
4952
4953        return collPaymentItems;
4954                }
4955                  
4956                    
4957                    
4958                                
4959                                                              
4960                                        
4961                    
4962                    
4963          
4964    /**
4965     * If this collection has already been initialized with
4966     * an identical criteria, it returns the collection.
4967     * Otherwise if this Product is new, it will return
4968     * an empty collection; or if this Product has previously
4969     * been saved, it will retrieve related PaymentItems from storage.
4970     *
4971     * This method is protected by default in order to keep the public
4972     * api reasonable. You can provide public methods for those you
4973     * actually need in Product.
4974     */

4975    protected List JavaDoc getPaymentItemsJoinProject(Criteria criteria)
4976        throws TorqueException
4977    {
4978                    if (collPaymentItems == null)
4979        {
4980            if (isNew())
4981            {
4982               collPaymentItems = new ArrayList JavaDoc();
4983            }
4984            else
4985            {
4986                              criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4987                              collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
4988            }
4989        }
4990        else
4991        {
4992            // the following code is to determine if a new query is
4993
// called for. If the criteria is the same as the last
4994
// one, just return the collection.
4995

4996                        criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId());
4997                                    if (!lastPaymentItemsCriteria.equals(criteria))
4998            {
4999                collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
5000            }
5001        }
5002        lastPaymentItemsCriteria = criteria;
5003
5004        return collPaymentItems;
5005                }
5006                            
5007
5008
5009                          
5010            
5011          /**
5012     * Collection to store aggregation of collShipmentItems
5013     */

5014    protected List JavaDoc collShipmentItems;
5015
5016    /**
5017     * Temporary storage of collShipmentItems to save a possible db hit in
5018     * the event objects are add to the collection, but the
5019     * complete collection is never requested.
5020     */

5021    protected void initShipmentItems()
5022    {
5023        if (collShipmentItems == null)
5024        {
5025            collShipmentItems = new ArrayList JavaDoc();
5026        }
5027    }
5028
5029    /**
5030     * Method called to associate a ShipmentItem object to this object
5031     * through the ShipmentItem foreign key attribute
5032     *
5033     * @param l ShipmentItem
5034     * @throws TorqueException
5035     */

5036    public void addShipmentItem(ShipmentItem l) throws TorqueException
5037    {
5038        getShipmentItems().add(l);
5039        l.setProduct((Product) this);
5040    }
5041
5042    /**
5043     * The criteria used to select the current contents of collShipmentItems
5044     */

5045    private Criteria lastShipmentItemsCriteria = null;
5046      
5047    /**
5048     * If this collection has already been initialized, returns
5049     * the collection. Otherwise returns the results of
5050     * getShipmentItems(new Criteria())
5051     *
5052     * @throws TorqueException
5053     */

5054    public List JavaDoc getShipmentItems() throws TorqueException
5055    {
5056              if (collShipmentItems == null)
5057        {
5058            collShipmentItems = getShipmentItems(new Criteria(10));
5059        }
5060        return collShipmentItems;
5061          }
5062
5063    /**
5064     * If this collection has already been initialized with
5065     * an identical criteria, it returns the collection.
5066     * Otherwise if this Product has previously
5067     * been saved, it will retrieve related ShipmentItems from storage.
5068     * If this Product is new, it will return
5069     * an empty collection or the current collection, the criteria
5070     * is ignored on a new object.
5071     *
5072     * @throws TorqueException
5073     */

5074    public List JavaDoc getShipmentItems(Criteria criteria) throws TorqueException
5075    {
5076              if (collShipmentItems == null)
5077        {
5078            if (isNew())
5079            {
5080               collShipmentItems = new ArrayList JavaDoc();
5081            }
5082            else
5083            {
5084                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId() );
5085                        collShipmentItems = ShipmentItemPeer.doSelect(criteria);
5086            }
5087        }
5088        else
5089        {
5090            // criteria has no effect for a new object
5091
if (!isNew())
5092            {
5093                // the following code is to determine if a new query is
5094
// called for. If the criteria is the same as the last
5095
// one, just return the collection.
5096
criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5097                            if (!lastShipmentItemsCriteria.equals(criteria))
5098                {
5099                    collShipmentItems = ShipmentItemPeer.doSelect(criteria);
5100                }
5101            }
5102        }
5103        lastShipmentItemsCriteria = criteria;
5104
5105        return collShipmentItems;
5106          }
5107
5108    /**
5109     * If this collection has already been initialized, returns
5110     * the collection. Otherwise returns the results of
5111     * getShipmentItems(new Criteria(),Connection)
5112     * This method takes in the Connection also as input so that
5113     * referenced objects can also be obtained using a Connection
5114     * that is taken as input
5115     */

5116    public List JavaDoc getShipmentItems(Connection JavaDoc con) throws TorqueException
5117    {
5118              if (collShipmentItems == null)
5119        {
5120            collShipmentItems = getShipmentItems(new Criteria(10), con);
5121        }
5122        return collShipmentItems;
5123          }
5124
5125    /**
5126     * If this collection has already been initialized with
5127     * an identical criteria, it returns the collection.
5128     * Otherwise if this Product has previously
5129     * been saved, it will retrieve related ShipmentItems from storage.
5130     * If this Product is new, it will return
5131     * an empty collection or the current collection, the criteria
5132     * is ignored on a new object.
5133     * This method takes in the Connection also as input so that
5134     * referenced objects can also be obtained using a Connection
5135     * that is taken as input
5136     */

5137    public List JavaDoc getShipmentItems(Criteria criteria, Connection JavaDoc con)
5138            throws TorqueException
5139    {
5140              if (collShipmentItems == null)
5141        {
5142            if (isNew())
5143            {
5144               collShipmentItems = new ArrayList JavaDoc();
5145            }
5146            else
5147            {
5148                         criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5149                         collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
5150             }
5151         }
5152         else
5153         {
5154             // criteria has no effect for a new object
5155
if (!isNew())
5156             {
5157                 // the following code is to determine if a new query is
5158
// called for. If the criteria is the same as the last
5159
// one, just return the collection.
5160
criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5161                             if (!lastShipmentItemsCriteria.equals(criteria))
5162                 {
5163                     collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
5164                 }
5165             }
5166         }
5167         lastShipmentItemsCriteria = criteria;
5168
5169         return collShipmentItems;
5170           }
5171
5172                                                
5173              
5174                    
5175                    
5176                                
5177                                                              
5178                                        
5179                    
5180                    
5181          
5182    /**
5183     * If this collection has already been initialized with
5184     * an identical criteria, it returns the collection.
5185     * Otherwise if this Product is new, it will return
5186     * an empty collection; or if this Product has previously
5187     * been saved, it will retrieve related ShipmentItems from storage.
5188     *
5189     * This method is protected by default in order to keep the public
5190     * api reasonable. You can provide public methods for those you
5191     * actually need in Product.
5192     */

5193    protected List JavaDoc getShipmentItemsJoinShipment(Criteria criteria)
5194        throws TorqueException
5195    {
5196                    if (collShipmentItems == null)
5197        {
5198            if (isNew())
5199            {
5200               collShipmentItems = new ArrayList JavaDoc();
5201            }
5202            else
5203            {
5204                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5205                              collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
5206            }
5207        }
5208        else
5209        {
5210            // the following code is to determine if a new query is
5211
// called for. If the criteria is the same as the last
5212
// one, just return the collection.
5213

5214                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5215                                    if (!lastShipmentItemsCriteria.equals(criteria))
5216            {
5217                collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
5218            }
5219        }
5220        lastShipmentItemsCriteria = criteria;
5221
5222        return collShipmentItems;
5223                }
5224                  
5225                    
5226                    
5227                                
5228                                                              
5229                                        
5230                    
5231                    
5232          
5233    /**
5234     * If this collection has already been initialized with
5235     * an identical criteria, it returns the collection.
5236     * Otherwise if this Product is new, it will return
5237     * an empty collection; or if this Product has previously
5238     * been saved, it will retrieve related ShipmentItems from storage.
5239     *
5240     * This method is protected by default in order to keep the public
5241     * api reasonable. You can provide public methods for those you
5242     * actually need in Product.
5243     */

5244    protected List JavaDoc getShipmentItemsJoinSorder(Criteria criteria)
5245        throws TorqueException
5246    {
5247                    if (collShipmentItems == null)
5248        {
5249            if (isNew())
5250            {
5251               collShipmentItems = new ArrayList JavaDoc();
5252            }
5253            else
5254            {
5255                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5256                              collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
5257            }
5258        }
5259        else
5260        {
5261            // the following code is to determine if a new query is
5262
// called for. If the criteria is the same as the last
5263
// one, just return the collection.
5264

5265                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5266                                    if (!lastShipmentItemsCriteria.equals(criteria))
5267            {
5268                collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
5269            }
5270        }
5271        lastShipmentItemsCriteria = criteria;
5272
5273        return collShipmentItems;
5274                }
5275                  
5276                    
5277                              
5278                                
5279                                                              
5280                                        
5281                    
5282                    
5283          
5284    /**
5285     * If this collection has already been initialized with
5286     * an identical criteria, it returns the collection.
5287     * Otherwise if this Product is new, it will return
5288     * an empty collection; or if this Product has previously
5289     * been saved, it will retrieve related ShipmentItems from storage.
5290     *
5291     * This method is protected by default in order to keep the public
5292     * api reasonable. You can provide public methods for those you
5293     * actually need in Product.
5294     */

5295    protected List JavaDoc getShipmentItemsJoinProduct(Criteria criteria)
5296        throws TorqueException
5297    {
5298                    if (collShipmentItems == null)
5299        {
5300            if (isNew())
5301            {
5302               collShipmentItems = new ArrayList JavaDoc();
5303            }
5304            else
5305            {
5306                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5307                              collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
5308            }
5309        }
5310        else
5311        {
5312            // the following code is to determine if a new query is
5313
// called for. If the criteria is the same as the last
5314
// one, just return the collection.
5315

5316                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5317                                    if (!lastShipmentItemsCriteria.equals(criteria))
5318            {
5319                collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
5320            }
5321        }
5322        lastShipmentItemsCriteria = criteria;
5323
5324        return collShipmentItems;
5325                }
5326                  
5327                    
5328                    
5329                                            
5330                                                                          
5331                                        
5332                    
5333                    
5334          
5335    /**
5336     * If this collection has already been initialized with
5337     * an identical criteria, it returns the collection.
5338     * Otherwise if this Product is new, it will return
5339     * an empty collection; or if this Product has previously
5340     * been saved, it will retrieve related ShipmentItems from storage.
5341     *
5342     * This method is protected by default in order to keep the public
5343     * api reasonable. You can provide public methods for those you
5344     * actually need in Product.
5345     */

5346    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
5347        throws TorqueException
5348    {
5349                    if (collShipmentItems == null)
5350        {
5351            if (isNew())
5352            {
5353               collShipmentItems = new ArrayList JavaDoc();
5354            }
5355            else
5356            {
5357                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5358                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5359            }
5360        }
5361        else
5362        {
5363            // the following code is to determine if a new query is
5364
// called for. If the criteria is the same as the last
5365
// one, just return the collection.
5366

5367                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5368                                    if (!lastShipmentItemsCriteria.equals(criteria))
5369            {
5370                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5371            }
5372        }
5373        lastShipmentItemsCriteria = criteria;
5374
5375        return collShipmentItems;
5376                }
5377                  
5378                    
5379                    
5380                                            
5381                                                                          
5382                                        
5383                    
5384                    
5385          
5386    /**
5387     * If this collection has already been initialized with
5388     * an identical criteria, it returns the collection.
5389     * Otherwise if this Product is new, it will return
5390     * an empty collection; or if this Product has previously
5391     * been saved, it will retrieve related ShipmentItems from storage.
5392     *
5393     * This method is protected by default in order to keep the public
5394     * api reasonable. You can provide public methods for those you
5395     * actually need in Product.
5396     */

5397    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
5398        throws TorqueException
5399    {
5400                    if (collShipmentItems == null)
5401        {
5402            if (isNew())
5403            {
5404               collShipmentItems = new ArrayList JavaDoc();
5405            }
5406            else
5407            {
5408                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5409                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5410            }
5411        }
5412        else
5413        {
5414            // the following code is to determine if a new query is
5415
// called for. If the criteria is the same as the last
5416
// one, just return the collection.
5417

5418                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5419                                    if (!lastShipmentItemsCriteria.equals(criteria))
5420            {
5421                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5422            }
5423        }
5424        lastShipmentItemsCriteria = criteria;
5425
5426        return collShipmentItems;
5427                }
5428                  
5429                    
5430                    
5431                                
5432                                                              
5433                                        
5434                    
5435                    
5436          
5437    /**
5438     * If this collection has already been initialized with
5439     * an identical criteria, it returns the collection.
5440     * Otherwise if this Product is new, it will return
5441     * an empty collection; or if this Product has previously
5442     * been saved, it will retrieve related ShipmentItems from storage.
5443     *
5444     * This method is protected by default in order to keep the public
5445     * api reasonable. You can provide public methods for those you
5446     * actually need in Product.
5447     */

5448    protected List JavaDoc getShipmentItemsJoinProject(Criteria criteria)
5449        throws TorqueException
5450    {
5451                    if (collShipmentItems == null)
5452        {
5453            if (isNew())
5454            {
5455               collShipmentItems = new ArrayList JavaDoc();
5456            }
5457            else
5458            {
5459                              criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5460                              collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
5461            }
5462        }
5463        else
5464        {
5465            // the following code is to determine if a new query is
5466
// called for. If the criteria is the same as the last
5467
// one, just return the collection.
5468

5469                        criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId());
5470                                    if (!lastShipmentItemsCriteria.equals(criteria))
5471            {
5472                collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
5473            }
5474        }
5475        lastShipmentItemsCriteria = criteria;
5476
5477        return collShipmentItems;
5478                }
5479                            
5480
5481
5482                          
5483            
5484          /**
5485     * Collection to store aggregation of collServiceItems
5486     */

5487    protected List JavaDoc collServiceItems;
5488
5489    /**
5490     * Temporary storage of collServiceItems to save a possible db hit in
5491     * the event objects are add to the collection, but the
5492     * complete collection is never requested.
5493     */

5494    protected void initServiceItems()
5495    {
5496        if (collServiceItems == null)
5497        {
5498            collServiceItems = new ArrayList JavaDoc();
5499        }
5500    }
5501
5502    /**
5503     * Method called to associate a ServiceItem object to this object
5504     * through the ServiceItem foreign key attribute
5505     *
5506     * @param l ServiceItem
5507     * @throws TorqueException
5508     */

5509    public void addServiceItem(ServiceItem l) throws TorqueException
5510    {
5511        getServiceItems().add(l);
5512        l.setProduct((Product) this);
5513    }
5514
5515    /**
5516     * The criteria used to select the current contents of collServiceItems
5517     */

5518    private Criteria lastServiceItemsCriteria = null;
5519      
5520    /**
5521     * If this collection has already been initialized, returns
5522     * the collection. Otherwise returns the results of
5523     * getServiceItems(new Criteria())
5524     *
5525     * @throws TorqueException
5526     */

5527    public List JavaDoc getServiceItems() throws TorqueException
5528    {
5529              if (collServiceItems == null)
5530        {
5531            collServiceItems = getServiceItems(new Criteria(10));
5532        }
5533        return collServiceItems;
5534          }
5535
5536    /**
5537     * If this collection has already been initialized with
5538     * an identical criteria, it returns the collection.
5539     * Otherwise if this Product has previously
5540     * been saved, it will retrieve related ServiceItems from storage.
5541     * If this Product is new, it will return
5542     * an empty collection or the current collection, the criteria
5543     * is ignored on a new object.
5544     *
5545     * @throws TorqueException
5546     */

5547    public List JavaDoc getServiceItems(Criteria criteria) throws TorqueException
5548    {
5549              if (collServiceItems == null)
5550        {
5551            if (isNew())
5552            {
5553               collServiceItems = new ArrayList JavaDoc();
5554            }
5555            else
5556            {
5557                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId() );
5558                        collServiceItems = ServiceItemPeer.doSelect(criteria);
5559            }
5560        }
5561        else
5562        {
5563            // criteria has no effect for a new object
5564
if (!isNew())
5565            {
5566                // the following code is to determine if a new query is
5567
// called for. If the criteria is the same as the last
5568
// one, just return the collection.
5569
criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5570                            if (!lastServiceItemsCriteria.equals(criteria))
5571                {
5572                    collServiceItems = ServiceItemPeer.doSelect(criteria);
5573                }
5574            }
5575        }
5576        lastServiceItemsCriteria = criteria;
5577
5578        return collServiceItems;
5579          }
5580
5581    /**
5582     * If this collection has already been initialized, returns
5583     * the collection. Otherwise returns the results of
5584     * getServiceItems(new Criteria(),Connection)
5585     * This method takes in the Connection also as input so that
5586     * referenced objects can also be obtained using a Connection
5587     * that is taken as input
5588     */

5589    public List JavaDoc getServiceItems(Connection JavaDoc con) throws TorqueException
5590    {
5591              if (collServiceItems == null)
5592        {
5593            collServiceItems = getServiceItems(new Criteria(10), con);
5594        }
5595        return collServiceItems;
5596          }
5597
5598    /**
5599     * If this collection has already been initialized with
5600     * an identical criteria, it returns the collection.
5601     * Otherwise if this Product has previously
5602     * been saved, it will retrieve related ServiceItems from storage.
5603     * If this Product is new, it will return
5604     * an empty collection or the current collection, the criteria
5605     * is ignored on a new object.
5606     * This method takes in the Connection also as input so that
5607     * referenced objects can also be obtained using a Connection
5608     * that is taken as input
5609     */

5610    public List JavaDoc getServiceItems(Criteria criteria, Connection JavaDoc con)
5611            throws TorqueException
5612    {
5613              if (collServiceItems == null)
5614        {
5615            if (isNew())
5616            {
5617               collServiceItems = new ArrayList JavaDoc();
5618            }
5619            else
5620            {
5621                         criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5622                         collServiceItems = ServiceItemPeer.doSelect(criteria, con);
5623             }
5624         }
5625         else
5626         {
5627             // criteria has no effect for a new object
5628
if (!isNew())
5629             {
5630                 // the following code is to determine if a new query is
5631
// called for. If the criteria is the same as the last
5632
// one, just return the collection.
5633
criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5634                             if (!lastServiceItemsCriteria.equals(criteria))
5635                 {
5636                     collServiceItems = ServiceItemPeer.doSelect(criteria, con);
5637                 }
5638             }
5639         }
5640         lastServiceItemsCriteria = criteria;
5641
5642         return collServiceItems;
5643           }
5644
5645                                                
5646              
5647                    
5648                    
5649                                
5650                                                              
5651                                        
5652                    
5653                    
5654          
5655    /**
5656     * If this collection has already been initialized with
5657     * an identical criteria, it returns the collection.
5658     * Otherwise if this Product is new, it will return
5659     * an empty collection; or if this Product has previously
5660     * been saved, it will retrieve related ServiceItems from storage.
5661     *
5662     * This method is protected by default in order to keep the public
5663     * api reasonable. You can provide public methods for those you
5664     * actually need in Product.
5665     */

5666    protected List JavaDoc getServiceItemsJoinService(Criteria criteria)
5667        throws TorqueException
5668    {
5669                    if (collServiceItems == null)
5670        {
5671            if (isNew())
5672            {
5673               collServiceItems = new ArrayList JavaDoc();
5674            }
5675            else
5676            {
5677                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5678                              collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
5679            }
5680        }
5681        else
5682        {
5683            // the following code is to determine if a new query is
5684
// called for. If the criteria is the same as the last
5685
// one, just return the collection.
5686

5687                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5688                                    if (!lastServiceItemsCriteria.equals(criteria))
5689            {
5690                collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
5691            }
5692        }
5693        lastServiceItemsCriteria = criteria;
5694
5695        return collServiceItems;
5696                }
5697                  
5698                    
5699                    
5700                                
5701                                                              
5702                                        
5703                    
5704                    
5705          
5706    /**
5707     * If this collection has already been initialized with
5708     * an identical criteria, it returns the collection.
5709     * Otherwise if this Product is new, it will return
5710     * an empty collection; or if this Product has previously
5711     * been saved, it will retrieve related ServiceItems from storage.
5712     *
5713     * This method is protected by default in order to keep the public
5714     * api reasonable. You can provide public methods for those you
5715     * actually need in Product.
5716     */

5717    protected List JavaDoc getServiceItemsJoinSorder(Criteria criteria)
5718        throws TorqueException
5719    {
5720                    if (collServiceItems == null)
5721        {
5722            if (isNew())
5723            {
5724               collServiceItems = new ArrayList JavaDoc();
5725            }
5726            else
5727            {
5728                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5729                              collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
5730            }
5731        }
5732        else
5733        {
5734            // the following code is to determine if a new query is
5735
// called for. If the criteria is the same as the last
5736
// one, just return the collection.
5737

5738                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5739                                    if (!lastServiceItemsCriteria.equals(criteria))
5740            {
5741                collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
5742            }
5743        }
5744        lastServiceItemsCriteria = criteria;
5745
5746        return collServiceItems;
5747                }
5748                  
5749                    
5750                              
5751                                
5752                                                              
5753                                        
5754                    
5755                    
5756          
5757    /**
5758     * If this collection has already been initialized with
5759     * an identical criteria, it returns the collection.
5760     * Otherwise if this Product is new, it will return
5761     * an empty collection; or if this Product has previously
5762     * been saved, it will retrieve related ServiceItems from storage.
5763     *
5764     * This method is protected by default in order to keep the public
5765     * api reasonable. You can provide public methods for those you
5766     * actually need in Product.
5767     */

5768    protected List JavaDoc getServiceItemsJoinProduct(Criteria criteria)
5769        throws TorqueException
5770    {
5771                    if (collServiceItems == null)
5772        {
5773            if (isNew())
5774            {
5775               collServiceItems = new ArrayList JavaDoc();
5776            }
5777            else
5778            {
5779                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5780                              collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
5781            }
5782        }
5783        else
5784        {
5785            // the following code is to determine if a new query is
5786
// called for. If the criteria is the same as the last
5787
// one, just return the collection.
5788

5789                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5790                                    if (!lastServiceItemsCriteria.equals(criteria))
5791            {
5792                collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
5793            }
5794        }
5795        lastServiceItemsCriteria = criteria;
5796
5797        return collServiceItems;
5798                }
5799                  
5800                    
5801                    
5802                                            
5803                                                                          
5804                                        
5805                    
5806                    
5807          
5808    /**
5809     * If this collection has already been initialized with
5810     * an identical criteria, it returns the collection.
5811     * Otherwise if this Product is new, it will return
5812     * an empty collection; or if this Product has previously
5813     * been saved, it will retrieve related ServiceItems from storage.
5814     *
5815     * This method is protected by default in order to keep the public
5816     * api reasonable. You can provide public methods for those you
5817     * actually need in Product.
5818     */

5819    protected List JavaDoc getServiceItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
5820        throws TorqueException
5821    {
5822                    if (collServiceItems == null)
5823        {
5824            if (isNew())
5825            {
5826               collServiceItems = new ArrayList JavaDoc();
5827            }
5828            else
5829            {
5830                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5831                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5832            }
5833        }
5834        else
5835        {
5836            // the following code is to determine if a new query is
5837
// called for. If the criteria is the same as the last
5838
// one, just return the collection.
5839

5840                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5841                                    if (!lastServiceItemsCriteria.equals(criteria))
5842            {
5843                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5844            }
5845        }
5846        lastServiceItemsCriteria = criteria;
5847
5848        return collServiceItems;
5849                }
5850                  
5851                    
5852                    
5853                                            
5854                                                                          
5855                                        
5856                    
5857                    
5858          
5859    /**
5860     * If this collection has already been initialized with
5861     * an identical criteria, it returns the collection.
5862     * Otherwise if this Product is new, it will return
5863     * an empty collection; or if this Product has previously
5864     * been saved, it will retrieve related ServiceItems from storage.
5865     *
5866     * This method is protected by default in order to keep the public
5867     * api reasonable. You can provide public methods for those you
5868     * actually need in Product.
5869     */

5870    protected List JavaDoc getServiceItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
5871        throws TorqueException
5872    {
5873                    if (collServiceItems == null)
5874        {
5875            if (isNew())
5876            {
5877               collServiceItems = new ArrayList JavaDoc();
5878            }
5879            else
5880            {
5881                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5882                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5883            }
5884        }
5885        else
5886        {
5887            // the following code is to determine if a new query is
5888
// called for. If the criteria is the same as the last
5889
// one, just return the collection.
5890

5891                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5892                                    if (!lastServiceItemsCriteria.equals(criteria))
5893            {
5894                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5895            }
5896        }
5897        lastServiceItemsCriteria = criteria;
5898
5899        return collServiceItems;
5900                }
5901                  
5902                    
5903                    
5904                                
5905                                                              
5906                                        
5907                    
5908                    
5909          
5910    /**
5911     * If this collection has already been initialized with
5912     * an identical criteria, it returns the collection.
5913     * Otherwise if this Product is new, it will return
5914     * an empty collection; or if this Product has previously
5915     * been saved, it will retrieve related ServiceItems from storage.
5916     *
5917     * This method is protected by default in order to keep the public
5918     * api reasonable. You can provide public methods for those you
5919     * actually need in Product.
5920     */

5921    protected List JavaDoc getServiceItemsJoinProject(Criteria criteria)
5922        throws TorqueException
5923    {
5924                    if (collServiceItems == null)
5925        {
5926            if (isNew())
5927            {
5928               collServiceItems = new ArrayList JavaDoc();
5929            }
5930            else
5931            {
5932                              criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5933                              collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
5934            }
5935        }
5936        else
5937        {
5938            // the following code is to determine if a new query is
5939
// called for. If the criteria is the same as the last
5940
// one, just return the collection.
5941

5942                        criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId());
5943                                    if (!lastServiceItemsCriteria.equals(criteria))
5944            {
5945                collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
5946            }
5947        }
5948        lastServiceItemsCriteria = criteria;
5949
5950        return collServiceItems;
5951                }
5952                            
5953
5954
5955          
5956    private static List JavaDoc fieldNames = null;
5957
5958    /**
5959     * Generate a list of field names.
5960     *
5961     * @return a list of field names
5962     */

5963    public static synchronized List JavaDoc getFieldNames()
5964    {
5965        if (fieldNames == null)
5966        {
5967            fieldNames = new ArrayList JavaDoc();
5968              fieldNames.add("ProductId");
5969              fieldNames.add("ProductCode");
5970              fieldNames.add("Status");
5971              fieldNames.add("Priority");
5972              fieldNames.add("ProductType");
5973              fieldNames.add("ProductCatId");
5974              fieldNames.add("ProductDescription");
5975              fieldNames.add("ProductDisplay");
5976              fieldNames.add("BasePrice");
5977              fieldNames.add("UomId");
5978              fieldNames.add("WebUrl");
5979              fieldNames.add("ShowOnPricelist");
5980              fieldNames.add("VendorId");
5981              fieldNames.add("VendorsCode");
5982              fieldNames.add("EanUpcCode");
5983              fieldNames.add("Location");
5984              fieldNames.add("Custom1");
5985              fieldNames.add("Custom2");
5986              fieldNames.add("Custom3");
5987              fieldNames.add("Custom4");
5988              fieldNames.add("Custom5");
5989              fieldNames.add("Custom6");
5990              fieldNames.add("Notes");
5991              fieldNames.add("Created");
5992              fieldNames.add("Modified");
5993              fieldNames.add("CreatedBy");
5994              fieldNames.add("ModifiedBy");
5995              fieldNames = Collections.unmodifiableList(fieldNames);
5996        }
5997        return fieldNames;
5998    }
5999
6000    /**
6001     * Retrieves a field from the object by name passed in as a String.
6002     *
6003     * @param name field name
6004     * @return value
6005     */

6006    public Object JavaDoc getByName(String JavaDoc name)
6007    {
6008          if (name.equals("ProductId"))
6009        {
6010                return new Integer JavaDoc(getProductId());
6011            }
6012          if (name.equals("ProductCode"))
6013        {
6014                return getProductCode();
6015            }
6016          if (name.equals("Status"))
6017        {
6018                return new Integer JavaDoc(getStatus());
6019            }
6020          if (name.equals("Priority"))
6021        {
6022                return new Integer JavaDoc(getPriority());
6023            }
6024          if (name.equals("ProductType"))
6025        {
6026                return new Integer JavaDoc(getProductType());
6027            }
6028          if (name.equals("ProductCatId"))
6029        {
6030                return new Integer JavaDoc(getProductCatId());
6031            }
6032          if (name.equals("ProductDescription"))
6033        {
6034                return getProductDescription();
6035            }
6036          if (name.equals("ProductDisplay"))
6037        {
6038                return getProductDisplay();
6039            }
6040          if (name.equals("BasePrice"))
6041        {
6042                return new Double JavaDoc(getBasePrice());
6043            }
6044          if (name.equals("UomId"))
6045        {
6046                return new Integer JavaDoc(getUomId());
6047            }
6048          if (name.equals("WebUrl"))
6049        {
6050                return getWebUrl();
6051            }
6052          if (name.equals("ShowOnPricelist"))
6053        {
6054                return new Integer JavaDoc(getShowOnPricelist());
6055            }
6056          if (name.equals("VendorId"))
6057        {
6058                return new Integer JavaDoc(getVendorId());
6059            }
6060          if (name.equals("VendorsCode"))
6061        {
6062                return getVendorsCode();
6063            }
6064          if (name.equals("EanUpcCode"))
6065        {
6066                return getEanUpcCode();
6067            }
6068          if (name.equals("Location"))
6069        {
6070                return getLocation();
6071            }
6072          if (name.equals("Custom1"))
6073        {
6074                return getCustom1();
6075            }
6076          if (name.equals("Custom2"))
6077        {
6078                return getCustom2();
6079            }
6080          if (name.equals("Custom3"))
6081        {
6082                return getCustom3();
6083            }
6084          if (name.equals("Custom4"))
6085        {
6086                return getCustom4();
6087            }
6088          if (name.equals("Custom5"))
6089        {
6090                return getCustom5();
6091            }
6092          if (name.equals("Custom6"))
6093        {
6094                return getCustom6();
6095            }
6096          if (name.equals("Notes"))
6097        {
6098                return getNotes();
6099            }
6100          if (name.equals("Created"))
6101        {
6102                return getCreated();
6103            }
6104          if (name.equals("Modified"))
6105        {
6106                return getModified();
6107            }
6108          if (name.equals("CreatedBy"))
6109        {
6110                return getCreatedBy();
6111            }
6112          if (name.equals("ModifiedBy"))
6113        {
6114                return getModifiedBy();
6115            }
6116          return null;
6117    }
6118    
6119    /**
6120     * Retrieves a field from the object by name passed in
6121     * as a String. The String must be one of the static
6122     * Strings defined in this Class' Peer.
6123     *
6124     * @param name peer name
6125     * @return value
6126     */

6127    public Object JavaDoc getByPeerName(String JavaDoc name)
6128    {
6129          if (name.equals(ProductPeer.PRODUCT_ID))
6130        {
6131                return new Integer JavaDoc(getProductId());
6132            }
6133          if (name.equals(ProductPeer.PRODUCT_CODE))
6134        {
6135                return getProductCode();
6136            }
6137          if (name.equals(ProductPeer.STATUS))
6138        {
6139                return new Integer JavaDoc(getStatus());
6140            }
6141          if (name.equals(ProductPeer.PRIORITY))
6142        {
6143                return new Integer JavaDoc(getPriority());
6144            }
6145          if (name.equals(ProductPeer.PRODUCT_TYPE))
6146        {
6147                return new Integer JavaDoc(getProductType());
6148            }
6149          if (name.equals(ProductPeer.PRODUCT_CAT_ID))
6150        {
6151                return new Integer JavaDoc(getProductCatId());
6152            }
6153          if (name.equals(ProductPeer.PRODUCT_DESCRIPTION))
6154        {
6155                return getProductDescription();
6156            }
6157          if (name.equals(ProductPeer.PRODUCT_DISPLAY))
6158        {
6159                return getProductDisplay();
6160            }
6161          if (name.equals(ProductPeer.BASE_PRICE))
6162        {
6163                return new Double JavaDoc(getBasePrice());
6164            }
6165          if (name.equals(ProductPeer.UOM_ID))
6166        {
6167                return new Integer JavaDoc(getUomId());
6168            }
6169          if (name.equals(ProductPeer.WEB_URL))
6170        {
6171                return getWebUrl();
6172            }
6173          if (name.equals(ProductPeer.SHOW_ON_PRICELIST))
6174        {
6175                return new Integer JavaDoc(getShowOnPricelist());
6176            }
6177          if (name.equals(ProductPeer.VENDOR_ID))
6178        {
6179                return new Integer JavaDoc(getVendorId());
6180            }
6181          if (name.equals(ProductPeer.VENDORS_CODE))
6182        {
6183                return getVendorsCode();
6184            }
6185          if (name.equals(ProductPeer.EAN_UPC_CODE))
6186        {
6187                return getEanUpcCode();
6188            }
6189          if (name.equals(ProductPeer.LOCATION))
6190        {
6191                return getLocation();
6192            }
6193          if (name.equals(ProductPeer.CUSTOM_1))
6194        {
6195                return getCustom1();
6196            }
6197          if (name.equals(ProductPeer.CUSTOM_2))
6198        {
6199                return getCustom2();
6200            }
6201          if (name.equals(ProductPeer.CUSTOM_3))
6202        {
6203                return getCustom3();
6204            }
6205          if (name.equals(ProductPeer.CUSTOM_4))
6206        {
6207                return getCustom4();
6208            }
6209          if (name.equals(ProductPeer.CUSTOM_5))
6210        {
6211                return getCustom5();
6212            }
6213          if (name.equals(ProductPeer.CUSTOM_6))
6214        {
6215                return getCustom6();
6216            }
6217          if (name.equals(ProductPeer.NOTES))
6218        {
6219                return getNotes();
6220            }
6221          if (name.equals(ProductPeer.CREATED))
6222        {
6223                return getCreated();
6224            }
6225          if (name.equals(ProductPeer.MODIFIED))
6226        {
6227                return getModified();
6228            }
6229          if (name.equals(ProductPeer.CREATED_BY))
6230        {
6231                return getCreatedBy();
6232            }
6233          if (name.equals(ProductPeer.MODIFIED_BY))
6234        {
6235                return getModifiedBy();
6236            }
6237          return null;
6238    }
6239
6240    /**
6241     * Retrieves a field from the object by Position as specified
6242     * in the xml schema. Zero-based.
6243     *
6244     * @param pos position in xml schema
6245     * @return value
6246     */

6247    public Object JavaDoc getByPosition(int pos)
6248    {
6249            if (pos == 0)
6250        {
6251                return new Integer JavaDoc(getProductId());
6252            }
6253              if (pos == 1)
6254        {
6255                return getProductCode();
6256            }
6257              if (pos == 2)
6258        {
6259                return new Integer JavaDoc(getStatus());
6260            }
6261              if (pos == 3)
6262        {
6263                return new Integer JavaDoc(getPriority());
6264            }
6265              if (pos == 4)
6266        {
6267                return new Integer JavaDoc(getProductType());
6268            }
6269              if (pos == 5)
6270        {
6271                return new Integer JavaDoc(getProductCatId());
6272            }
6273              if (pos == 6)
6274        {
6275                return getProductDescription();
6276            }
6277              if (pos == 7)
6278        {
6279                return getProductDisplay();
6280            }
6281              if (pos == 8)
6282        {
6283                return new Double JavaDoc(getBasePrice());
6284            }
6285              if (pos == 9)
6286        {
6287                return new Integer JavaDoc(getUomId());
6288            }
6289              if (pos == 10)
6290        {
6291                return getWebUrl();
6292            }
6293              if (pos == 11)
6294        {
6295                return new Integer JavaDoc(getShowOnPricelist());
6296            }
6297              if (pos == 12)
6298        {
6299                return new Integer JavaDoc(getVendorId());
6300            }
6301              if (pos == 13)
6302        {
6303                return getVendorsCode();
6304            }
6305              if (pos == 14)
6306        {
6307                return getEanUpcCode();
6308            }
6309              if (pos == 15)
6310        {
6311                return getLocation();
6312            }
6313              if (pos == 16)
6314        {
6315                return getCustom1();
6316            }
6317              if (pos == 17)
6318        {
6319                return getCustom2();
6320            }
6321              if (pos == 18)
6322        {
6323                return getCustom3();
6324            }
6325              if (pos == 19)
6326        {
6327                return getCustom4();
6328            }
6329              if (pos == 20)
6330        {
6331                return getCustom5();
6332            }
6333              if (pos == 21)
6334        {
6335                return getCustom6();
6336            }
6337              if (pos == 22)
6338        {
6339                return getNotes();
6340            }
6341              if (pos == 23)
6342        {
6343                return getCreated();
6344            }
6345              if (pos == 24)
6346        {
6347                return getModified();
6348            }
6349              if (pos == 25)
6350        {
6351                return getCreatedBy();
6352            }
6353              if (pos == 26)
6354        {
6355                return getModifiedBy();
6356            }
6357              return null;
6358    }
6359     
6360    /**
6361     * Stores the object in the database. If the object is new,
6362     * it inserts it; otherwise an update is performed.
6363     *
6364     * @throws Exception
6365     */

6366    public void save() throws Exception JavaDoc
6367    {
6368          save(ProductPeer.getMapBuilder()
6369                .getDatabaseMap().getName());
6370      }
6371
6372    /**
6373     * Stores the object in the database. If the object is new,
6374     * it inserts it; otherwise an update is performed.
6375       * Note: this code is here because the method body is
6376     * auto-generated conditionally and therefore needs to be
6377     * in this file instead of in the super class, BaseObject.
6378       *
6379     * @param dbName
6380     * @throws TorqueException
6381     */

6382    public void save(String JavaDoc dbName) throws TorqueException
6383    {
6384        Connection JavaDoc con = null;
6385          try
6386        {
6387            con = Transaction.begin(dbName);
6388            save(con);
6389            Transaction.commit(con);
6390        }
6391        catch(TorqueException e)
6392        {
6393            Transaction.safeRollback(con);
6394            throw e;
6395        }
6396      }
6397
6398      /** flag to prevent endless save loop, if this object is referenced
6399        by another object which falls in this transaction. */

6400    private boolean alreadyInSave = false;
6401      /**
6402     * Stores the object in the database. If the object is new,
6403     * it inserts it; otherwise an update is performed. This method
6404     * is meant to be used as part of a transaction, otherwise use
6405     * the save() method and the connection details will be handled
6406     * internally
6407     *
6408     * @param con
6409     * @throws TorqueException
6410     */

6411    public void save(Connection JavaDoc con) throws TorqueException
6412    {
6413          if (!alreadyInSave)
6414        {
6415            alreadyInSave = true;
6416
6417
6418  
6419            // If this object has been modified, then save it to the database.
6420
if (isModified())
6421            {
6422                if (isNew())
6423                {
6424                    ProductPeer.doInsert((Product) this, con);
6425                    setNew(false);
6426                }
6427                else
6428                {
6429                    ProductPeer.doUpdate((Product) this, con);
6430                }
6431            }
6432
6433                                      
6434                
6435                    if (collPrintSubscriptions != null)
6436            {
6437                for (int i = 0; i < collPrintSubscriptions.size(); i++)
6438                {
6439                    ((PrintSubscription) collPrintSubscriptions.get(i)).save(con);
6440                }
6441            }
6442                                                  
6443                
6444                    if (collOnlineSubscriptions != null)
6445            {
6446                for (int i = 0; i < collOnlineSubscriptions.size(); i++)
6447                {
6448                    ((OnlineSubscription) collOnlineSubscriptions.get(i)).save(con);
6449                }
6450            }
6451                                                  
6452                
6453                    if (collInboxEvents != null)
6454            {
6455                for (int i = 0; i < collInboxEvents.size(); i++)
6456                {
6457                    ((InboxEvent) collInboxEvents.get(i)).save(con);
6458                }
6459            }
6460                                                  
6461                
6462                    if (collOutboxEvents != null)
6463            {
6464                for (int i = 0; i < collOutboxEvents.size(); i++)
6465                {
6466                    ((OutboxEvent) collOutboxEvents.get(i)).save(con);
6467                }
6468            }
6469                                                  
6470                
6471                    if (collNewsSubscriptions != null)
6472            {
6473                for (int i = 0; i < collNewsSubscriptions.size(); i++)
6474                {
6475                    ((NewsSubscription) collNewsSubscriptions.get(i)).save(con);
6476                }
6477            }
6478                                                            
6479                
6480                    if (collNewslettersRelatedByProductId != null)
6481            {
6482                for (int i = 0; i < collNewslettersRelatedByProductId.size(); i++)
6483                {
6484                    ((Newsletter) collNewslettersRelatedByProductId.get(i)).save(con);
6485                }
6486            }
6487                                                            
6488                
6489                    if (collNewslettersRelatedByRelProductId != null)
6490            {
6491                for (int i = 0; i < collNewslettersRelatedByRelProductId.size(); i++)
6492                {
6493                    ((Newsletter) collNewslettersRelatedByRelProductId.get(i)).save(con);
6494                }
6495            }
6496                                                  
6497                
6498                    if (collSorderItems != null)
6499            {
6500                for (int i = 0; i < collSorderItems.size(); i++)
6501                {
6502                    ((SorderItem) collSorderItems.get(i)).save(con);
6503                }
6504            }
6505                                                  
6506                
6507                    if (collPaymentItems != null)
6508            {
6509                for (int i = 0; i < collPaymentItems.size(); i++)
6510                {
6511                    ((PaymentItem) collPaymentItems.get(i)).save(con);
6512                }
6513            }
6514                                                  
6515                
6516                    if (collShipmentItems != null)
6517            {
6518                for (int i = 0; i < collShipmentItems.size(); i++)
6519                {
6520                    ((ShipmentItem) collShipmentItems.get(i)).save(con);
6521                }
6522            }
6523                                                  
6524                
6525                    if (collServiceItems != null)
6526            {
6527                for (int i = 0; i < collServiceItems.size(); i++)
6528                {
6529                    ((ServiceItem) collServiceItems.get(i)).save(con);
6530                }
6531            }
6532                                  alreadyInSave = false;
6533        }
6534      }
6535
6536                        
6537      /**
6538     * Set the PrimaryKey using ObjectKey.
6539     *
6540     * @param key productId ObjectKey
6541     */

6542    public void setPrimaryKey(ObjectKey key)
6543        throws TorqueException
6544    {
6545            setProductId(((NumberKey) key).intValue());
6546        }
6547
6548    /**
6549     * Set the PrimaryKey using a String.
6550     *
6551     * @param key
6552     */

6553    public void setPrimaryKey(String JavaDoc key) throws TorqueException
6554    {
6555            setProductId(Integer.parseInt(key));
6556        }
6557
6558  
6559    /**
6560     * returns an id that differentiates this object from others
6561     * of its class.
6562     */

6563    public ObjectKey getPrimaryKey()
6564    {
6565          return SimpleKey.keyFor(getProductId());
6566      }
6567 
6568    /**
6569     * get an id that differentiates this object from others
6570     * of its class.
6571     */

6572    public String JavaDoc getQueryKey()
6573    {
6574        if (getPrimaryKey() == null)
6575        {
6576            return "";
6577        }
6578        else
6579        {
6580            return getPrimaryKey().toString();
6581        }
6582    }
6583
6584    /**
6585     * set an id that differentiates this object from others
6586     * of its class.
6587     */

6588    public void setQueryKey(String JavaDoc key)
6589        throws TorqueException
6590    {
6591        setPrimaryKey(key);
6592    }
6593
6594    /**
6595     * Makes a copy of this object.
6596     * It creates a new object filling in the simple attributes.
6597       * It then fills all the association collections and sets the
6598     * related objects to isNew=true.
6599       */

6600      public Product copy() throws TorqueException
6601    {
6602        return copyInto(new Product());
6603    }
6604  
6605    protected Product copyInto(Product copyObj) throws TorqueException
6606    {
6607          copyObj.setProductId(productId);
6608          copyObj.setProductCode(productCode);
6609          copyObj.setStatus(status);
6610          copyObj.setPriority(priority);
6611          copyObj.setProductType(productType);
6612          copyObj.setProductCatId(productCatId);
6613          copyObj.setProductDescription(productDescription);
6614          copyObj.setProductDisplay(productDisplay);
6615          copyObj.setBasePrice(basePrice);
6616          copyObj.setUomId(uomId);
6617          copyObj.setWebUrl(webUrl);
6618          copyObj.setShowOnPricelist(showOnPricelist);
6619          copyObj.setVendorId(vendorId);
6620          copyObj.setVendorsCode(vendorsCode);
6621          copyObj.setEanUpcCode(eanUpcCode);
6622          copyObj.setLocation(location);
6623          copyObj.setCustom1(custom1);
6624          copyObj.setCustom2(custom2);
6625          copyObj.setCustom3(custom3);
6626          copyObj.setCustom4(custom4);
6627          copyObj.setCustom5(custom5);
6628          copyObj.setCustom6(custom6);
6629          copyObj.setNotes(notes);
6630          copyObj.setCreated(created);
6631          copyObj.setModified(modified);
6632          copyObj.setCreatedBy(createdBy);
6633          copyObj.setModifiedBy(modifiedBy);
6634  
6635                            copyObj.setProductId( 0);
6636                                                                                                                                                                        
6637                                      
6638                            
6639        List JavaDoc v = getPrintSubscriptions();
6640        for (int i = 0; i < v.size(); i++)
6641        {
6642            PrintSubscription obj = (PrintSubscription) v.get(i);
6643            copyObj.addPrintSubscription(obj.copy());
6644        }
6645                                                  
6646                            
6647        v = getOnlineSubscriptions();
6648        for (int i = 0; i < v.size(); i++)
6649        {
6650            OnlineSubscription obj = (OnlineSubscription) v.get(i);
6651            copyObj.addOnlineSubscription(obj.copy());
6652        }
6653                                                  
6654                            
6655        v = getInboxEvents();
6656        for (int i = 0; i < v.size(); i++)
6657        {
6658            InboxEvent obj = (InboxEvent) v.get(i);
6659            copyObj.addInboxEvent(obj.copy());
6660        }
6661                                                  
6662                            
6663        v = getOutboxEvents();
6664        for (int i = 0; i < v.size(); i++)
6665        {
6666            OutboxEvent obj = (OutboxEvent) v.get(i);
6667            copyObj.addOutboxEvent(obj.copy());
6668        }
6669                                                  
6670                            
6671        v = getNewsSubscriptions();
6672        for (int i = 0; i < v.size(); i++)
6673        {
6674            NewsSubscription obj = (NewsSubscription) v.get(i);
6675            copyObj.addNewsSubscription(obj.copy());
6676        }
6677                                                            
6678                            
6679        v = getNewslettersRelatedByProductId();
6680        for (int i = 0; i < v.size(); i++)
6681        {
6682            Newsletter obj = (Newsletter) v.get(i);
6683            copyObj.addNewsletterRelatedByProductId(obj.copy());
6684        }
6685                                                            
6686                            
6687        v = getNewslettersRelatedByRelProductId();
6688        for (int i = 0; i < v.size(); i++)
6689        {
6690            Newsletter obj = (Newsletter) v.get(i);
6691            copyObj.addNewsletterRelatedByRelProductId(obj.copy());
6692        }
6693                                                  
6694                            
6695        v = getSorderItems();
6696        for (int i = 0; i < v.size(); i++)
6697        {
6698            SorderItem obj = (SorderItem) v.get(i);
6699            copyObj.addSorderItem(obj.copy());
6700        }
6701                                                  
6702                            
6703        v = getPaymentItems();
6704        for (int i = 0; i < v.size(); i++)
6705        {
6706            PaymentItem obj = (PaymentItem) v.get(i);
6707            copyObj.addPaymentItem(obj.copy());
6708        }
6709                                                  
6710                            
6711        v = getShipmentItems();
6712        for (int i = 0; i < v.size(); i++)
6713        {
6714            ShipmentItem obj = (ShipmentItem) v.get(i);
6715            copyObj.addShipmentItem(obj.copy());
6716        }
6717                                                  
6718                            
6719        v = getServiceItems();
6720        for (int i = 0; i < v.size(); i++)
6721        {
6722            ServiceItem obj = (ServiceItem) v.get(i);
6723            copyObj.addServiceItem(obj.copy());
6724        }
6725                            return copyObj;
6726    }
6727
6728    /**
6729     * returns a peer instance associated with this om. Since Peer classes
6730     * are not to have any instance attributes, this method returns the
6731     * same instance for all member of this class. The method could therefore
6732     * be static, but this would prevent one from overriding the behavior.
6733     */

6734    public ProductPeer getPeer()
6735    {
6736        return peer;
6737    }
6738
6739    public String JavaDoc toString()
6740    {
6741        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
6742        str.append("Product:\n");
6743        str.append("ProductId = ")
6744               .append(getProductId())
6745             .append("\n");
6746        str.append("ProductCode = ")
6747               .append(getProductCode())
6748             .append("\n");
6749        str.append("Status = ")
6750               .append(getStatus())
6751             .append("\n");
6752        str.append("Priority = ")
6753               .append(getPriority())
6754             .append("\n");
6755        str.append("ProductType = ")
6756               .append(getProductType())
6757             .append("\n");
6758        str.append("ProductCatId = ")
6759               .append(getProductCatId())
6760             .append("\n");
6761        str.append("ProductDescription = ")
6762               .append(getProductDescription())
6763             .append("\n");
6764        str.append("ProductDisplay = ")
6765               .append(getProductDisplay())
6766             .append("\n");
6767        str.append("BasePrice = ")
6768               .append(getBasePrice())
6769             .append("\n");
6770        str.append("UomId = ")
6771               .append(getUomId())
6772             .append("\n");
6773        str.append("WebUrl = ")
6774               .append(getWebUrl())
6775             .append("\n");
6776        str.append("ShowOnPricelist = ")
6777               .append(getShowOnPricelist())
6778             .append("\n");
6779        str.append("VendorId = ")
6780               .append(getVendorId())
6781             .append("\n");
6782        str.append("VendorsCode = ")
6783               .append(getVendorsCode())
6784             .append("\n");
6785        str.append("EanUpcCode = ")
6786               .append(getEanUpcCode())
6787             .append("\n");
6788        str.append("Location = ")
6789               .append(getLocation())
6790             .append("\n");
6791        str.append("Custom1 = ")
6792               .append(getCustom1())
6793             .append("\n");
6794        str.append("Custom2 = ")
6795               .append(getCustom2())
6796             .append("\n");
6797        str.append("Custom3 = ")
6798               .append(getCustom3())
6799             .append("\n");
6800        str.append("Custom4 = ")
6801               .append(getCustom4())
6802             .append("\n");
6803        str.append("Custom5 = ")
6804               .append(getCustom5())
6805             .append("\n");
6806        str.append("Custom6 = ")
6807               .append(getCustom6())
6808             .append("\n");
6809        str.append("Notes = ")
6810               .append(getNotes())
6811             .append("\n");
6812        str.append("Created = ")
6813               .append(getCreated())
6814             .append("\n");
6815        str.append("Modified = ")
6816               .append(getModified())
6817             .append("\n");
6818        str.append("CreatedBy = ")
6819               .append(getCreatedBy())
6820             .append("\n");
6821        str.append("ModifiedBy = ")
6822               .append(getModifiedBy())
6823             .append("\n");
6824        return(str.toString());
6825    }
6826}
6827
Popular Tags