KickJava   Java API By Example, From Geeks To Geeks.

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


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

35 public abstract class BaseProject extends BaseObject
36     implements org.apache.turbine.om.Retrievable
37 {
38     /** The Peer class */
39     private static final ProjectPeer peer =
40         new ProjectPeer();
41
42         
43     /** The value for the projectId field */
44     private int projectId;
45                                                 
46     /** The value for the projectCode field */
47     private String JavaDoc projectCode = "AUTO";
48                                           
49     /** The value for the status field */
50     private int status = 30;
51                                           
52     /** The value for the priority field */
53     private int priority = 30;
54                                           
55     /** The value for the projectCatId field */
56     private int projectCatId = 1000;
57       
58     /** The value for the projectName field */
59     private String JavaDoc projectName;
60       
61     /** The value for the startDate field */
62     private Date JavaDoc startDate;
63       
64     /** The value for the endDate field */
65     private Date JavaDoc endDate;
66                                   
67     /** The value for the expenses field */
68     private BigDecimal JavaDoc expenses= new BigDecimal JavaDoc(0);
69                                   
70     /** The value for the revenues field */
71     private BigDecimal JavaDoc revenues= new BigDecimal JavaDoc(0);
72       
73     /** The value for the custom1 field */
74     private String JavaDoc custom1;
75       
76     /** The value for the custom2 field */
77     private String JavaDoc custom2;
78       
79     /** The value for the custom3 field */
80     private String JavaDoc custom3;
81       
82     /** The value for the custom4 field */
83     private String JavaDoc custom4;
84       
85     /** The value for the custom5 field */
86     private String JavaDoc custom5;
87       
88     /** The value for the custom6 field */
89     private String JavaDoc custom6;
90       
91     /** The value for the notes field */
92     private String JavaDoc notes;
93       
94     /** The value for the created field */
95     private Date JavaDoc created;
96       
97     /** The value for the modified field */
98     private Date JavaDoc modified;
99       
100     /** The value for the createdBy field */
101     private String JavaDoc createdBy;
102       
103     /** The value for the modifiedBy field */
104     private String JavaDoc modifiedBy;
105   
106     
107     /**
108      * Get the ProjectId
109      *
110      * @return int
111      */

112     public int getProjectId()
113     {
114         return projectId;
115     }
116
117                                               
118     /**
119      * Set the value of ProjectId
120      *
121      * @param v new value
122      */

123     public void setProjectId(int v) throws TorqueException
124     {
125     
126                   if (this.projectId != v)
127               {
128             this.projectId = v;
129             setModified(true);
130         }
131     
132           
133                                   
134                   // update associated Sorder
135
if (collSorders != null)
136         {
137             for (int i = 0; i < collSorders.size(); i++)
138             {
139                 ((Sorder) collSorders.get(i))
140                     .setProjectId(v);
141             }
142         }
143                                                     
144                   // update associated Payment
145
if (collPayments != null)
146         {
147             for (int i = 0; i < collPayments.size(); i++)
148             {
149                 ((Payment) collPayments.get(i))
150                     .setProjectId(v);
151             }
152         }
153                                                     
154                   // update associated Service
155
if (collServices != null)
156         {
157             for (int i = 0; i < collServices.size(); i++)
158             {
159                 ((Service) collServices.get(i))
160                     .setProjectId(v);
161             }
162         }
163                                                     
164                   // update associated Shipment
165
if (collShipments != null)
166         {
167             for (int i = 0; i < collShipments.size(); i++)
168             {
169                 ((Shipment) collShipments.get(i))
170                     .setProjectId(v);
171             }
172         }
173                                                     
174                   // update associated PrintSubscription
175
if (collPrintSubscriptions != null)
176         {
177             for (int i = 0; i < collPrintSubscriptions.size(); i++)
178             {
179                 ((PrintSubscription) collPrintSubscriptions.get(i))
180                     .setProjectId(v);
181             }
182         }
183                                                     
184                   // update associated OnlineSubscription
185
if (collOnlineSubscriptions != null)
186         {
187             for (int i = 0; i < collOnlineSubscriptions.size(); i++)
188             {
189                 ((OnlineSubscription) collOnlineSubscriptions.get(i))
190                     .setProjectId(v);
191             }
192         }
193                                                     
194                   // update associated InboxEvent
195
if (collInboxEvents != null)
196         {
197             for (int i = 0; i < collInboxEvents.size(); i++)
198             {
199                 ((InboxEvent) collInboxEvents.get(i))
200                     .setProjectId(v);
201             }
202         }
203                                                     
204                   // update associated OutboxEvent
205
if (collOutboxEvents != null)
206         {
207             for (int i = 0; i < collOutboxEvents.size(); i++)
208             {
209                 ((OutboxEvent) collOutboxEvents.get(i))
210                     .setProjectId(v);
211             }
212         }
213                                                     
214                   // update associated NewsSubscription
215
if (collNewsSubscriptions != null)
216         {
217             for (int i = 0; i < collNewsSubscriptions.size(); i++)
218             {
219                 ((NewsSubscription) collNewsSubscriptions.get(i))
220                     .setProjectId(v);
221             }
222         }
223                                                     
224                   // update associated Newsletter
225
if (collNewslettersRelatedByProjectId != null)
226         {
227             for (int i = 0; i < collNewslettersRelatedByProjectId.size(); i++)
228             {
229                 ((Newsletter) collNewslettersRelatedByProjectId.get(i))
230                     .setProjectId(v);
231             }
232         }
233                                                     
234                   // update associated Newsletter
235
if (collNewslettersRelatedByRelProjectId != null)
236         {
237             for (int i = 0; i < collNewslettersRelatedByRelProjectId.size(); i++)
238             {
239                 ((Newsletter) collNewslettersRelatedByRelProjectId.get(i))
240                     .setRelProjectId(v);
241             }
242         }
243                                                     
244                   // update associated SorderItem
245
if (collSorderItems != null)
246         {
247             for (int i = 0; i < collSorderItems.size(); i++)
248             {
249                 ((SorderItem) collSorderItems.get(i))
250                     .setProjectId(v);
251             }
252         }
253                                                     
254                   // update associated PaymentItem
255
if (collPaymentItems != null)
256         {
257             for (int i = 0; i < collPaymentItems.size(); i++)
258             {
259                 ((PaymentItem) collPaymentItems.get(i))
260                     .setProjectId(v);
261             }
262         }
263                                                     
264                   // update associated ShipmentItem
265
if (collShipmentItems != null)
266         {
267             for (int i = 0; i < collShipmentItems.size(); i++)
268             {
269                 ((ShipmentItem) collShipmentItems.get(i))
270                     .setProjectId(v);
271             }
272         }
273                                                     
274                   // update associated ServiceItem
275
if (collServiceItems != null)
276         {
277             for (int i = 0; i < collServiceItems.size(); i++)
278             {
279                 ((ServiceItem) collServiceItems.get(i))
280                     .setProjectId(v);
281             }
282         }
283                                 }
284   
285     /**
286      * Get the ProjectCode
287      *
288      * @return String
289      */

290     public String JavaDoc getProjectCode()
291     {
292         return projectCode;
293     }
294
295                         
296     /**
297      * Set the value of ProjectCode
298      *
299      * @param v new value
300      */

301     public void setProjectCode(String JavaDoc v)
302     {
303     
304                   if (!ObjectUtils.equals(this.projectCode, v))
305               {
306             this.projectCode = v;
307             setModified(true);
308         }
309     
310           
311               }
312   
313     /**
314      * Get the Status
315      *
316      * @return int
317      */

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

329     public void setStatus(int v)
330     {
331     
332                   if (this.status != v)
333               {
334             this.status = v;
335             setModified(true);
336         }
337     
338           
339               }
340   
341     /**
342      * Get the Priority
343      *
344      * @return int
345      */

346     public int getPriority()
347     {
348         return priority;
349     }
350
351                         
352     /**
353      * Set the value of Priority
354      *
355      * @param v new value
356      */

357     public void setPriority(int v)
358     {
359     
360                   if (this.priority != v)
361               {
362             this.priority = v;
363             setModified(true);
364         }
365     
366           
367               }
368   
369     /**
370      * Get the ProjectCatId
371      *
372      * @return int
373      */

374     public int getProjectCatId()
375     {
376         return projectCatId;
377     }
378
379                               
380     /**
381      * Set the value of ProjectCatId
382      *
383      * @param v new value
384      */

385     public void setProjectCatId(int v) throws TorqueException
386     {
387     
388                   if (this.projectCatId != v)
389               {
390             this.projectCatId = v;
391             setModified(true);
392         }
393     
394                           
395                 if (aProjectCategory != null && !(aProjectCategory.getProjectCatId() == v))
396                 {
397             aProjectCategory = null;
398         }
399       
400               }
401   
402     /**
403      * Get the ProjectName
404      *
405      * @return String
406      */

407     public String JavaDoc getProjectName()
408     {
409         return projectName;
410     }
411
412                         
413     /**
414      * Set the value of ProjectName
415      *
416      * @param v new value
417      */

418     public void setProjectName(String JavaDoc v)
419     {
420     
421                   if (!ObjectUtils.equals(this.projectName, v))
422               {
423             this.projectName = v;
424             setModified(true);
425         }
426     
427           
428               }
429   
430     /**
431      * Get the StartDate
432      *
433      * @return Date
434      */

435     public Date JavaDoc getStartDate()
436     {
437         return startDate;
438     }
439
440                         
441     /**
442      * Set the value of StartDate
443      *
444      * @param v new value
445      */

446     public void setStartDate(Date JavaDoc v)
447     {
448     
449                   if (!ObjectUtils.equals(this.startDate, v))
450               {
451             this.startDate = v;
452             setModified(true);
453         }
454     
455           
456               }
457   
458     /**
459      * Get the EndDate
460      *
461      * @return Date
462      */

463     public Date JavaDoc getEndDate()
464     {
465         return endDate;
466     }
467
468                         
469     /**
470      * Set the value of EndDate
471      *
472      * @param v new value
473      */

474     public void setEndDate(Date JavaDoc v)
475     {
476     
477                   if (!ObjectUtils.equals(this.endDate, v))
478               {
479             this.endDate = v;
480             setModified(true);
481         }
482     
483           
484               }
485   
486     /**
487      * Get the Expenses
488      *
489      * @return BigDecimal
490      */

491     public BigDecimal JavaDoc getExpenses()
492     {
493         return expenses;
494     }
495
496                         
497     /**
498      * Set the value of Expenses
499      *
500      * @param v new value
501      */

502     public void setExpenses(BigDecimal JavaDoc v)
503     {
504     
505                   if (!ObjectUtils.equals(this.expenses, v))
506               {
507             this.expenses = v;
508             setModified(true);
509         }
510     
511           
512               }
513   
514     /**
515      * Get the Revenues
516      *
517      * @return BigDecimal
518      */

519     public BigDecimal JavaDoc getRevenues()
520     {
521         return revenues;
522     }
523
524                         
525     /**
526      * Set the value of Revenues
527      *
528      * @param v new value
529      */

530     public void setRevenues(BigDecimal JavaDoc v)
531     {
532     
533                   if (!ObjectUtils.equals(this.revenues, v))
534               {
535             this.revenues = v;
536             setModified(true);
537         }
538     
539           
540               }
541   
542     /**
543      * Get the Custom1
544      *
545      * @return String
546      */

547     public String JavaDoc getCustom1()
548     {
549         return custom1;
550     }
551
552                         
553     /**
554      * Set the value of Custom1
555      *
556      * @param v new value
557      */

558     public void setCustom1(String JavaDoc v)
559     {
560     
561                   if (!ObjectUtils.equals(this.custom1, v))
562               {
563             this.custom1 = v;
564             setModified(true);
565         }
566     
567           
568               }
569   
570     /**
571      * Get the Custom2
572      *
573      * @return String
574      */

575     public String JavaDoc getCustom2()
576     {
577         return custom2;
578     }
579
580                         
581     /**
582      * Set the value of Custom2
583      *
584      * @param v new value
585      */

586     public void setCustom2(String JavaDoc v)
587     {
588     
589                   if (!ObjectUtils.equals(this.custom2, v))
590               {
591             this.custom2 = v;
592             setModified(true);
593         }
594     
595           
596               }
597   
598     /**
599      * Get the Custom3
600      *
601      * @return String
602      */

603     public String JavaDoc getCustom3()
604     {
605         return custom3;
606     }
607
608                         
609     /**
610      * Set the value of Custom3
611      *
612      * @param v new value
613      */

614     public void setCustom3(String JavaDoc v)
615     {
616     
617                   if (!ObjectUtils.equals(this.custom3, v))
618               {
619             this.custom3 = v;
620             setModified(true);
621         }
622     
623           
624               }
625   
626     /**
627      * Get the Custom4
628      *
629      * @return String
630      */

631     public String JavaDoc getCustom4()
632     {
633         return custom4;
634     }
635
636                         
637     /**
638      * Set the value of Custom4
639      *
640      * @param v new value
641      */

642     public void setCustom4(String JavaDoc v)
643     {
644     
645                   if (!ObjectUtils.equals(this.custom4, v))
646               {
647             this.custom4 = v;
648             setModified(true);
649         }
650     
651           
652               }
653   
654     /**
655      * Get the Custom5
656      *
657      * @return String
658      */

659     public String JavaDoc getCustom5()
660     {
661         return custom5;
662     }
663
664                         
665     /**
666      * Set the value of Custom5
667      *
668      * @param v new value
669      */

670     public void setCustom5(String JavaDoc v)
671     {
672     
673                   if (!ObjectUtils.equals(this.custom5, v))
674               {
675             this.custom5 = v;
676             setModified(true);
677         }
678     
679           
680               }
681   
682     /**
683      * Get the Custom6
684      *
685      * @return String
686      */

687     public String JavaDoc getCustom6()
688     {
689         return custom6;
690     }
691
692                         
693     /**
694      * Set the value of Custom6
695      *
696      * @param v new value
697      */

698     public void setCustom6(String JavaDoc v)
699     {
700     
701                   if (!ObjectUtils.equals(this.custom6, v))
702               {
703             this.custom6 = v;
704             setModified(true);
705         }
706     
707           
708               }
709   
710     /**
711      * Get the Notes
712      *
713      * @return String
714      */

715     public String JavaDoc getNotes()
716     {
717         return notes;
718     }
719
720                         
721     /**
722      * Set the value of Notes
723      *
724      * @param v new value
725      */

726     public void setNotes(String JavaDoc v)
727     {
728     
729                   if (!ObjectUtils.equals(this.notes, v))
730               {
731             this.notes = v;
732             setModified(true);
733         }
734     
735           
736               }
737   
738     /**
739      * Get the Created
740      *
741      * @return Date
742      */

743     public Date JavaDoc getCreated()
744     {
745         return created;
746     }
747
748                         
749     /**
750      * Set the value of Created
751      *
752      * @param v new value
753      */

754     public void setCreated(Date JavaDoc v)
755     {
756     
757                   if (!ObjectUtils.equals(this.created, v))
758               {
759             this.created = v;
760             setModified(true);
761         }
762     
763           
764               }
765   
766     /**
767      * Get the Modified
768      *
769      * @return Date
770      */

771     public Date JavaDoc getModified()
772     {
773         return modified;
774     }
775
776                         
777     /**
778      * Set the value of Modified
779      *
780      * @param v new value
781      */

782     public void setModified(Date JavaDoc v)
783     {
784     
785                   if (!ObjectUtils.equals(this.modified, v))
786               {
787             this.modified = v;
788             setModified(true);
789         }
790     
791           
792               }
793   
794     /**
795      * Get the CreatedBy
796      *
797      * @return String
798      */

799     public String JavaDoc getCreatedBy()
800     {
801         return createdBy;
802     }
803
804                         
805     /**
806      * Set the value of CreatedBy
807      *
808      * @param v new value
809      */

810     public void setCreatedBy(String JavaDoc v)
811     {
812     
813                   if (!ObjectUtils.equals(this.createdBy, v))
814               {
815             this.createdBy = v;
816             setModified(true);
817         }
818     
819           
820               }
821   
822     /**
823      * Get the ModifiedBy
824      *
825      * @return String
826      */

827     public String JavaDoc getModifiedBy()
828     {
829         return modifiedBy;
830     }
831
832                         
833     /**
834      * Set the value of ModifiedBy
835      *
836      * @param v new value
837      */

838     public void setModifiedBy(String JavaDoc v)
839     {
840     
841                   if (!ObjectUtils.equals(this.modifiedBy, v))
842               {
843             this.modifiedBy = v;
844             setModified(true);
845         }
846     
847           
848               }
849   
850       
851     
852                   
853     
854         private ProjectCategory aProjectCategory;
855
856     /**
857      * Declares an association between this object and a ProjectCategory object
858      *
859      * @param v ProjectCategory
860      * @throws TorqueException
861      */

862     public void setProjectCategory(ProjectCategory v) throws TorqueException
863     {
864             if (v == null)
865         {
866                           setProjectCatId( 1000);
867               }
868         else
869         {
870             setProjectCatId(v.getProjectCatId());
871         }
872             aProjectCategory = v;
873     }
874
875                                             
876     /**
877      * Get the associated ProjectCategory object
878      *
879      * @return the associated ProjectCategory object
880      * @throws TorqueException
881      */

882     public ProjectCategory getProjectCategory() throws TorqueException
883     {
884         if (aProjectCategory == null && (this.projectCatId != 0))
885         {
886                           aProjectCategory = ProjectCategoryPeer.retrieveByPK(SimpleKey.keyFor(this.projectCatId));
887               
888             /* The following can be used instead of the line above to
889                guarantee the related object contains a reference
890                to this object, but this level of coupling
891                may be undesirable in many circumstances.
892                As it can lead to a db query with many results that may
893                never be used.
894                ProjectCategory obj = ProjectCategoryPeer.retrieveByPK(this.projectCatId);
895                obj.addProjects(this);
896             */

897         }
898         return aProjectCategory;
899     }
900
901     /**
902      * Provides convenient way to set a relationship based on a
903      * ObjectKey, for example
904      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
905      *
906          */

907     public void setProjectCategoryKey(ObjectKey key) throws TorqueException
908     {
909       
910                         setProjectCatId(((NumberKey) key).intValue());
911                   }
912        
913                                 
914             
915           /**
916      * Collection to store aggregation of collSorders
917      */

918     protected List JavaDoc collSorders;
919
920     /**
921      * Temporary storage of collSorders to save a possible db hit in
922      * the event objects are add to the collection, but the
923      * complete collection is never requested.
924      */

925     protected void initSorders()
926     {
927         if (collSorders == null)
928         {
929             collSorders = new ArrayList JavaDoc();
930         }
931     }
932
933     /**
934      * Method called to associate a Sorder object to this object
935      * through the Sorder foreign key attribute
936      *
937      * @param l Sorder
938      * @throws TorqueException
939      */

940     public void addSorder(Sorder l) throws TorqueException
941     {
942         getSorders().add(l);
943         l.setProject((Project) this);
944     }
945
946     /**
947      * The criteria used to select the current contents of collSorders
948      */

949     private Criteria lastSordersCriteria = null;
950       
951     /**
952      * If this collection has already been initialized, returns
953      * the collection. Otherwise returns the results of
954      * getSorders(new Criteria())
955      *
956      * @throws TorqueException
957      */

958     public List JavaDoc getSorders() throws TorqueException
959     {
960               if (collSorders == null)
961         {
962             collSorders = getSorders(new Criteria(10));
963         }
964         return collSorders;
965           }
966
967     /**
968      * If this collection has already been initialized with
969      * an identical criteria, it returns the collection.
970      * Otherwise if this Project has previously
971      * been saved, it will retrieve related Sorders from storage.
972      * If this Project is new, it will return
973      * an empty collection or the current collection, the criteria
974      * is ignored on a new object.
975      *
976      * @throws TorqueException
977      */

978     public List JavaDoc getSorders(Criteria criteria) throws TorqueException
979     {
980               if (collSorders == null)
981         {
982             if (isNew())
983             {
984                collSorders = new ArrayList JavaDoc();
985             }
986             else
987             {
988                         criteria.add(SorderPeer.PROJECT_ID, getProjectId() );
989                         collSorders = SorderPeer.doSelect(criteria);
990             }
991         }
992         else
993         {
994             // criteria has no effect for a new object
995
if (!isNew())
996             {
997                 // the following code is to determine if a new query is
998
// called for. If the criteria is the same as the last
999
// one, just return the collection.
1000
criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1001                            if (!lastSordersCriteria.equals(criteria))
1002                {
1003                    collSorders = SorderPeer.doSelect(criteria);
1004                }
1005            }
1006        }
1007        lastSordersCriteria = criteria;
1008
1009        return collSorders;
1010          }
1011
1012    /**
1013     * If this collection has already been initialized, returns
1014     * the collection. Otherwise returns the results of
1015     * getSorders(new Criteria(),Connection)
1016     * This method takes in the Connection also as input so that
1017     * referenced objects can also be obtained using a Connection
1018     * that is taken as input
1019     */

1020    public List JavaDoc getSorders(Connection JavaDoc con) throws TorqueException
1021    {
1022              if (collSorders == null)
1023        {
1024            collSorders = getSorders(new Criteria(10), con);
1025        }
1026        return collSorders;
1027          }
1028
1029    /**
1030     * If this collection has already been initialized with
1031     * an identical criteria, it returns the collection.
1032     * Otherwise if this Project has previously
1033     * been saved, it will retrieve related Sorders from storage.
1034     * If this Project is new, it will return
1035     * an empty collection or the current collection, the criteria
1036     * is ignored on a new object.
1037     * This method takes in the Connection also as input so that
1038     * referenced objects can also be obtained using a Connection
1039     * that is taken as input
1040     */

1041    public List JavaDoc getSorders(Criteria criteria, Connection JavaDoc con)
1042            throws TorqueException
1043    {
1044              if (collSorders == null)
1045        {
1046            if (isNew())
1047            {
1048               collSorders = new ArrayList JavaDoc();
1049            }
1050            else
1051            {
1052                         criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1053                         collSorders = SorderPeer.doSelect(criteria, con);
1054             }
1055         }
1056         else
1057         {
1058             // criteria has no effect for a new object
1059
if (!isNew())
1060             {
1061                 // the following code is to determine if a new query is
1062
// called for. If the criteria is the same as the last
1063
// one, just return the collection.
1064
criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1065                             if (!lastSordersCriteria.equals(criteria))
1066                 {
1067                     collSorders = SorderPeer.doSelect(criteria, con);
1068                 }
1069             }
1070         }
1071         lastSordersCriteria = criteria;
1072
1073         return collSorders;
1074           }
1075
1076                                          
1077              
1078                    
1079                    
1080                                            
1081                                                                          
1082                                        
1083                    
1084                    
1085          
1086    /**
1087     * If this collection has already been initialized with
1088     * an identical criteria, it returns the collection.
1089     * Otherwise if this Project is new, it will return
1090     * an empty collection; or if this Project has previously
1091     * been saved, it will retrieve related Sorders from storage.
1092     *
1093     * This method is protected by default in order to keep the public
1094     * api reasonable. You can provide public methods for those you
1095     * actually need in Project.
1096     */

1097    protected List JavaDoc getSordersJoinCustomerRelatedByCustomerId(Criteria criteria)
1098        throws TorqueException
1099    {
1100                    if (collSorders == null)
1101        {
1102            if (isNew())
1103            {
1104               collSorders = new ArrayList JavaDoc();
1105            }
1106            else
1107            {
1108                              criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1109                              collSorders = SorderPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1110            }
1111        }
1112        else
1113        {
1114            // the following code is to determine if a new query is
1115
// called for. If the criteria is the same as the last
1116
// one, just return the collection.
1117

1118                        criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1119                                    if (!lastSordersCriteria.equals(criteria))
1120            {
1121                collSorders = SorderPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1122            }
1123        }
1124        lastSordersCriteria = criteria;
1125
1126        return collSorders;
1127                }
1128                  
1129                    
1130                    
1131                                            
1132                                                                          
1133                                        
1134                    
1135                    
1136          
1137    /**
1138     * If this collection has already been initialized with
1139     * an identical criteria, it returns the collection.
1140     * Otherwise if this Project is new, it will return
1141     * an empty collection; or if this Project has previously
1142     * been saved, it will retrieve related Sorders from storage.
1143     *
1144     * This method is protected by default in order to keep the public
1145     * api reasonable. You can provide public methods for those you
1146     * actually need in Project.
1147     */

1148    protected List JavaDoc getSordersJoinCustomerRelatedByRecipientId(Criteria criteria)
1149        throws TorqueException
1150    {
1151                    if (collSorders == null)
1152        {
1153            if (isNew())
1154            {
1155               collSorders = new ArrayList JavaDoc();
1156            }
1157            else
1158            {
1159                              criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1160                              collSorders = SorderPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1161            }
1162        }
1163        else
1164        {
1165            // the following code is to determine if a new query is
1166
// called for. If the criteria is the same as the last
1167
// one, just return the collection.
1168

1169                        criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1170                                    if (!lastSordersCriteria.equals(criteria))
1171            {
1172                collSorders = SorderPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1173            }
1174        }
1175        lastSordersCriteria = criteria;
1176
1177        return collSorders;
1178                }
1179                  
1180                    
1181                              
1182                                
1183                                                              
1184                                        
1185                    
1186                    
1187          
1188    /**
1189     * If this collection has already been initialized with
1190     * an identical criteria, it returns the collection.
1191     * Otherwise if this Project is new, it will return
1192     * an empty collection; or if this Project has previously
1193     * been saved, it will retrieve related Sorders from storage.
1194     *
1195     * This method is protected by default in order to keep the public
1196     * api reasonable. You can provide public methods for those you
1197     * actually need in Project.
1198     */

1199    protected List JavaDoc getSordersJoinProject(Criteria criteria)
1200        throws TorqueException
1201    {
1202                    if (collSorders == null)
1203        {
1204            if (isNew())
1205            {
1206               collSorders = new ArrayList JavaDoc();
1207            }
1208            else
1209            {
1210                              criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1211                              collSorders = SorderPeer.doSelectJoinProject(criteria);
1212            }
1213        }
1214        else
1215        {
1216            // the following code is to determine if a new query is
1217
// called for. If the criteria is the same as the last
1218
// one, just return the collection.
1219

1220                        criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1221                                    if (!lastSordersCriteria.equals(criteria))
1222            {
1223                collSorders = SorderPeer.doSelectJoinProject(criteria);
1224            }
1225        }
1226        lastSordersCriteria = criteria;
1227
1228        return collSorders;
1229                }
1230                  
1231                    
1232                    
1233                                
1234                                                              
1235                                        
1236                    
1237                    
1238          
1239    /**
1240     * If this collection has already been initialized with
1241     * an identical criteria, it returns the collection.
1242     * Otherwise if this Project is new, it will return
1243     * an empty collection; or if this Project has previously
1244     * been saved, it will retrieve related Sorders from storage.
1245     *
1246     * This method is protected by default in order to keep the public
1247     * api reasonable. You can provide public methods for those you
1248     * actually need in Project.
1249     */

1250    protected List JavaDoc getSordersJoinCarrier(Criteria criteria)
1251        throws TorqueException
1252    {
1253                    if (collSorders == null)
1254        {
1255            if (isNew())
1256            {
1257               collSorders = new ArrayList JavaDoc();
1258            }
1259            else
1260            {
1261                              criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1262                              collSorders = SorderPeer.doSelectJoinCarrier(criteria);
1263            }
1264        }
1265        else
1266        {
1267            // the following code is to determine if a new query is
1268
// called for. If the criteria is the same as the last
1269
// one, just return the collection.
1270

1271                        criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1272                                    if (!lastSordersCriteria.equals(criteria))
1273            {
1274                collSorders = SorderPeer.doSelectJoinCarrier(criteria);
1275            }
1276        }
1277        lastSordersCriteria = criteria;
1278
1279        return collSorders;
1280                }
1281                  
1282                    
1283                    
1284                                
1285                                                              
1286                                        
1287                    
1288                    
1289          
1290    /**
1291     * If this collection has already been initialized with
1292     * an identical criteria, it returns the collection.
1293     * Otherwise if this Project is new, it will return
1294     * an empty collection; or if this Project has previously
1295     * been saved, it will retrieve related Sorders from storage.
1296     *
1297     * This method is protected by default in order to keep the public
1298     * api reasonable. You can provide public methods for those you
1299     * actually need in Project.
1300     */

1301    protected List JavaDoc getSordersJoinCurrency(Criteria criteria)
1302        throws TorqueException
1303    {
1304                    if (collSorders == null)
1305        {
1306            if (isNew())
1307            {
1308               collSorders = new ArrayList JavaDoc();
1309            }
1310            else
1311            {
1312                              criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1313                              collSorders = SorderPeer.doSelectJoinCurrency(criteria);
1314            }
1315        }
1316        else
1317        {
1318            // the following code is to determine if a new query is
1319
// called for. If the criteria is the same as the last
1320
// one, just return the collection.
1321

1322                        criteria.add(SorderPeer.PROJECT_ID, getProjectId());
1323                                    if (!lastSordersCriteria.equals(criteria))
1324            {
1325                collSorders = SorderPeer.doSelectJoinCurrency(criteria);
1326            }
1327        }
1328        lastSordersCriteria = criteria;
1329
1330        return collSorders;
1331                }
1332                            
1333
1334
1335                          
1336            
1337          /**
1338     * Collection to store aggregation of collPayments
1339     */

1340    protected List JavaDoc collPayments;
1341
1342    /**
1343     * Temporary storage of collPayments to save a possible db hit in
1344     * the event objects are add to the collection, but the
1345     * complete collection is never requested.
1346     */

1347    protected void initPayments()
1348    {
1349        if (collPayments == null)
1350        {
1351            collPayments = new ArrayList JavaDoc();
1352        }
1353    }
1354
1355    /**
1356     * Method called to associate a Payment object to this object
1357     * through the Payment foreign key attribute
1358     *
1359     * @param l Payment
1360     * @throws TorqueException
1361     */

1362    public void addPayment(Payment l) throws TorqueException
1363    {
1364        getPayments().add(l);
1365        l.setProject((Project) this);
1366    }
1367
1368    /**
1369     * The criteria used to select the current contents of collPayments
1370     */

1371    private Criteria lastPaymentsCriteria = null;
1372      
1373    /**
1374     * If this collection has already been initialized, returns
1375     * the collection. Otherwise returns the results of
1376     * getPayments(new Criteria())
1377     *
1378     * @throws TorqueException
1379     */

1380    public List JavaDoc getPayments() throws TorqueException
1381    {
1382              if (collPayments == null)
1383        {
1384            collPayments = getPayments(new Criteria(10));
1385        }
1386        return collPayments;
1387          }
1388
1389    /**
1390     * If this collection has already been initialized with
1391     * an identical criteria, it returns the collection.
1392     * Otherwise if this Project has previously
1393     * been saved, it will retrieve related Payments from storage.
1394     * If this Project is new, it will return
1395     * an empty collection or the current collection, the criteria
1396     * is ignored on a new object.
1397     *
1398     * @throws TorqueException
1399     */

1400    public List JavaDoc getPayments(Criteria criteria) throws TorqueException
1401    {
1402              if (collPayments == null)
1403        {
1404            if (isNew())
1405            {
1406               collPayments = new ArrayList JavaDoc();
1407            }
1408            else
1409            {
1410                        criteria.add(PaymentPeer.PROJECT_ID, getProjectId() );
1411                        collPayments = PaymentPeer.doSelect(criteria);
1412            }
1413        }
1414        else
1415        {
1416            // criteria has no effect for a new object
1417
if (!isNew())
1418            {
1419                // the following code is to determine if a new query is
1420
// called for. If the criteria is the same as the last
1421
// one, just return the collection.
1422
criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1423                            if (!lastPaymentsCriteria.equals(criteria))
1424                {
1425                    collPayments = PaymentPeer.doSelect(criteria);
1426                }
1427            }
1428        }
1429        lastPaymentsCriteria = criteria;
1430
1431        return collPayments;
1432          }
1433
1434    /**
1435     * If this collection has already been initialized, returns
1436     * the collection. Otherwise returns the results of
1437     * getPayments(new Criteria(),Connection)
1438     * This method takes in the Connection also as input so that
1439     * referenced objects can also be obtained using a Connection
1440     * that is taken as input
1441     */

1442    public List JavaDoc getPayments(Connection JavaDoc con) throws TorqueException
1443    {
1444              if (collPayments == null)
1445        {
1446            collPayments = getPayments(new Criteria(10), con);
1447        }
1448        return collPayments;
1449          }
1450
1451    /**
1452     * If this collection has already been initialized with
1453     * an identical criteria, it returns the collection.
1454     * Otherwise if this Project has previously
1455     * been saved, it will retrieve related Payments from storage.
1456     * If this Project is new, it will return
1457     * an empty collection or the current collection, the criteria
1458     * is ignored on a new object.
1459     * This method takes in the Connection also as input so that
1460     * referenced objects can also be obtained using a Connection
1461     * that is taken as input
1462     */

1463    public List JavaDoc getPayments(Criteria criteria, Connection JavaDoc con)
1464            throws TorqueException
1465    {
1466              if (collPayments == null)
1467        {
1468            if (isNew())
1469            {
1470               collPayments = new ArrayList JavaDoc();
1471            }
1472            else
1473            {
1474                         criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1475                         collPayments = PaymentPeer.doSelect(criteria, con);
1476             }
1477         }
1478         else
1479         {
1480             // criteria has no effect for a new object
1481
if (!isNew())
1482             {
1483                 // the following code is to determine if a new query is
1484
// called for. If the criteria is the same as the last
1485
// one, just return the collection.
1486
criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1487                             if (!lastPaymentsCriteria.equals(criteria))
1488                 {
1489                     collPayments = PaymentPeer.doSelect(criteria, con);
1490                 }
1491             }
1492         }
1493         lastPaymentsCriteria = criteria;
1494
1495         return collPayments;
1496           }
1497
1498                                    
1499              
1500                    
1501                    
1502                                
1503                                                              
1504                                        
1505                    
1506                    
1507          
1508    /**
1509     * If this collection has already been initialized with
1510     * an identical criteria, it returns the collection.
1511     * Otherwise if this Project is new, it will return
1512     * an empty collection; or if this Project has previously
1513     * been saved, it will retrieve related Payments from storage.
1514     *
1515     * This method is protected by default in order to keep the public
1516     * api reasonable. You can provide public methods for those you
1517     * actually need in Project.
1518     */

1519    protected List JavaDoc getPaymentsJoinCustomer(Criteria criteria)
1520        throws TorqueException
1521    {
1522                    if (collPayments == null)
1523        {
1524            if (isNew())
1525            {
1526               collPayments = new ArrayList JavaDoc();
1527            }
1528            else
1529            {
1530                              criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1531                              collPayments = PaymentPeer.doSelectJoinCustomer(criteria);
1532            }
1533        }
1534        else
1535        {
1536            // the following code is to determine if a new query is
1537
// called for. If the criteria is the same as the last
1538
// one, just return the collection.
1539

1540                        criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1541                                    if (!lastPaymentsCriteria.equals(criteria))
1542            {
1543                collPayments = PaymentPeer.doSelectJoinCustomer(criteria);
1544            }
1545        }
1546        lastPaymentsCriteria = criteria;
1547
1548        return collPayments;
1549                }
1550                  
1551                    
1552                              
1553                                
1554                                                              
1555                                        
1556                    
1557                    
1558          
1559    /**
1560     * If this collection has already been initialized with
1561     * an identical criteria, it returns the collection.
1562     * Otherwise if this Project is new, it will return
1563     * an empty collection; or if this Project has previously
1564     * been saved, it will retrieve related Payments from storage.
1565     *
1566     * This method is protected by default in order to keep the public
1567     * api reasonable. You can provide public methods for those you
1568     * actually need in Project.
1569     */

1570    protected List JavaDoc getPaymentsJoinProject(Criteria criteria)
1571        throws TorqueException
1572    {
1573                    if (collPayments == null)
1574        {
1575            if (isNew())
1576            {
1577               collPayments = new ArrayList JavaDoc();
1578            }
1579            else
1580            {
1581                              criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1582                              collPayments = PaymentPeer.doSelectJoinProject(criteria);
1583            }
1584        }
1585        else
1586        {
1587            // the following code is to determine if a new query is
1588
// called for. If the criteria is the same as the last
1589
// one, just return the collection.
1590

1591                        criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1592                                    if (!lastPaymentsCriteria.equals(criteria))
1593            {
1594                collPayments = PaymentPeer.doSelectJoinProject(criteria);
1595            }
1596        }
1597        lastPaymentsCriteria = criteria;
1598
1599        return collPayments;
1600                }
1601                  
1602                    
1603                    
1604                                
1605                                                              
1606                                        
1607                    
1608                    
1609          
1610    /**
1611     * If this collection has already been initialized with
1612     * an identical criteria, it returns the collection.
1613     * Otherwise if this Project is new, it will return
1614     * an empty collection; or if this Project has previously
1615     * been saved, it will retrieve related Payments from storage.
1616     *
1617     * This method is protected by default in order to keep the public
1618     * api reasonable. You can provide public methods for those you
1619     * actually need in Project.
1620     */

1621    protected List JavaDoc getPaymentsJoinSorder(Criteria criteria)
1622        throws TorqueException
1623    {
1624                    if (collPayments == null)
1625        {
1626            if (isNew())
1627            {
1628               collPayments = new ArrayList JavaDoc();
1629            }
1630            else
1631            {
1632                              criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1633                              collPayments = PaymentPeer.doSelectJoinSorder(criteria);
1634            }
1635        }
1636        else
1637        {
1638            // the following code is to determine if a new query is
1639
// called for. If the criteria is the same as the last
1640
// one, just return the collection.
1641

1642                        criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1643                                    if (!lastPaymentsCriteria.equals(criteria))
1644            {
1645                collPayments = PaymentPeer.doSelectJoinSorder(criteria);
1646            }
1647        }
1648        lastPaymentsCriteria = criteria;
1649
1650        return collPayments;
1651                }
1652                  
1653                    
1654                    
1655                                
1656                                                              
1657                                        
1658                    
1659                    
1660          
1661    /**
1662     * If this collection has already been initialized with
1663     * an identical criteria, it returns the collection.
1664     * Otherwise if this Project is new, it will return
1665     * an empty collection; or if this Project has previously
1666     * been saved, it will retrieve related Payments from storage.
1667     *
1668     * This method is protected by default in order to keep the public
1669     * api reasonable. You can provide public methods for those you
1670     * actually need in Project.
1671     */

1672    protected List JavaDoc getPaymentsJoinCurrency(Criteria criteria)
1673        throws TorqueException
1674    {
1675                    if (collPayments == null)
1676        {
1677            if (isNew())
1678            {
1679               collPayments = new ArrayList JavaDoc();
1680            }
1681            else
1682            {
1683                              criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1684                              collPayments = PaymentPeer.doSelectJoinCurrency(criteria);
1685            }
1686        }
1687        else
1688        {
1689            // the following code is to determine if a new query is
1690
// called for. If the criteria is the same as the last
1691
// one, just return the collection.
1692

1693                        criteria.add(PaymentPeer.PROJECT_ID, getProjectId());
1694                                    if (!lastPaymentsCriteria.equals(criteria))
1695            {
1696                collPayments = PaymentPeer.doSelectJoinCurrency(criteria);
1697            }
1698        }
1699        lastPaymentsCriteria = criteria;
1700
1701        return collPayments;
1702                }
1703                            
1704
1705
1706                          
1707            
1708          /**
1709     * Collection to store aggregation of collServices
1710     */

1711    protected List JavaDoc collServices;
1712
1713    /**
1714     * Temporary storage of collServices to save a possible db hit in
1715     * the event objects are add to the collection, but the
1716     * complete collection is never requested.
1717     */

1718    protected void initServices()
1719    {
1720        if (collServices == null)
1721        {
1722            collServices = new ArrayList JavaDoc();
1723        }
1724    }
1725
1726    /**
1727     * Method called to associate a Service object to this object
1728     * through the Service foreign key attribute
1729     *
1730     * @param l Service
1731     * @throws TorqueException
1732     */

1733    public void addService(Service l) throws TorqueException
1734    {
1735        getServices().add(l);
1736        l.setProject((Project) this);
1737    }
1738
1739    /**
1740     * The criteria used to select the current contents of collServices
1741     */

1742    private Criteria lastServicesCriteria = null;
1743      
1744    /**
1745     * If this collection has already been initialized, returns
1746     * the collection. Otherwise returns the results of
1747     * getServices(new Criteria())
1748     *
1749     * @throws TorqueException
1750     */

1751    public List JavaDoc getServices() throws TorqueException
1752    {
1753              if (collServices == null)
1754        {
1755            collServices = getServices(new Criteria(10));
1756        }
1757        return collServices;
1758          }
1759
1760    /**
1761     * If this collection has already been initialized with
1762     * an identical criteria, it returns the collection.
1763     * Otherwise if this Project has previously
1764     * been saved, it will retrieve related Services from storage.
1765     * If this Project is new, it will return
1766     * an empty collection or the current collection, the criteria
1767     * is ignored on a new object.
1768     *
1769     * @throws TorqueException
1770     */

1771    public List JavaDoc getServices(Criteria criteria) throws TorqueException
1772    {
1773              if (collServices == null)
1774        {
1775            if (isNew())
1776            {
1777               collServices = new ArrayList JavaDoc();
1778            }
1779            else
1780            {
1781                        criteria.add(ServicePeer.PROJECT_ID, getProjectId() );
1782                        collServices = ServicePeer.doSelect(criteria);
1783            }
1784        }
1785        else
1786        {
1787            // criteria has no effect for a new object
1788
if (!isNew())
1789            {
1790                // the following code is to determine if a new query is
1791
// called for. If the criteria is the same as the last
1792
// one, just return the collection.
1793
criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1794                            if (!lastServicesCriteria.equals(criteria))
1795                {
1796                    collServices = ServicePeer.doSelect(criteria);
1797                }
1798            }
1799        }
1800        lastServicesCriteria = criteria;
1801
1802        return collServices;
1803          }
1804
1805    /**
1806     * If this collection has already been initialized, returns
1807     * the collection. Otherwise returns the results of
1808     * getServices(new Criteria(),Connection)
1809     * This method takes in the Connection also as input so that
1810     * referenced objects can also be obtained using a Connection
1811     * that is taken as input
1812     */

1813    public List JavaDoc getServices(Connection JavaDoc con) throws TorqueException
1814    {
1815              if (collServices == null)
1816        {
1817            collServices = getServices(new Criteria(10), con);
1818        }
1819        return collServices;
1820          }
1821
1822    /**
1823     * If this collection has already been initialized with
1824     * an identical criteria, it returns the collection.
1825     * Otherwise if this Project has previously
1826     * been saved, it will retrieve related Services from storage.
1827     * If this Project is new, it will return
1828     * an empty collection or the current collection, the criteria
1829     * is ignored on a new object.
1830     * This method takes in the Connection also as input so that
1831     * referenced objects can also be obtained using a Connection
1832     * that is taken as input
1833     */

1834    public List JavaDoc getServices(Criteria criteria, Connection JavaDoc con)
1835            throws TorqueException
1836    {
1837              if (collServices == null)
1838        {
1839            if (isNew())
1840            {
1841               collServices = new ArrayList JavaDoc();
1842            }
1843            else
1844            {
1845                         criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1846                         collServices = ServicePeer.doSelect(criteria, con);
1847             }
1848         }
1849         else
1850         {
1851             // criteria has no effect for a new object
1852
if (!isNew())
1853             {
1854                 // the following code is to determine if a new query is
1855
// called for. If the criteria is the same as the last
1856
// one, just return the collection.
1857
criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1858                             if (!lastServicesCriteria.equals(criteria))
1859                 {
1860                     collServices = ServicePeer.doSelect(criteria, con);
1861                 }
1862             }
1863         }
1864         lastServicesCriteria = criteria;
1865
1866         return collServices;
1867           }
1868
1869                                    
1870              
1871                    
1872                    
1873                                            
1874                                                                          
1875                                        
1876                    
1877                    
1878          
1879    /**
1880     * If this collection has already been initialized with
1881     * an identical criteria, it returns the collection.
1882     * Otherwise if this Project is new, it will return
1883     * an empty collection; or if this Project has previously
1884     * been saved, it will retrieve related Services from storage.
1885     *
1886     * This method is protected by default in order to keep the public
1887     * api reasonable. You can provide public methods for those you
1888     * actually need in Project.
1889     */

1890    protected List JavaDoc getServicesJoinCustomerRelatedByCustomerId(Criteria criteria)
1891        throws TorqueException
1892    {
1893                    if (collServices == null)
1894        {
1895            if (isNew())
1896            {
1897               collServices = new ArrayList JavaDoc();
1898            }
1899            else
1900            {
1901                              criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1902                              collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1903            }
1904        }
1905        else
1906        {
1907            // the following code is to determine if a new query is
1908
// called for. If the criteria is the same as the last
1909
// one, just return the collection.
1910

1911                        criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1912                                    if (!lastServicesCriteria.equals(criteria))
1913            {
1914                collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
1915            }
1916        }
1917        lastServicesCriteria = criteria;
1918
1919        return collServices;
1920                }
1921                  
1922                    
1923                    
1924                                            
1925                                                                          
1926                                        
1927                    
1928                    
1929          
1930    /**
1931     * If this collection has already been initialized with
1932     * an identical criteria, it returns the collection.
1933     * Otherwise if this Project is new, it will return
1934     * an empty collection; or if this Project has previously
1935     * been saved, it will retrieve related Services from storage.
1936     *
1937     * This method is protected by default in order to keep the public
1938     * api reasonable. You can provide public methods for those you
1939     * actually need in Project.
1940     */

1941    protected List JavaDoc getServicesJoinCustomerRelatedByRecipientId(Criteria criteria)
1942        throws TorqueException
1943    {
1944                    if (collServices == null)
1945        {
1946            if (isNew())
1947            {
1948               collServices = new ArrayList JavaDoc();
1949            }
1950            else
1951            {
1952                              criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1953                              collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1954            }
1955        }
1956        else
1957        {
1958            // the following code is to determine if a new query is
1959
// called for. If the criteria is the same as the last
1960
// one, just return the collection.
1961

1962                        criteria.add(ServicePeer.PROJECT_ID, getProjectId());
1963                                    if (!lastServicesCriteria.equals(criteria))
1964            {
1965                collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
1966            }
1967        }
1968        lastServicesCriteria = criteria;
1969
1970        return collServices;
1971                }
1972                  
1973                    
1974                              
1975                                
1976                                                              
1977                                        
1978                    
1979                    
1980          
1981    /**
1982     * If this collection has already been initialized with
1983     * an identical criteria, it returns the collection.
1984     * Otherwise if this Project is new, it will return
1985     * an empty collection; or if this Project has previously
1986     * been saved, it will retrieve related Services from storage.
1987     *
1988     * This method is protected by default in order to keep the public
1989     * api reasonable. You can provide public methods for those you
1990     * actually need in Project.
1991     */

1992    protected List JavaDoc getServicesJoinProject(Criteria criteria)
1993        throws TorqueException
1994    {
1995                    if (collServices == null)
1996        {
1997            if (isNew())
1998            {
1999               collServices = new ArrayList JavaDoc();
2000            }
2001            else
2002            {
2003                              criteria.add(ServicePeer.PROJECT_ID, getProjectId());
2004                              collServices = ServicePeer.doSelectJoinProject(criteria);
2005            }
2006        }
2007        else
2008        {
2009            // the following code is to determine if a new query is
2010
// called for. If the criteria is the same as the last
2011
// one, just return the collection.
2012

2013                        criteria.add(ServicePeer.PROJECT_ID, getProjectId());
2014                                    if (!lastServicesCriteria.equals(criteria))
2015            {
2016                collServices = ServicePeer.doSelectJoinProject(criteria);
2017            }
2018        }
2019        lastServicesCriteria = criteria;
2020
2021        return collServices;
2022                }
2023                  
2024                    
2025                    
2026                                
2027                                                              
2028                                        
2029                    
2030                    
2031          
2032    /**
2033     * If this collection has already been initialized with
2034     * an identical criteria, it returns the collection.
2035     * Otherwise if this Project is new, it will return
2036     * an empty collection; or if this Project has previously
2037     * been saved, it will retrieve related Services from storage.
2038     *
2039     * This method is protected by default in order to keep the public
2040     * api reasonable. You can provide public methods for those you
2041     * actually need in Project.
2042     */

2043    protected List JavaDoc getServicesJoinSorder(Criteria criteria)
2044        throws TorqueException
2045    {
2046                    if (collServices == null)
2047        {
2048            if (isNew())
2049            {
2050               collServices = new ArrayList JavaDoc();
2051            }
2052            else
2053            {
2054                              criteria.add(ServicePeer.PROJECT_ID, getProjectId());
2055                              collServices = ServicePeer.doSelectJoinSorder(criteria);
2056            }
2057        }
2058        else
2059        {
2060            // the following code is to determine if a new query is
2061
// called for. If the criteria is the same as the last
2062
// one, just return the collection.
2063

2064                        criteria.add(ServicePeer.PROJECT_ID, getProjectId());
2065                                    if (!lastServicesCriteria.equals(criteria))
2066            {
2067                collServices = ServicePeer.doSelectJoinSorder(criteria);
2068            }
2069        }
2070        lastServicesCriteria = criteria;
2071
2072        return collServices;
2073                }
2074                            
2075
2076
2077                          
2078            
2079          /**
2080     * Collection to store aggregation of collShipments
2081     */

2082    protected List JavaDoc collShipments;
2083
2084    /**
2085     * Temporary storage of collShipments to save a possible db hit in
2086     * the event objects are add to the collection, but the
2087     * complete collection is never requested.
2088     */

2089    protected void initShipments()
2090    {
2091        if (collShipments == null)
2092        {
2093            collShipments = new ArrayList JavaDoc();
2094        }
2095    }
2096
2097    /**
2098     * Method called to associate a Shipment object to this object
2099     * through the Shipment foreign key attribute
2100     *
2101     * @param l Shipment
2102     * @throws TorqueException
2103     */

2104    public void addShipment(Shipment l) throws TorqueException
2105    {
2106        getShipments().add(l);
2107        l.setProject((Project) this);
2108    }
2109
2110    /**
2111     * The criteria used to select the current contents of collShipments
2112     */

2113    private Criteria lastShipmentsCriteria = null;
2114      
2115    /**
2116     * If this collection has already been initialized, returns
2117     * the collection. Otherwise returns the results of
2118     * getShipments(new Criteria())
2119     *
2120     * @throws TorqueException
2121     */

2122    public List JavaDoc getShipments() throws TorqueException
2123    {
2124              if (collShipments == null)
2125        {
2126            collShipments = getShipments(new Criteria(10));
2127        }
2128        return collShipments;
2129          }
2130
2131    /**
2132     * If this collection has already been initialized with
2133     * an identical criteria, it returns the collection.
2134     * Otherwise if this Project has previously
2135     * been saved, it will retrieve related Shipments from storage.
2136     * If this Project is new, it will return
2137     * an empty collection or the current collection, the criteria
2138     * is ignored on a new object.
2139     *
2140     * @throws TorqueException
2141     */

2142    public List JavaDoc getShipments(Criteria criteria) throws TorqueException
2143    {
2144              if (collShipments == null)
2145        {
2146            if (isNew())
2147            {
2148               collShipments = new ArrayList JavaDoc();
2149            }
2150            else
2151            {
2152                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId() );
2153                        collShipments = ShipmentPeer.doSelect(criteria);
2154            }
2155        }
2156        else
2157        {
2158            // criteria has no effect for a new object
2159
if (!isNew())
2160            {
2161                // the following code is to determine if a new query is
2162
// called for. If the criteria is the same as the last
2163
// one, just return the collection.
2164
criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2165                            if (!lastShipmentsCriteria.equals(criteria))
2166                {
2167                    collShipments = ShipmentPeer.doSelect(criteria);
2168                }
2169            }
2170        }
2171        lastShipmentsCriteria = criteria;
2172
2173        return collShipments;
2174          }
2175
2176    /**
2177     * If this collection has already been initialized, returns
2178     * the collection. Otherwise returns the results of
2179     * getShipments(new Criteria(),Connection)
2180     * This method takes in the Connection also as input so that
2181     * referenced objects can also be obtained using a Connection
2182     * that is taken as input
2183     */

2184    public List JavaDoc getShipments(Connection JavaDoc con) throws TorqueException
2185    {
2186              if (collShipments == null)
2187        {
2188            collShipments = getShipments(new Criteria(10), con);
2189        }
2190        return collShipments;
2191          }
2192
2193    /**
2194     * If this collection has already been initialized with
2195     * an identical criteria, it returns the collection.
2196     * Otherwise if this Project has previously
2197     * been saved, it will retrieve related Shipments from storage.
2198     * If this Project is new, it will return
2199     * an empty collection or the current collection, the criteria
2200     * is ignored on a new object.
2201     * This method takes in the Connection also as input so that
2202     * referenced objects can also be obtained using a Connection
2203     * that is taken as input
2204     */

2205    public List JavaDoc getShipments(Criteria criteria, Connection JavaDoc con)
2206            throws TorqueException
2207    {
2208              if (collShipments == null)
2209        {
2210            if (isNew())
2211            {
2212               collShipments = new ArrayList JavaDoc();
2213            }
2214            else
2215            {
2216                         criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2217                         collShipments = ShipmentPeer.doSelect(criteria, con);
2218             }
2219         }
2220         else
2221         {
2222             // criteria has no effect for a new object
2223
if (!isNew())
2224             {
2225                 // the following code is to determine if a new query is
2226
// called for. If the criteria is the same as the last
2227
// one, just return the collection.
2228
criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2229                             if (!lastShipmentsCriteria.equals(criteria))
2230                 {
2231                     collShipments = ShipmentPeer.doSelect(criteria, con);
2232                 }
2233             }
2234         }
2235         lastShipmentsCriteria = criteria;
2236
2237         return collShipments;
2238           }
2239
2240                                          
2241              
2242                    
2243                    
2244                                            
2245                                                                          
2246                                        
2247                    
2248                    
2249          
2250    /**
2251     * If this collection has already been initialized with
2252     * an identical criteria, it returns the collection.
2253     * Otherwise if this Project is new, it will return
2254     * an empty collection; or if this Project has previously
2255     * been saved, it will retrieve related Shipments from storage.
2256     *
2257     * This method is protected by default in order to keep the public
2258     * api reasonable. You can provide public methods for those you
2259     * actually need in Project.
2260     */

2261    protected List JavaDoc getShipmentsJoinCustomerRelatedByCustomerId(Criteria criteria)
2262        throws TorqueException
2263    {
2264                    if (collShipments == null)
2265        {
2266            if (isNew())
2267            {
2268               collShipments = new ArrayList JavaDoc();
2269            }
2270            else
2271            {
2272                              criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2273                              collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2274            }
2275        }
2276        else
2277        {
2278            // the following code is to determine if a new query is
2279
// called for. If the criteria is the same as the last
2280
// one, just return the collection.
2281

2282                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2283                                    if (!lastShipmentsCriteria.equals(criteria))
2284            {
2285                collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2286            }
2287        }
2288        lastShipmentsCriteria = criteria;
2289
2290        return collShipments;
2291                }
2292                  
2293                    
2294                    
2295                                            
2296                                                                          
2297                                        
2298                    
2299                    
2300          
2301    /**
2302     * If this collection has already been initialized with
2303     * an identical criteria, it returns the collection.
2304     * Otherwise if this Project is new, it will return
2305     * an empty collection; or if this Project has previously
2306     * been saved, it will retrieve related Shipments from storage.
2307     *
2308     * This method is protected by default in order to keep the public
2309     * api reasonable. You can provide public methods for those you
2310     * actually need in Project.
2311     */

2312    protected List JavaDoc getShipmentsJoinCustomerRelatedByRecipientId(Criteria criteria)
2313        throws TorqueException
2314    {
2315                    if (collShipments == null)
2316        {
2317            if (isNew())
2318            {
2319               collShipments = new ArrayList JavaDoc();
2320            }
2321            else
2322            {
2323                              criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2324                              collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2325            }
2326        }
2327        else
2328        {
2329            // the following code is to determine if a new query is
2330
// called for. If the criteria is the same as the last
2331
// one, just return the collection.
2332

2333                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2334                                    if (!lastShipmentsCriteria.equals(criteria))
2335            {
2336                collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2337            }
2338        }
2339        lastShipmentsCriteria = criteria;
2340
2341        return collShipments;
2342                }
2343                  
2344                    
2345                              
2346                                
2347                                                              
2348                                        
2349                    
2350                    
2351          
2352    /**
2353     * If this collection has already been initialized with
2354     * an identical criteria, it returns the collection.
2355     * Otherwise if this Project is new, it will return
2356     * an empty collection; or if this Project has previously
2357     * been saved, it will retrieve related Shipments from storage.
2358     *
2359     * This method is protected by default in order to keep the public
2360     * api reasonable. You can provide public methods for those you
2361     * actually need in Project.
2362     */

2363    protected List JavaDoc getShipmentsJoinProject(Criteria criteria)
2364        throws TorqueException
2365    {
2366                    if (collShipments == null)
2367        {
2368            if (isNew())
2369            {
2370               collShipments = new ArrayList JavaDoc();
2371            }
2372            else
2373            {
2374                              criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2375                              collShipments = ShipmentPeer.doSelectJoinProject(criteria);
2376            }
2377        }
2378        else
2379        {
2380            // the following code is to determine if a new query is
2381
// called for. If the criteria is the same as the last
2382
// one, just return the collection.
2383

2384                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2385                                    if (!lastShipmentsCriteria.equals(criteria))
2386            {
2387                collShipments = ShipmentPeer.doSelectJoinProject(criteria);
2388            }
2389        }
2390        lastShipmentsCriteria = criteria;
2391
2392        return collShipments;
2393                }
2394                  
2395                    
2396                    
2397                                
2398                                                              
2399                                        
2400                    
2401                    
2402          
2403    /**
2404     * If this collection has already been initialized with
2405     * an identical criteria, it returns the collection.
2406     * Otherwise if this Project is new, it will return
2407     * an empty collection; or if this Project has previously
2408     * been saved, it will retrieve related Shipments from storage.
2409     *
2410     * This method is protected by default in order to keep the public
2411     * api reasonable. You can provide public methods for those you
2412     * actually need in Project.
2413     */

2414    protected List JavaDoc getShipmentsJoinSorder(Criteria criteria)
2415        throws TorqueException
2416    {
2417                    if (collShipments == null)
2418        {
2419            if (isNew())
2420            {
2421               collShipments = new ArrayList JavaDoc();
2422            }
2423            else
2424            {
2425                              criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2426                              collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
2427            }
2428        }
2429        else
2430        {
2431            // the following code is to determine if a new query is
2432
// called for. If the criteria is the same as the last
2433
// one, just return the collection.
2434

2435                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2436                                    if (!lastShipmentsCriteria.equals(criteria))
2437            {
2438                collShipments = ShipmentPeer.doSelectJoinSorder(criteria);
2439            }
2440        }
2441        lastShipmentsCriteria = criteria;
2442
2443        return collShipments;
2444                }
2445                  
2446                    
2447                    
2448                                
2449                                                              
2450                                        
2451                    
2452                    
2453          
2454    /**
2455     * If this collection has already been initialized with
2456     * an identical criteria, it returns the collection.
2457     * Otherwise if this Project is new, it will return
2458     * an empty collection; or if this Project has previously
2459     * been saved, it will retrieve related Shipments from storage.
2460     *
2461     * This method is protected by default in order to keep the public
2462     * api reasonable. You can provide public methods for those you
2463     * actually need in Project.
2464     */

2465    protected List JavaDoc getShipmentsJoinCarrier(Criteria criteria)
2466        throws TorqueException
2467    {
2468                    if (collShipments == null)
2469        {
2470            if (isNew())
2471            {
2472               collShipments = new ArrayList JavaDoc();
2473            }
2474            else
2475            {
2476                              criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2477                              collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
2478            }
2479        }
2480        else
2481        {
2482            // the following code is to determine if a new query is
2483
// called for. If the criteria is the same as the last
2484
// one, just return the collection.
2485

2486                        criteria.add(ShipmentPeer.PROJECT_ID, getProjectId());
2487                                    if (!lastShipmentsCriteria.equals(criteria))
2488            {
2489                collShipments = ShipmentPeer.doSelectJoinCarrier(criteria);
2490            }
2491        }
2492        lastShipmentsCriteria = criteria;
2493
2494        return collShipments;
2495                }
2496                            
2497
2498
2499                          
2500            
2501          /**
2502     * Collection to store aggregation of collPrintSubscriptions
2503     */

2504    protected List JavaDoc collPrintSubscriptions;
2505
2506    /**
2507     * Temporary storage of collPrintSubscriptions to save a possible db hit in
2508     * the event objects are add to the collection, but the
2509     * complete collection is never requested.
2510     */

2511    protected void initPrintSubscriptions()
2512    {
2513        if (collPrintSubscriptions == null)
2514        {
2515            collPrintSubscriptions = new ArrayList JavaDoc();
2516        }
2517    }
2518
2519    /**
2520     * Method called to associate a PrintSubscription object to this object
2521     * through the PrintSubscription foreign key attribute
2522     *
2523     * @param l PrintSubscription
2524     * @throws TorqueException
2525     */

2526    public void addPrintSubscription(PrintSubscription l) throws TorqueException
2527    {
2528        getPrintSubscriptions().add(l);
2529        l.setProject((Project) this);
2530    }
2531
2532    /**
2533     * The criteria used to select the current contents of collPrintSubscriptions
2534     */

2535    private Criteria lastPrintSubscriptionsCriteria = null;
2536      
2537    /**
2538     * If this collection has already been initialized, returns
2539     * the collection. Otherwise returns the results of
2540     * getPrintSubscriptions(new Criteria())
2541     *
2542     * @throws TorqueException
2543     */

2544    public List JavaDoc getPrintSubscriptions() throws TorqueException
2545    {
2546              if (collPrintSubscriptions == null)
2547        {
2548            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10));
2549        }
2550        return collPrintSubscriptions;
2551          }
2552
2553    /**
2554     * If this collection has already been initialized with
2555     * an identical criteria, it returns the collection.
2556     * Otherwise if this Project has previously
2557     * been saved, it will retrieve related PrintSubscriptions from storage.
2558     * If this Project is new, it will return
2559     * an empty collection or the current collection, the criteria
2560     * is ignored on a new object.
2561     *
2562     * @throws TorqueException
2563     */

2564    public List JavaDoc getPrintSubscriptions(Criteria criteria) throws TorqueException
2565    {
2566              if (collPrintSubscriptions == null)
2567        {
2568            if (isNew())
2569            {
2570               collPrintSubscriptions = new ArrayList JavaDoc();
2571            }
2572            else
2573            {
2574                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId() );
2575                        collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
2576            }
2577        }
2578        else
2579        {
2580            // criteria has no effect for a new object
2581
if (!isNew())
2582            {
2583                // the following code is to determine if a new query is
2584
// called for. If the criteria is the same as the last
2585
// one, just return the collection.
2586
criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2587                            if (!lastPrintSubscriptionsCriteria.equals(criteria))
2588                {
2589                    collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria);
2590                }
2591            }
2592        }
2593        lastPrintSubscriptionsCriteria = criteria;
2594
2595        return collPrintSubscriptions;
2596          }
2597
2598    /**
2599     * If this collection has already been initialized, returns
2600     * the collection. Otherwise returns the results of
2601     * getPrintSubscriptions(new Criteria(),Connection)
2602     * This method takes in the Connection also as input so that
2603     * referenced objects can also be obtained using a Connection
2604     * that is taken as input
2605     */

2606    public List JavaDoc getPrintSubscriptions(Connection JavaDoc con) throws TorqueException
2607    {
2608              if (collPrintSubscriptions == null)
2609        {
2610            collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con);
2611        }
2612        return collPrintSubscriptions;
2613          }
2614
2615    /**
2616     * If this collection has already been initialized with
2617     * an identical criteria, it returns the collection.
2618     * Otherwise if this Project has previously
2619     * been saved, it will retrieve related PrintSubscriptions from storage.
2620     * If this Project is new, it will return
2621     * an empty collection or the current collection, the criteria
2622     * is ignored on a new object.
2623     * This method takes in the Connection also as input so that
2624     * referenced objects can also be obtained using a Connection
2625     * that is taken as input
2626     */

2627    public List JavaDoc getPrintSubscriptions(Criteria criteria, Connection JavaDoc con)
2628            throws TorqueException
2629    {
2630              if (collPrintSubscriptions == null)
2631        {
2632            if (isNew())
2633            {
2634               collPrintSubscriptions = new ArrayList JavaDoc();
2635            }
2636            else
2637            {
2638                         criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2639                         collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
2640             }
2641         }
2642         else
2643         {
2644             // criteria has no effect for a new object
2645
if (!isNew())
2646             {
2647                 // the following code is to determine if a new query is
2648
// called for. If the criteria is the same as the last
2649
// one, just return the collection.
2650
criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2651                             if (!lastPrintSubscriptionsCriteria.equals(criteria))
2652                 {
2653                     collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con);
2654                 }
2655             }
2656         }
2657         lastPrintSubscriptionsCriteria = criteria;
2658
2659         return collPrintSubscriptions;
2660           }
2661
2662                                                
2663              
2664                    
2665                    
2666                                            
2667                                                                          
2668                                        
2669                    
2670                    
2671          
2672    /**
2673     * If this collection has already been initialized with
2674     * an identical criteria, it returns the collection.
2675     * Otherwise if this Project is new, it will return
2676     * an empty collection; or if this Project has previously
2677     * been saved, it will retrieve related PrintSubscriptions from storage.
2678     *
2679     * This method is protected by default in order to keep the public
2680     * api reasonable. You can provide public methods for those you
2681     * actually need in Project.
2682     */

2683    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
2684        throws TorqueException
2685    {
2686                    if (collPrintSubscriptions == null)
2687        {
2688            if (isNew())
2689            {
2690               collPrintSubscriptions = new ArrayList JavaDoc();
2691            }
2692            else
2693            {
2694                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2695                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2696            }
2697        }
2698        else
2699        {
2700            // the following code is to determine if a new query is
2701
// called for. If the criteria is the same as the last
2702
// one, just return the collection.
2703

2704                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2705                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2706            {
2707                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
2708            }
2709        }
2710        lastPrintSubscriptionsCriteria = criteria;
2711
2712        return collPrintSubscriptions;
2713                }
2714                  
2715                    
2716                    
2717                                            
2718                                                                          
2719                                        
2720                    
2721                    
2722          
2723    /**
2724     * If this collection has already been initialized with
2725     * an identical criteria, it returns the collection.
2726     * Otherwise if this Project is new, it will return
2727     * an empty collection; or if this Project has previously
2728     * been saved, it will retrieve related PrintSubscriptions from storage.
2729     *
2730     * This method is protected by default in order to keep the public
2731     * api reasonable. You can provide public methods for those you
2732     * actually need in Project.
2733     */

2734    protected List JavaDoc getPrintSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
2735        throws TorqueException
2736    {
2737                    if (collPrintSubscriptions == null)
2738        {
2739            if (isNew())
2740            {
2741               collPrintSubscriptions = new ArrayList JavaDoc();
2742            }
2743            else
2744            {
2745                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2746                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2747            }
2748        }
2749        else
2750        {
2751            // the following code is to determine if a new query is
2752
// called for. If the criteria is the same as the last
2753
// one, just return the collection.
2754

2755                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2756                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2757            {
2758                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
2759            }
2760        }
2761        lastPrintSubscriptionsCriteria = criteria;
2762
2763        return collPrintSubscriptions;
2764                }
2765                  
2766                    
2767                    
2768                                
2769                                                              
2770                                        
2771                    
2772                    
2773          
2774    /**
2775     * If this collection has already been initialized with
2776     * an identical criteria, it returns the collection.
2777     * Otherwise if this Project is new, it will return
2778     * an empty collection; or if this Project has previously
2779     * been saved, it will retrieve related PrintSubscriptions from storage.
2780     *
2781     * This method is protected by default in order to keep the public
2782     * api reasonable. You can provide public methods for those you
2783     * actually need in Project.
2784     */

2785    protected List JavaDoc getPrintSubscriptionsJoinCarrier(Criteria criteria)
2786        throws TorqueException
2787    {
2788                    if (collPrintSubscriptions == null)
2789        {
2790            if (isNew())
2791            {
2792               collPrintSubscriptions = new ArrayList JavaDoc();
2793            }
2794            else
2795            {
2796                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2797                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
2798            }
2799        }
2800        else
2801        {
2802            // the following code is to determine if a new query is
2803
// called for. If the criteria is the same as the last
2804
// one, just return the collection.
2805

2806                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2807                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2808            {
2809                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria);
2810            }
2811        }
2812        lastPrintSubscriptionsCriteria = criteria;
2813
2814        return collPrintSubscriptions;
2815                }
2816                  
2817                    
2818                              
2819                                
2820                                                              
2821                                        
2822                    
2823                    
2824          
2825    /**
2826     * If this collection has already been initialized with
2827     * an identical criteria, it returns the collection.
2828     * Otherwise if this Project is new, it will return
2829     * an empty collection; or if this Project has previously
2830     * been saved, it will retrieve related PrintSubscriptions from storage.
2831     *
2832     * This method is protected by default in order to keep the public
2833     * api reasonable. You can provide public methods for those you
2834     * actually need in Project.
2835     */

2836    protected List JavaDoc getPrintSubscriptionsJoinProject(Criteria criteria)
2837        throws TorqueException
2838    {
2839                    if (collPrintSubscriptions == null)
2840        {
2841            if (isNew())
2842            {
2843               collPrintSubscriptions = new ArrayList JavaDoc();
2844            }
2845            else
2846            {
2847                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2848                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
2849            }
2850        }
2851        else
2852        {
2853            // the following code is to determine if a new query is
2854
// called for. If the criteria is the same as the last
2855
// one, just return the collection.
2856

2857                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2858                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2859            {
2860                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria);
2861            }
2862        }
2863        lastPrintSubscriptionsCriteria = criteria;
2864
2865        return collPrintSubscriptions;
2866                }
2867                  
2868                    
2869                    
2870                                
2871                                                              
2872                                        
2873                    
2874                    
2875          
2876    /**
2877     * If this collection has already been initialized with
2878     * an identical criteria, it returns the collection.
2879     * Otherwise if this Project is new, it will return
2880     * an empty collection; or if this Project has previously
2881     * been saved, it will retrieve related PrintSubscriptions from storage.
2882     *
2883     * This method is protected by default in order to keep the public
2884     * api reasonable. You can provide public methods for those you
2885     * actually need in Project.
2886     */

2887    protected List JavaDoc getPrintSubscriptionsJoinProduct(Criteria criteria)
2888        throws TorqueException
2889    {
2890                    if (collPrintSubscriptions == null)
2891        {
2892            if (isNew())
2893            {
2894               collPrintSubscriptions = new ArrayList JavaDoc();
2895            }
2896            else
2897            {
2898                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2899                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
2900            }
2901        }
2902        else
2903        {
2904            // the following code is to determine if a new query is
2905
// called for. If the criteria is the same as the last
2906
// one, just return the collection.
2907

2908                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2909                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2910            {
2911                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria);
2912            }
2913        }
2914        lastPrintSubscriptionsCriteria = criteria;
2915
2916        return collPrintSubscriptions;
2917                }
2918                  
2919                    
2920                    
2921                                
2922                                                              
2923                                        
2924                    
2925                    
2926          
2927    /**
2928     * If this collection has already been initialized with
2929     * an identical criteria, it returns the collection.
2930     * Otherwise if this Project is new, it will return
2931     * an empty collection; or if this Project has previously
2932     * been saved, it will retrieve related PrintSubscriptions from storage.
2933     *
2934     * This method is protected by default in order to keep the public
2935     * api reasonable. You can provide public methods for those you
2936     * actually need in Project.
2937     */

2938    protected List JavaDoc getPrintSubscriptionsJoinSorder(Criteria criteria)
2939        throws TorqueException
2940    {
2941                    if (collPrintSubscriptions == null)
2942        {
2943            if (isNew())
2944            {
2945               collPrintSubscriptions = new ArrayList JavaDoc();
2946            }
2947            else
2948            {
2949                              criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2950                              collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
2951            }
2952        }
2953        else
2954        {
2955            // the following code is to determine if a new query is
2956
// called for. If the criteria is the same as the last
2957
// one, just return the collection.
2958

2959                        criteria.add(PrintSubscriptionPeer.PROJECT_ID, getProjectId());
2960                                    if (!lastPrintSubscriptionsCriteria.equals(criteria))
2961            {
2962                collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria);
2963            }
2964        }
2965        lastPrintSubscriptionsCriteria = criteria;
2966
2967        return collPrintSubscriptions;
2968                }
2969                            
2970
2971
2972                          
2973            
2974          /**
2975     * Collection to store aggregation of collOnlineSubscriptions
2976     */

2977    protected List JavaDoc collOnlineSubscriptions;
2978
2979    /**
2980     * Temporary storage of collOnlineSubscriptions to save a possible db hit in
2981     * the event objects are add to the collection, but the
2982     * complete collection is never requested.
2983     */

2984    protected void initOnlineSubscriptions()
2985    {
2986        if (collOnlineSubscriptions == null)
2987        {
2988            collOnlineSubscriptions = new ArrayList JavaDoc();
2989        }
2990    }
2991
2992    /**
2993     * Method called to associate a OnlineSubscription object to this object
2994     * through the OnlineSubscription foreign key attribute
2995     *
2996     * @param l OnlineSubscription
2997     * @throws TorqueException
2998     */

2999    public void addOnlineSubscription(OnlineSubscription l) throws TorqueException
3000    {
3001        getOnlineSubscriptions().add(l);
3002        l.setProject((Project) this);
3003    }
3004
3005    /**
3006     * The criteria used to select the current contents of collOnlineSubscriptions
3007     */

3008    private Criteria lastOnlineSubscriptionsCriteria = null;
3009      
3010    /**
3011     * If this collection has already been initialized, returns
3012     * the collection. Otherwise returns the results of
3013     * getOnlineSubscriptions(new Criteria())
3014     *
3015     * @throws TorqueException
3016     */

3017    public List JavaDoc getOnlineSubscriptions() throws TorqueException
3018    {
3019              if (collOnlineSubscriptions == null)
3020        {
3021            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10));
3022        }
3023        return collOnlineSubscriptions;
3024          }
3025
3026    /**
3027     * If this collection has already been initialized with
3028     * an identical criteria, it returns the collection.
3029     * Otherwise if this Project has previously
3030     * been saved, it will retrieve related OnlineSubscriptions from storage.
3031     * If this Project is new, it will return
3032     * an empty collection or the current collection, the criteria
3033     * is ignored on a new object.
3034     *
3035     * @throws TorqueException
3036     */

3037    public List JavaDoc getOnlineSubscriptions(Criteria criteria) throws TorqueException
3038    {
3039              if (collOnlineSubscriptions == null)
3040        {
3041            if (isNew())
3042            {
3043               collOnlineSubscriptions = new ArrayList JavaDoc();
3044            }
3045            else
3046            {
3047                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId() );
3048                        collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
3049            }
3050        }
3051        else
3052        {
3053            // criteria has no effect for a new object
3054
if (!isNew())
3055            {
3056                // the following code is to determine if a new query is
3057
// called for. If the criteria is the same as the last
3058
// one, just return the collection.
3059
criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3060                            if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3061                {
3062                    collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria);
3063                }
3064            }
3065        }
3066        lastOnlineSubscriptionsCriteria = criteria;
3067
3068        return collOnlineSubscriptions;
3069          }
3070
3071    /**
3072     * If this collection has already been initialized, returns
3073     * the collection. Otherwise returns the results of
3074     * getOnlineSubscriptions(new Criteria(),Connection)
3075     * This method takes in the Connection also as input so that
3076     * referenced objects can also be obtained using a Connection
3077     * that is taken as input
3078     */

3079    public List JavaDoc getOnlineSubscriptions(Connection JavaDoc con) throws TorqueException
3080    {
3081              if (collOnlineSubscriptions == null)
3082        {
3083            collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10), con);
3084        }
3085        return collOnlineSubscriptions;
3086          }
3087
3088    /**
3089     * If this collection has already been initialized with
3090     * an identical criteria, it returns the collection.
3091     * Otherwise if this Project has previously
3092     * been saved, it will retrieve related OnlineSubscriptions from storage.
3093     * If this Project is new, it will return
3094     * an empty collection or the current collection, the criteria
3095     * is ignored on a new object.
3096     * This method takes in the Connection also as input so that
3097     * referenced objects can also be obtained using a Connection
3098     * that is taken as input
3099     */

3100    public List JavaDoc getOnlineSubscriptions(Criteria criteria, Connection JavaDoc con)
3101            throws TorqueException
3102    {
3103              if (collOnlineSubscriptions == null)
3104        {
3105            if (isNew())
3106            {
3107               collOnlineSubscriptions = new ArrayList JavaDoc();
3108            }
3109            else
3110            {
3111                         criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3112                         collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
3113             }
3114         }
3115         else
3116         {
3117             // criteria has no effect for a new object
3118
if (!isNew())
3119             {
3120                 // the following code is to determine if a new query is
3121
// called for. If the criteria is the same as the last
3122
// one, just return the collection.
3123
criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3124                             if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3125                 {
3126                     collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con);
3127                 }
3128             }
3129         }
3130         lastOnlineSubscriptionsCriteria = criteria;
3131
3132         return collOnlineSubscriptions;
3133           }
3134
3135                                          
3136              
3137                    
3138                    
3139                                            
3140                                                                          
3141                                        
3142                    
3143                    
3144          
3145    /**
3146     * If this collection has already been initialized with
3147     * an identical criteria, it returns the collection.
3148     * Otherwise if this Project is new, it will return
3149     * an empty collection; or if this Project has previously
3150     * been saved, it will retrieve related OnlineSubscriptions from storage.
3151     *
3152     * This method is protected by default in order to keep the public
3153     * api reasonable. You can provide public methods for those you
3154     * actually need in Project.
3155     */

3156    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria)
3157        throws TorqueException
3158    {
3159                    if (collOnlineSubscriptions == null)
3160        {
3161            if (isNew())
3162            {
3163               collOnlineSubscriptions = new ArrayList JavaDoc();
3164            }
3165            else
3166            {
3167                              criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3168                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
3169            }
3170        }
3171        else
3172        {
3173            // the following code is to determine if a new query is
3174
// called for. If the criteria is the same as the last
3175
// one, just return the collection.
3176

3177                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3178                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3179            {
3180                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
3181            }
3182        }
3183        lastOnlineSubscriptionsCriteria = criteria;
3184
3185        return collOnlineSubscriptions;
3186                }
3187                  
3188                    
3189                    
3190                                            
3191                                                                          
3192                                        
3193                    
3194                    
3195          
3196    /**
3197     * If this collection has already been initialized with
3198     * an identical criteria, it returns the collection.
3199     * Otherwise if this Project is new, it will return
3200     * an empty collection; or if this Project has previously
3201     * been saved, it will retrieve related OnlineSubscriptions from storage.
3202     *
3203     * This method is protected by default in order to keep the public
3204     * api reasonable. You can provide public methods for those you
3205     * actually need in Project.
3206     */

3207    protected List JavaDoc getOnlineSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria)
3208        throws TorqueException
3209    {
3210                    if (collOnlineSubscriptions == null)
3211        {
3212            if (isNew())
3213            {
3214               collOnlineSubscriptions = new ArrayList JavaDoc();
3215            }
3216            else
3217            {
3218                              criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3219                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
3220            }
3221        }
3222        else
3223        {
3224            // the following code is to determine if a new query is
3225
// called for. If the criteria is the same as the last
3226
// one, just return the collection.
3227

3228                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3229                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3230            {
3231                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
3232            }
3233        }
3234        lastOnlineSubscriptionsCriteria = criteria;
3235
3236        return collOnlineSubscriptions;
3237                }
3238                  
3239                    
3240                              
3241                                
3242                                                              
3243                                        
3244                    
3245                    
3246          
3247    /**
3248     * If this collection has already been initialized with
3249     * an identical criteria, it returns the collection.
3250     * Otherwise if this Project is new, it will return
3251     * an empty collection; or if this Project has previously
3252     * been saved, it will retrieve related OnlineSubscriptions from storage.
3253     *
3254     * This method is protected by default in order to keep the public
3255     * api reasonable. You can provide public methods for those you
3256     * actually need in Project.
3257     */

3258    protected List JavaDoc getOnlineSubscriptionsJoinProject(Criteria criteria)
3259        throws TorqueException
3260    {
3261                    if (collOnlineSubscriptions == null)
3262        {
3263            if (isNew())
3264            {
3265               collOnlineSubscriptions = new ArrayList JavaDoc();
3266            }
3267            else
3268            {
3269                              criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3270                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
3271            }
3272        }
3273        else
3274        {
3275            // the following code is to determine if a new query is
3276
// called for. If the criteria is the same as the last
3277
// one, just return the collection.
3278

3279                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3280                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3281            {
3282                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria);
3283            }
3284        }
3285        lastOnlineSubscriptionsCriteria = criteria;
3286
3287        return collOnlineSubscriptions;
3288                }
3289                  
3290                    
3291                    
3292                                
3293                                                              
3294                                        
3295                    
3296                    
3297          
3298    /**
3299     * If this collection has already been initialized with
3300     * an identical criteria, it returns the collection.
3301     * Otherwise if this Project is new, it will return
3302     * an empty collection; or if this Project has previously
3303     * been saved, it will retrieve related OnlineSubscriptions from storage.
3304     *
3305     * This method is protected by default in order to keep the public
3306     * api reasonable. You can provide public methods for those you
3307     * actually need in Project.
3308     */

3309    protected List JavaDoc getOnlineSubscriptionsJoinProduct(Criteria criteria)
3310        throws TorqueException
3311    {
3312                    if (collOnlineSubscriptions == null)
3313        {
3314            if (isNew())
3315            {
3316               collOnlineSubscriptions = new ArrayList JavaDoc();
3317            }
3318            else
3319            {
3320                              criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3321                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
3322            }
3323        }
3324        else
3325        {
3326            // the following code is to determine if a new query is
3327
// called for. If the criteria is the same as the last
3328
// one, just return the collection.
3329

3330                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3331                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3332            {
3333                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria);
3334            }
3335        }
3336        lastOnlineSubscriptionsCriteria = criteria;
3337
3338        return collOnlineSubscriptions;
3339                }
3340                  
3341                    
3342                    
3343                                
3344                                                              
3345                                        
3346                    
3347                    
3348          
3349    /**
3350     * If this collection has already been initialized with
3351     * an identical criteria, it returns the collection.
3352     * Otherwise if this Project is new, it will return
3353     * an empty collection; or if this Project has previously
3354     * been saved, it will retrieve related OnlineSubscriptions from storage.
3355     *
3356     * This method is protected by default in order to keep the public
3357     * api reasonable. You can provide public methods for those you
3358     * actually need in Project.
3359     */

3360    protected List JavaDoc getOnlineSubscriptionsJoinSorder(Criteria criteria)
3361        throws TorqueException
3362    {
3363                    if (collOnlineSubscriptions == null)
3364        {
3365            if (isNew())
3366            {
3367               collOnlineSubscriptions = new ArrayList JavaDoc();
3368            }
3369            else
3370            {
3371                              criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3372                              collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
3373            }
3374        }
3375        else
3376        {
3377            // the following code is to determine if a new query is
3378
// called for. If the criteria is the same as the last
3379
// one, just return the collection.
3380

3381                        criteria.add(OnlineSubscriptionPeer.PROJECT_ID, getProjectId());
3382                                    if (!lastOnlineSubscriptionsCriteria.equals(criteria))
3383            {
3384                collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria);
3385            }
3386        }
3387        lastOnlineSubscriptionsCriteria = criteria;
3388
3389        return collOnlineSubscriptions;
3390                }
3391                            
3392
3393
3394                          
3395            
3396          /**
3397     * Collection to store aggregation of collInboxEvents
3398     */

3399    protected List JavaDoc collInboxEvents;
3400
3401    /**
3402     * Temporary storage of collInboxEvents to save a possible db hit in
3403     * the event objects are add to the collection, but the
3404     * complete collection is never requested.
3405     */

3406    protected void initInboxEvents()
3407    {
3408        if (collInboxEvents == null)
3409        {
3410            collInboxEvents = new ArrayList JavaDoc();
3411        }
3412    }
3413
3414    /**
3415     * Method called to associate a InboxEvent object to this object
3416     * through the InboxEvent foreign key attribute
3417     *
3418     * @param l InboxEvent
3419     * @throws TorqueException
3420     */

3421    public void addInboxEvent(InboxEvent l) throws TorqueException
3422    {
3423        getInboxEvents().add(l);
3424        l.setProject((Project) this);
3425    }
3426
3427    /**
3428     * The criteria used to select the current contents of collInboxEvents
3429     */

3430    private Criteria lastInboxEventsCriteria = null;
3431      
3432    /**
3433     * If this collection has already been initialized, returns
3434     * the collection. Otherwise returns the results of
3435     * getInboxEvents(new Criteria())
3436     *
3437     * @throws TorqueException
3438     */

3439    public List JavaDoc getInboxEvents() throws TorqueException
3440    {
3441              if (collInboxEvents == null)
3442        {
3443            collInboxEvents = getInboxEvents(new Criteria(10));
3444        }
3445        return collInboxEvents;
3446          }
3447
3448    /**
3449     * If this collection has already been initialized with
3450     * an identical criteria, it returns the collection.
3451     * Otherwise if this Project has previously
3452     * been saved, it will retrieve related InboxEvents from storage.
3453     * If this Project is new, it will return
3454     * an empty collection or the current collection, the criteria
3455     * is ignored on a new object.
3456     *
3457     * @throws TorqueException
3458     */

3459    public List JavaDoc getInboxEvents(Criteria criteria) throws TorqueException
3460    {
3461              if (collInboxEvents == null)
3462        {
3463            if (isNew())
3464            {
3465               collInboxEvents = new ArrayList JavaDoc();
3466            }
3467            else
3468            {
3469                        criteria.add(InboxEventPeer.PROJECT_ID, getProjectId() );
3470                        collInboxEvents = InboxEventPeer.doSelect(criteria);
3471            }
3472        }
3473        else
3474        {
3475            // criteria has no effect for a new object
3476
if (!isNew())
3477            {
3478                // the following code is to determine if a new query is
3479
// called for. If the criteria is the same as the last
3480
// one, just return the collection.
3481
criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3482                            if (!lastInboxEventsCriteria.equals(criteria))
3483                {
3484                    collInboxEvents = InboxEventPeer.doSelect(criteria);
3485                }
3486            }
3487        }
3488        lastInboxEventsCriteria = criteria;
3489
3490        return collInboxEvents;
3491          }
3492
3493    /**
3494     * If this collection has already been initialized, returns
3495     * the collection. Otherwise returns the results of
3496     * getInboxEvents(new Criteria(),Connection)
3497     * This method takes in the Connection also as input so that
3498     * referenced objects can also be obtained using a Connection
3499     * that is taken as input
3500     */

3501    public List JavaDoc getInboxEvents(Connection JavaDoc con) throws TorqueException
3502    {
3503              if (collInboxEvents == null)
3504        {
3505            collInboxEvents = getInboxEvents(new Criteria(10), con);
3506        }
3507        return collInboxEvents;
3508          }
3509
3510    /**
3511     * If this collection has already been initialized with
3512     * an identical criteria, it returns the collection.
3513     * Otherwise if this Project has previously
3514     * been saved, it will retrieve related InboxEvents from storage.
3515     * If this Project is new, it will return
3516     * an empty collection or the current collection, the criteria
3517     * is ignored on a new object.
3518     * This method takes in the Connection also as input so that
3519     * referenced objects can also be obtained using a Connection
3520     * that is taken as input
3521     */

3522    public List JavaDoc getInboxEvents(Criteria criteria, Connection JavaDoc con)
3523            throws TorqueException
3524    {
3525              if (collInboxEvents == null)
3526        {
3527            if (isNew())
3528            {
3529               collInboxEvents = new ArrayList JavaDoc();
3530            }
3531            else
3532            {
3533                         criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3534                         collInboxEvents = InboxEventPeer.doSelect(criteria, con);
3535             }
3536         }
3537         else
3538         {
3539             // criteria has no effect for a new object
3540
if (!isNew())
3541             {
3542                 // the following code is to determine if a new query is
3543
// called for. If the criteria is the same as the last
3544
// one, just return the collection.
3545
criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3546                             if (!lastInboxEventsCriteria.equals(criteria))
3547                 {
3548                     collInboxEvents = InboxEventPeer.doSelect(criteria, con);
3549                 }
3550             }
3551         }
3552         lastInboxEventsCriteria = criteria;
3553
3554         return collInboxEvents;
3555           }
3556
3557                              
3558              
3559                    
3560                    
3561                                
3562                                                              
3563                                        
3564                    
3565                    
3566          
3567    /**
3568     * If this collection has already been initialized with
3569     * an identical criteria, it returns the collection.
3570     * Otherwise if this Project is new, it will return
3571     * an empty collection; or if this Project has previously
3572     * been saved, it will retrieve related InboxEvents from storage.
3573     *
3574     * This method is protected by default in order to keep the public
3575     * api reasonable. You can provide public methods for those you
3576     * actually need in Project.
3577     */

3578    protected List JavaDoc getInboxEventsJoinCustomer(Criteria criteria)
3579        throws TorqueException
3580    {
3581                    if (collInboxEvents == null)
3582        {
3583            if (isNew())
3584            {
3585               collInboxEvents = new ArrayList JavaDoc();
3586            }
3587            else
3588            {
3589                              criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3590                              collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria);
3591            }
3592        }
3593        else
3594        {
3595            // the following code is to determine if a new query is
3596
// called for. If the criteria is the same as the last
3597
// one, just return the collection.
3598

3599                        criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3600                                    if (!lastInboxEventsCriteria.equals(criteria))
3601            {
3602                collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria);
3603            }
3604        }
3605        lastInboxEventsCriteria = criteria;
3606
3607        return collInboxEvents;
3608                }
3609                  
3610                    
3611                              
3612                                
3613                                                              
3614                                        
3615                    
3616                    
3617          
3618    /**
3619     * If this collection has already been initialized with
3620     * an identical criteria, it returns the collection.
3621     * Otherwise if this Project is new, it will return
3622     * an empty collection; or if this Project has previously
3623     * been saved, it will retrieve related InboxEvents from storage.
3624     *
3625     * This method is protected by default in order to keep the public
3626     * api reasonable. You can provide public methods for those you
3627     * actually need in Project.
3628     */

3629    protected List JavaDoc getInboxEventsJoinProject(Criteria criteria)
3630        throws TorqueException
3631    {
3632                    if (collInboxEvents == null)
3633        {
3634            if (isNew())
3635            {
3636               collInboxEvents = new ArrayList JavaDoc();
3637            }
3638            else
3639            {
3640                              criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3641                              collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria);
3642            }
3643        }
3644        else
3645        {
3646            // the following code is to determine if a new query is
3647
// called for. If the criteria is the same as the last
3648
// one, just return the collection.
3649

3650                        criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3651                                    if (!lastInboxEventsCriteria.equals(criteria))
3652            {
3653                collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria);
3654            }
3655        }
3656        lastInboxEventsCriteria = criteria;
3657
3658        return collInboxEvents;
3659                }
3660                  
3661                    
3662                    
3663                                
3664                                                              
3665                                        
3666                    
3667                    
3668          
3669    /**
3670     * If this collection has already been initialized with
3671     * an identical criteria, it returns the collection.
3672     * Otherwise if this Project is new, it will return
3673     * an empty collection; or if this Project has previously
3674     * been saved, it will retrieve related InboxEvents from storage.
3675     *
3676     * This method is protected by default in order to keep the public
3677     * api reasonable. You can provide public methods for those you
3678     * actually need in Project.
3679     */

3680    protected List JavaDoc getInboxEventsJoinProduct(Criteria criteria)
3681        throws TorqueException
3682    {
3683                    if (collInboxEvents == null)
3684        {
3685            if (isNew())
3686            {
3687               collInboxEvents = new ArrayList JavaDoc();
3688            }
3689            else
3690            {
3691                              criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3692                              collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria);
3693            }
3694        }
3695        else
3696        {
3697            // the following code is to determine if a new query is
3698
// called for. If the criteria is the same as the last
3699
// one, just return the collection.
3700

3701                        criteria.add(InboxEventPeer.PROJECT_ID, getProjectId());
3702                                    if (!lastInboxEventsCriteria.equals(criteria))
3703            {
3704                collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria);
3705            }
3706        }
3707        lastInboxEventsCriteria = criteria;
3708
3709        return collInboxEvents;
3710                }
3711                            
3712
3713
3714                          
3715            
3716          /**
3717     * Collection to store aggregation of collOutboxEvents
3718     */

3719    protected List JavaDoc collOutboxEvents;
3720
3721    /**
3722     * Temporary storage of collOutboxEvents to save a possible db hit in
3723     * the event objects are add to the collection, but the
3724     * complete collection is never requested.
3725     */

3726    protected void initOutboxEvents()
3727    {
3728        if (collOutboxEvents == null)
3729        {
3730            collOutboxEvents = new ArrayList JavaDoc();
3731        }
3732    }
3733
3734    /**
3735     * Method called to associate a OutboxEvent object to this object
3736     * through the OutboxEvent foreign key attribute
3737     *
3738     * @param l OutboxEvent
3739     * @throws TorqueException
3740     */

3741    public void addOutboxEvent(OutboxEvent l) throws TorqueException
3742    {
3743        getOutboxEvents().add(l);
3744        l.setProject((Project) this);
3745    }
3746
3747    /**
3748     * The criteria used to select the current contents of collOutboxEvents
3749     */

3750    private Criteria lastOutboxEventsCriteria = null;
3751      
3752    /**
3753     * If this collection has already been initialized, returns
3754     * the collection. Otherwise returns the results of
3755     * getOutboxEvents(new Criteria())
3756     *
3757     * @throws TorqueException
3758     */

3759    public List JavaDoc getOutboxEvents() throws TorqueException
3760    {
3761              if (collOutboxEvents == null)
3762        {
3763            collOutboxEvents = getOutboxEvents(new Criteria(10));
3764        }
3765        return collOutboxEvents;
3766          }
3767
3768    /**
3769     * If this collection has already been initialized with
3770     * an identical criteria, it returns the collection.
3771     * Otherwise if this Project has previously
3772     * been saved, it will retrieve related OutboxEvents from storage.
3773     * If this Project is new, it will return
3774     * an empty collection or the current collection, the criteria
3775     * is ignored on a new object.
3776     *
3777     * @throws TorqueException
3778     */

3779    public List JavaDoc getOutboxEvents(Criteria criteria) throws TorqueException
3780    {
3781              if (collOutboxEvents == null)
3782        {
3783            if (isNew())
3784            {
3785               collOutboxEvents = new ArrayList JavaDoc();
3786            }
3787            else
3788            {
3789                        criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId() );
3790                        collOutboxEvents = OutboxEventPeer.doSelect(criteria);
3791            }
3792        }
3793        else
3794        {
3795            // criteria has no effect for a new object
3796
if (!isNew())
3797            {
3798                // the following code is to determine if a new query is
3799
// called for. If the criteria is the same as the last
3800
// one, just return the collection.
3801
criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3802                            if (!lastOutboxEventsCriteria.equals(criteria))
3803                {
3804                    collOutboxEvents = OutboxEventPeer.doSelect(criteria);
3805                }
3806            }
3807        }
3808        lastOutboxEventsCriteria = criteria;
3809
3810        return collOutboxEvents;
3811          }
3812
3813    /**
3814     * If this collection has already been initialized, returns
3815     * the collection. Otherwise returns the results of
3816     * getOutboxEvents(new Criteria(),Connection)
3817     * This method takes in the Connection also as input so that
3818     * referenced objects can also be obtained using a Connection
3819     * that is taken as input
3820     */

3821    public List JavaDoc getOutboxEvents(Connection JavaDoc con) throws TorqueException
3822    {
3823              if (collOutboxEvents == null)
3824        {
3825            collOutboxEvents = getOutboxEvents(new Criteria(10), con);
3826        }
3827        return collOutboxEvents;
3828          }
3829
3830    /**
3831     * If this collection has already been initialized with
3832     * an identical criteria, it returns the collection.
3833     * Otherwise if this Project has previously
3834     * been saved, it will retrieve related OutboxEvents from storage.
3835     * If this Project is new, it will return
3836     * an empty collection or the current collection, the criteria
3837     * is ignored on a new object.
3838     * This method takes in the Connection also as input so that
3839     * referenced objects can also be obtained using a Connection
3840     * that is taken as input
3841     */

3842    public List JavaDoc getOutboxEvents(Criteria criteria, Connection JavaDoc con)
3843            throws TorqueException
3844    {
3845              if (collOutboxEvents == null)
3846        {
3847            if (isNew())
3848            {
3849               collOutboxEvents = new ArrayList JavaDoc();
3850            }
3851            else
3852            {
3853                         criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3854                         collOutboxEvents = OutboxEventPeer.doSelect(criteria, con);
3855             }
3856         }
3857         else
3858         {
3859             // criteria has no effect for a new object
3860
if (!isNew())
3861             {
3862                 // the following code is to determine if a new query is
3863
// called for. If the criteria is the same as the last
3864
// one, just return the collection.
3865
criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3866                             if (!lastOutboxEventsCriteria.equals(criteria))
3867                 {
3868                     collOutboxEvents = OutboxEventPeer.doSelect(criteria, con);
3869                 }
3870             }
3871         }
3872         lastOutboxEventsCriteria = criteria;
3873
3874         return collOutboxEvents;
3875           }
3876
3877                              
3878              
3879                    
3880                    
3881                                
3882                                                              
3883                                        
3884                    
3885                    
3886          
3887    /**
3888     * If this collection has already been initialized with
3889     * an identical criteria, it returns the collection.
3890     * Otherwise if this Project is new, it will return
3891     * an empty collection; or if this Project has previously
3892     * been saved, it will retrieve related OutboxEvents from storage.
3893     *
3894     * This method is protected by default in order to keep the public
3895     * api reasonable. You can provide public methods for those you
3896     * actually need in Project.
3897     */

3898    protected List JavaDoc getOutboxEventsJoinCustomer(Criteria criteria)
3899        throws TorqueException
3900    {
3901                    if (collOutboxEvents == null)
3902        {
3903            if (isNew())
3904            {
3905               collOutboxEvents = new ArrayList JavaDoc();
3906            }
3907            else
3908            {
3909                              criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3910                              collOutboxEvents = OutboxEventPeer.doSelectJoinCustomer(criteria);
3911            }
3912        }
3913        else
3914        {
3915            // the following code is to determine if a new query is
3916
// called for. If the criteria is the same as the last
3917
// one, just return the collection.
3918

3919                        criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3920                                    if (!lastOutboxEventsCriteria.equals(criteria))
3921            {
3922                collOutboxEvents = OutboxEventPeer.doSelectJoinCustomer(criteria);
3923            }
3924        }
3925        lastOutboxEventsCriteria = criteria;
3926
3927        return collOutboxEvents;
3928                }
3929                  
3930                    
3931                              
3932                                
3933                                                              
3934                                        
3935                    
3936                    
3937          
3938    /**
3939     * If this collection has already been initialized with
3940     * an identical criteria, it returns the collection.
3941     * Otherwise if this Project is new, it will return
3942     * an empty collection; or if this Project has previously
3943     * been saved, it will retrieve related OutboxEvents from storage.
3944     *
3945     * This method is protected by default in order to keep the public
3946     * api reasonable. You can provide public methods for those you
3947     * actually need in Project.
3948     */

3949    protected List JavaDoc getOutboxEventsJoinProject(Criteria criteria)
3950        throws TorqueException
3951    {
3952                    if (collOutboxEvents == null)
3953        {
3954            if (isNew())
3955            {
3956               collOutboxEvents = new ArrayList JavaDoc();
3957            }
3958            else
3959            {
3960                              criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3961                              collOutboxEvents = OutboxEventPeer.doSelectJoinProject(criteria);
3962            }
3963        }
3964        else
3965        {
3966            // the following code is to determine if a new query is
3967
// called for. If the criteria is the same as the last
3968
// one, just return the collection.
3969

3970                        criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
3971                                    if (!lastOutboxEventsCriteria.equals(criteria))
3972            {
3973                collOutboxEvents = OutboxEventPeer.doSelectJoinProject(criteria);
3974            }
3975        }
3976        lastOutboxEventsCriteria = criteria;
3977
3978        return collOutboxEvents;
3979                }
3980                  
3981                    
3982                    
3983                                
3984                                                              
3985                                        
3986                    
3987                    
3988          
3989    /**
3990     * If this collection has already been initialized with
3991     * an identical criteria, it returns the collection.
3992     * Otherwise if this Project is new, it will return
3993     * an empty collection; or if this Project has previously
3994     * been saved, it will retrieve related OutboxEvents from storage.
3995     *
3996     * This method is protected by default in order to keep the public
3997     * api reasonable. You can provide public methods for those you
3998     * actually need in Project.
3999     */

4000    protected List JavaDoc getOutboxEventsJoinProduct(Criteria criteria)
4001        throws TorqueException
4002    {
4003                    if (collOutboxEvents == null)
4004        {
4005            if (isNew())
4006            {
4007               collOutboxEvents = new ArrayList JavaDoc();
4008            }
4009            else
4010            {
4011                              criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
4012                              collOutboxEvents = OutboxEventPeer.doSelectJoinProduct(criteria);
4013            }
4014        }
4015        else
4016        {
4017            // the following code is to determine if a new query is
4018
// called for. If the criteria is the same as the last
4019
// one, just return the collection.
4020

4021                        criteria.add(OutboxEventPeer.PROJECT_ID, getProjectId());
4022                                    if (!lastOutboxEventsCriteria.equals(criteria))
4023            {
4024                collOutboxEvents = OutboxEventPeer.doSelectJoinProduct(criteria);
4025            }
4026        }
4027        lastOutboxEventsCriteria = criteria;
4028
4029        return collOutboxEvents;
4030                }
4031                            
4032
4033
4034                          
4035            
4036          /**
4037     * Collection to store aggregation of collNewsSubscriptions
4038     */

4039    protected List JavaDoc collNewsSubscriptions;
4040
4041    /**
4042     * Temporary storage of collNewsSubscriptions to save a possible db hit in
4043     * the event objects are add to the collection, but the
4044     * complete collection is never requested.
4045     */

4046    protected void initNewsSubscriptions()
4047    {
4048        if (collNewsSubscriptions == null)
4049        {
4050            collNewsSubscriptions = new ArrayList JavaDoc();
4051        }
4052    }
4053
4054    /**
4055     * Method called to associate a NewsSubscription object to this object
4056     * through the NewsSubscription foreign key attribute
4057     *
4058     * @param l NewsSubscription
4059     * @throws TorqueException
4060     */

4061    public void addNewsSubscription(NewsSubscription l) throws TorqueException
4062    {
4063        getNewsSubscriptions().add(l);
4064        l.setProject((Project) this);
4065    }
4066
4067    /**
4068     * The criteria used to select the current contents of collNewsSubscriptions
4069     */

4070    private Criteria lastNewsSubscriptionsCriteria = null;
4071      
4072    /**
4073     * If this collection has already been initialized, returns
4074     * the collection. Otherwise returns the results of
4075     * getNewsSubscriptions(new Criteria())
4076     *
4077     * @throws TorqueException
4078     */

4079    public List JavaDoc getNewsSubscriptions() throws TorqueException
4080    {
4081              if (collNewsSubscriptions == null)
4082        {
4083            collNewsSubscriptions = getNewsSubscriptions(new Criteria(10));
4084        }
4085        return collNewsSubscriptions;
4086          }
4087
4088    /**
4089     * If this collection has already been initialized with
4090     * an identical criteria, it returns the collection.
4091     * Otherwise if this Project has previously
4092     * been saved, it will retrieve related NewsSubscriptions from storage.
4093     * If this Project is new, it will return
4094     * an empty collection or the current collection, the criteria
4095     * is ignored on a new object.
4096     *
4097     * @throws TorqueException
4098     */

4099    public List JavaDoc getNewsSubscriptions(Criteria criteria) throws TorqueException
4100    {
4101              if (collNewsSubscriptions == null)
4102        {
4103            if (isNew())
4104            {
4105               collNewsSubscriptions = new ArrayList JavaDoc();
4106            }
4107            else
4108            {
4109                        criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId() );
4110                        collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria);
4111            }
4112        }
4113        else
4114        {
4115            // criteria has no effect for a new object
4116
if (!isNew())
4117            {
4118                // the following code is to determine if a new query is
4119
// called for. If the criteria is the same as the last
4120
// one, just return the collection.
4121
criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4122                            if (!lastNewsSubscriptionsCriteria.equals(criteria))
4123                {
4124                    collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria);
4125                }
4126            }
4127        }
4128        lastNewsSubscriptionsCriteria = criteria;
4129
4130        return collNewsSubscriptions;
4131          }
4132
4133    /**
4134     * If this collection has already been initialized, returns
4135     * the collection. Otherwise returns the results of
4136     * getNewsSubscriptions(new Criteria(),Connection)
4137     * This method takes in the Connection also as input so that
4138     * referenced objects can also be obtained using a Connection
4139     * that is taken as input
4140     */

4141    public List JavaDoc getNewsSubscriptions(Connection JavaDoc con) throws TorqueException
4142    {
4143              if (collNewsSubscriptions == null)
4144        {
4145            collNewsSubscriptions = getNewsSubscriptions(new Criteria(10), con);
4146        }
4147        return collNewsSubscriptions;
4148          }
4149
4150    /**
4151     * If this collection has already been initialized with
4152     * an identical criteria, it returns the collection.
4153     * Otherwise if this Project has previously
4154     * been saved, it will retrieve related NewsSubscriptions from storage.
4155     * If this Project is new, it will return
4156     * an empty collection or the current collection, the criteria
4157     * is ignored on a new object.
4158     * This method takes in the Connection also as input so that
4159     * referenced objects can also be obtained using a Connection
4160     * that is taken as input
4161     */

4162    public List JavaDoc getNewsSubscriptions(Criteria criteria, Connection JavaDoc con)
4163            throws TorqueException
4164    {
4165              if (collNewsSubscriptions == null)
4166        {
4167            if (isNew())
4168            {
4169               collNewsSubscriptions = new ArrayList JavaDoc();
4170            }
4171            else
4172            {
4173                         criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4174                         collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria, con);
4175             }
4176         }
4177         else
4178         {
4179             // criteria has no effect for a new object
4180
if (!isNew())
4181             {
4182                 // the following code is to determine if a new query is
4183
// called for. If the criteria is the same as the last
4184
// one, just return the collection.
4185
criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4186                             if (!lastNewsSubscriptionsCriteria.equals(criteria))
4187                 {
4188                     collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria, con);
4189                 }
4190             }
4191         }
4192         lastNewsSubscriptionsCriteria = criteria;
4193
4194         return collNewsSubscriptions;
4195           }
4196
4197                        
4198              
4199                    
4200                              
4201                                
4202                                                              
4203                                        
4204                    
4205                    
4206          
4207    /**
4208     * If this collection has already been initialized with
4209     * an identical criteria, it returns the collection.
4210     * Otherwise if this Project is new, it will return
4211     * an empty collection; or if this Project has previously
4212     * been saved, it will retrieve related NewsSubscriptions from storage.
4213     *
4214     * This method is protected by default in order to keep the public
4215     * api reasonable. You can provide public methods for those you
4216     * actually need in Project.
4217     */

4218    protected List JavaDoc getNewsSubscriptionsJoinProject(Criteria criteria)
4219        throws TorqueException
4220    {
4221                    if (collNewsSubscriptions == null)
4222        {
4223            if (isNew())
4224            {
4225               collNewsSubscriptions = new ArrayList JavaDoc();
4226            }
4227            else
4228            {
4229                              criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4230                              collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProject(criteria);
4231            }
4232        }
4233        else
4234        {
4235            // the following code is to determine if a new query is
4236
// called for. If the criteria is the same as the last
4237
// one, just return the collection.
4238

4239                        criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4240                                    if (!lastNewsSubscriptionsCriteria.equals(criteria))
4241            {
4242                collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProject(criteria);
4243            }
4244        }
4245        lastNewsSubscriptionsCriteria = criteria;
4246
4247        return collNewsSubscriptions;
4248                }
4249                  
4250                    
4251                    
4252                                
4253                                                              
4254                                        
4255                    
4256                    
4257          
4258    /**
4259     * If this collection has already been initialized with
4260     * an identical criteria, it returns the collection.
4261     * Otherwise if this Project is new, it will return
4262     * an empty collection; or if this Project has previously
4263     * been saved, it will retrieve related NewsSubscriptions from storage.
4264     *
4265     * This method is protected by default in order to keep the public
4266     * api reasonable. You can provide public methods for those you
4267     * actually need in Project.
4268     */

4269    protected List JavaDoc getNewsSubscriptionsJoinProduct(Criteria criteria)
4270        throws TorqueException
4271    {
4272                    if (collNewsSubscriptions == null)
4273        {
4274            if (isNew())
4275            {
4276               collNewsSubscriptions = new ArrayList JavaDoc();
4277            }
4278            else
4279            {
4280                              criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4281                              collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProduct(criteria);
4282            }
4283        }
4284        else
4285        {
4286            // the following code is to determine if a new query is
4287
// called for. If the criteria is the same as the last
4288
// one, just return the collection.
4289

4290                        criteria.add(NewsSubscriptionPeer.PROJECT_ID, getProjectId());
4291                                    if (!lastNewsSubscriptionsCriteria.equals(criteria))
4292            {
4293                collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProduct(criteria);
4294            }
4295        }
4296        lastNewsSubscriptionsCriteria = criteria;
4297
4298        return collNewsSubscriptions;
4299                }
4300                            
4301
4302
4303                                  
4304            
4305          /**
4306     * Collection to store aggregation of collNewslettersRelatedByProjectId
4307     */

4308    protected List JavaDoc collNewslettersRelatedByProjectId;
4309
4310    /**
4311     * Temporary storage of collNewslettersRelatedByProjectId to save a possible db hit in
4312     * the event objects are add to the collection, but the
4313     * complete collection is never requested.
4314     */

4315    protected void initNewslettersRelatedByProjectId()
4316    {
4317        if (collNewslettersRelatedByProjectId == null)
4318        {
4319            collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4320        }
4321    }
4322
4323    /**
4324     * Method called to associate a Newsletter object to this object
4325     * through the Newsletter foreign key attribute
4326     *
4327     * @param l Newsletter
4328     * @throws TorqueException
4329     */

4330    public void addNewsletterRelatedByProjectId(Newsletter l) throws TorqueException
4331    {
4332        getNewslettersRelatedByProjectId().add(l);
4333        l.setProjectRelatedByProjectId((Project) this);
4334    }
4335
4336    /**
4337     * The criteria used to select the current contents of collNewslettersRelatedByProjectId
4338     */

4339    private Criteria lastNewslettersRelatedByProjectIdCriteria = null;
4340      
4341    /**
4342     * If this collection has already been initialized, returns
4343     * the collection. Otherwise returns the results of
4344     * getNewslettersRelatedByProjectId(new Criteria())
4345     *
4346     * @throws TorqueException
4347     */

4348    public List JavaDoc getNewslettersRelatedByProjectId() throws TorqueException
4349    {
4350              if (collNewslettersRelatedByProjectId == null)
4351        {
4352            collNewslettersRelatedByProjectId = getNewslettersRelatedByProjectId(new Criteria(10));
4353        }
4354        return collNewslettersRelatedByProjectId;
4355          }
4356
4357    /**
4358     * If this collection has already been initialized with
4359     * an identical criteria, it returns the collection.
4360     * Otherwise if this Project has previously
4361     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4362     * If this Project is new, it will return
4363     * an empty collection or the current collection, the criteria
4364     * is ignored on a new object.
4365     *
4366     * @throws TorqueException
4367     */

4368    public List JavaDoc getNewslettersRelatedByProjectId(Criteria criteria) throws TorqueException
4369    {
4370              if (collNewslettersRelatedByProjectId == null)
4371        {
4372            if (isNew())
4373            {
4374               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4375            }
4376            else
4377            {
4378                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId() );
4379                        collNewslettersRelatedByProjectId = NewsletterPeer.doSelect(criteria);
4380            }
4381        }
4382        else
4383        {
4384            // criteria has no effect for a new object
4385
if (!isNew())
4386            {
4387                // the following code is to determine if a new query is
4388
// called for. If the criteria is the same as the last
4389
// one, just return the collection.
4390
criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4391                            if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4392                {
4393                    collNewslettersRelatedByProjectId = NewsletterPeer.doSelect(criteria);
4394                }
4395            }
4396        }
4397        lastNewslettersRelatedByProjectIdCriteria = criteria;
4398
4399        return collNewslettersRelatedByProjectId;
4400          }
4401
4402    /**
4403     * If this collection has already been initialized, returns
4404     * the collection. Otherwise returns the results of
4405     * getNewslettersRelatedByProjectId(new Criteria(),Connection)
4406     * This method takes in the Connection also as input so that
4407     * referenced objects can also be obtained using a Connection
4408     * that is taken as input
4409     */

4410    public List JavaDoc getNewslettersRelatedByProjectId(Connection JavaDoc con) throws TorqueException
4411    {
4412              if (collNewslettersRelatedByProjectId == null)
4413        {
4414            collNewslettersRelatedByProjectId = getNewslettersRelatedByProjectId(new Criteria(10), con);
4415        }
4416        return collNewslettersRelatedByProjectId;
4417          }
4418
4419    /**
4420     * If this collection has already been initialized with
4421     * an identical criteria, it returns the collection.
4422     * Otherwise if this Project has previously
4423     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4424     * If this Project is new, it will return
4425     * an empty collection or the current collection, the criteria
4426     * is ignored on a new object.
4427     * This method takes in the Connection also as input so that
4428     * referenced objects can also be obtained using a Connection
4429     * that is taken as input
4430     */

4431    public List JavaDoc getNewslettersRelatedByProjectId(Criteria criteria, Connection JavaDoc con)
4432            throws TorqueException
4433    {
4434              if (collNewslettersRelatedByProjectId == null)
4435        {
4436            if (isNew())
4437            {
4438               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4439            }
4440            else
4441            {
4442                         criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4443                         collNewslettersRelatedByProjectId = NewsletterPeer.doSelect(criteria, con);
4444             }
4445         }
4446         else
4447         {
4448             // criteria has no effect for a new object
4449
if (!isNew())
4450             {
4451                 // the following code is to determine if a new query is
4452
// called for. If the criteria is the same as the last
4453
// one, just return the collection.
4454
criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4455                             if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4456                 {
4457                     collNewslettersRelatedByProjectId = NewsletterPeer.doSelect(criteria, con);
4458                 }
4459             }
4460         }
4461         lastNewslettersRelatedByProjectIdCriteria = criteria;
4462
4463         return collNewslettersRelatedByProjectId;
4464           }
4465
4466                                                            
4467              
4468                    
4469                    
4470                                
4471                                                              
4472                                        
4473                    
4474                                
4475          
4476    /**
4477     * If this collection has already been initialized with
4478     * an identical criteria, it returns the collection.
4479     * Otherwise if this Project is new, it will return
4480     * an empty collection; or if this Project has previously
4481     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4482     *
4483     * This method is protected by default in order to keep the public
4484     * api reasonable. You can provide public methods for those you
4485     * actually need in Project.
4486     */

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

4508                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4509                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4510            {
4511                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
4512            }
4513        }
4514        lastNewslettersRelatedByProjectIdCriteria = criteria;
4515
4516        return collNewslettersRelatedByProjectId;
4517                }
4518                  
4519                    
4520                              
4521                                            
4522                                                                          
4523                                        
4524                    
4525                                            
4526                  
4527                    
4528                    
4529                                            
4530                                                                          
4531                                        
4532                    
4533                                
4534          
4535    /**
4536     * If this collection has already been initialized with
4537     * an identical criteria, it returns the collection.
4538     * Otherwise if this Project is new, it will return
4539     * an empty collection; or if this Project has previously
4540     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4541     *
4542     * This method is protected by default in order to keep the public
4543     * api reasonable. You can provide public methods for those you
4544     * actually need in Project.
4545     */

4546    protected List JavaDoc getNewslettersRelatedByProjectIdJoinProductRelatedByProductId(Criteria criteria)
4547        throws TorqueException
4548    {
4549                    if (collNewslettersRelatedByProjectId == null)
4550        {
4551            if (isNew())
4552            {
4553               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4554            }
4555            else
4556            {
4557                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4558                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
4559            }
4560        }
4561        else
4562        {
4563            // the following code is to determine if a new query is
4564
// called for. If the criteria is the same as the last
4565
// one, just return the collection.
4566

4567                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4568                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4569            {
4570                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
4571            }
4572        }
4573        lastNewslettersRelatedByProjectIdCriteria = criteria;
4574
4575        return collNewslettersRelatedByProjectId;
4576                }
4577                  
4578                    
4579                              
4580                                            
4581                                                                          
4582                                        
4583                    
4584                                
4585          
4586    /**
4587     * If this collection has already been initialized with
4588     * an identical criteria, it returns the collection.
4589     * Otherwise if this Project is new, it will return
4590     * an empty collection; or if this Project has previously
4591     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4592     *
4593     * This method is protected by default in order to keep the public
4594     * api reasonable. You can provide public methods for those you
4595     * actually need in Project.
4596     */

4597    protected List JavaDoc getNewslettersRelatedByProjectIdJoinProjectRelatedByRelProjectId(Criteria criteria)
4598        throws TorqueException
4599    {
4600                    if (collNewslettersRelatedByProjectId == null)
4601        {
4602            if (isNew())
4603            {
4604               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4605            }
4606            else
4607            {
4608                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4609                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
4610            }
4611        }
4612        else
4613        {
4614            // the following code is to determine if a new query is
4615
// called for. If the criteria is the same as the last
4616
// one, just return the collection.
4617

4618                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4619                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4620            {
4621                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
4622            }
4623        }
4624        lastNewslettersRelatedByProjectIdCriteria = criteria;
4625
4626        return collNewslettersRelatedByProjectId;
4627                }
4628                  
4629                    
4630                    
4631                                            
4632                                                                          
4633                                        
4634                    
4635                                
4636          
4637    /**
4638     * If this collection has already been initialized with
4639     * an identical criteria, it returns the collection.
4640     * Otherwise if this Project is new, it will return
4641     * an empty collection; or if this Project has previously
4642     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4643     *
4644     * This method is protected by default in order to keep the public
4645     * api reasonable. You can provide public methods for those you
4646     * actually need in Project.
4647     */

4648    protected List JavaDoc getNewslettersRelatedByProjectIdJoinProductRelatedByRelProductId(Criteria criteria)
4649        throws TorqueException
4650    {
4651                    if (collNewslettersRelatedByProjectId == null)
4652        {
4653            if (isNew())
4654            {
4655               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4656            }
4657            else
4658            {
4659                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4660                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
4661            }
4662        }
4663        else
4664        {
4665            // the following code is to determine if a new query is
4666
// called for. If the criteria is the same as the last
4667
// one, just return the collection.
4668

4669                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4670                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4671            {
4672                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
4673            }
4674        }
4675        lastNewslettersRelatedByProjectIdCriteria = criteria;
4676
4677        return collNewslettersRelatedByProjectId;
4678                }
4679                  
4680                    
4681                    
4682                                
4683                                                              
4684                                        
4685                    
4686                                
4687          
4688    /**
4689     * If this collection has already been initialized with
4690     * an identical criteria, it returns the collection.
4691     * Otherwise if this Project is new, it will return
4692     * an empty collection; or if this Project has previously
4693     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4694     *
4695     * This method is protected by default in order to keep the public
4696     * api reasonable. You can provide public methods for those you
4697     * actually need in Project.
4698     */

4699    protected List JavaDoc getNewslettersRelatedByProjectIdJoinCountry(Criteria criteria)
4700        throws TorqueException
4701    {
4702                    if (collNewslettersRelatedByProjectId == null)
4703        {
4704            if (isNew())
4705            {
4706               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4707            }
4708            else
4709            {
4710                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4711                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinCountry(criteria);
4712            }
4713        }
4714        else
4715        {
4716            // the following code is to determine if a new query is
4717
// called for. If the criteria is the same as the last
4718
// one, just return the collection.
4719

4720                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4721                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4722            {
4723                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinCountry(criteria);
4724            }
4725        }
4726        lastNewslettersRelatedByProjectIdCriteria = criteria;
4727
4728        return collNewslettersRelatedByProjectId;
4729                }
4730                  
4731                    
4732                    
4733                                            
4734                                                                          
4735                                        
4736                    
4737                                
4738          
4739    /**
4740     * If this collection has already been initialized with
4741     * an identical criteria, it returns the collection.
4742     * Otherwise if this Project is new, it will return
4743     * an empty collection; or if this Project has previously
4744     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4745     *
4746     * This method is protected by default in order to keep the public
4747     * api reasonable. You can provide public methods for those you
4748     * actually need in Project.
4749     */

4750    protected List JavaDoc getNewslettersRelatedByProjectIdJoinLanguageRelatedByCustLanguageId(Criteria criteria)
4751        throws TorqueException
4752    {
4753                    if (collNewslettersRelatedByProjectId == null)
4754        {
4755            if (isNew())
4756            {
4757               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4758            }
4759            else
4760            {
4761                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4762                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
4763            }
4764        }
4765        else
4766        {
4767            // the following code is to determine if a new query is
4768
// called for. If the criteria is the same as the last
4769
// one, just return the collection.
4770

4771                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4772                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4773            {
4774                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
4775            }
4776        }
4777        lastNewslettersRelatedByProjectIdCriteria = criteria;
4778
4779        return collNewslettersRelatedByProjectId;
4780                }
4781                  
4782                    
4783                    
4784                                            
4785                                                                          
4786                                        
4787                    
4788                                
4789          
4790    /**
4791     * If this collection has already been initialized with
4792     * an identical criteria, it returns the collection.
4793     * Otherwise if this Project is new, it will return
4794     * an empty collection; or if this Project has previously
4795     * been saved, it will retrieve related NewslettersRelatedByProjectId from storage.
4796     *
4797     * This method is protected by default in order to keep the public
4798     * api reasonable. You can provide public methods for those you
4799     * actually need in Project.
4800     */

4801    protected List JavaDoc getNewslettersRelatedByProjectIdJoinLanguageRelatedByLanguageId(Criteria criteria)
4802        throws TorqueException
4803    {
4804                    if (collNewslettersRelatedByProjectId == null)
4805        {
4806            if (isNew())
4807            {
4808               collNewslettersRelatedByProjectId = new ArrayList JavaDoc();
4809            }
4810            else
4811            {
4812                              criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4813                              collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
4814            }
4815        }
4816        else
4817        {
4818            // the following code is to determine if a new query is
4819
// called for. If the criteria is the same as the last
4820
// one, just return the collection.
4821

4822                        criteria.add(NewsletterPeer.PROJECT_ID, getProjectId());
4823                                    if (!lastNewslettersRelatedByProjectIdCriteria.equals(criteria))
4824            {
4825                collNewslettersRelatedByProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
4826            }
4827        }
4828        lastNewslettersRelatedByProjectIdCriteria = criteria;
4829
4830        return collNewslettersRelatedByProjectId;
4831                }
4832                            
4833
4834
4835                                  
4836            
4837          /**
4838     * Collection to store aggregation of collNewslettersRelatedByRelProjectId
4839     */

4840    protected List JavaDoc collNewslettersRelatedByRelProjectId;
4841
4842    /**
4843     * Temporary storage of collNewslettersRelatedByRelProjectId to save a possible db hit in
4844     * the event objects are add to the collection, but the
4845     * complete collection is never requested.
4846     */

4847    protected void initNewslettersRelatedByRelProjectId()
4848    {
4849        if (collNewslettersRelatedByRelProjectId == null)
4850        {
4851            collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
4852        }
4853    }
4854
4855    /**
4856     * Method called to associate a Newsletter object to this object
4857     * through the Newsletter foreign key attribute
4858     *
4859     * @param l Newsletter
4860     * @throws TorqueException
4861     */

4862    public void addNewsletterRelatedByRelProjectId(Newsletter l) throws TorqueException
4863    {
4864        getNewslettersRelatedByRelProjectId().add(l);
4865        l.setProjectRelatedByRelProjectId((Project) this);
4866    }
4867
4868    /**
4869     * The criteria used to select the current contents of collNewslettersRelatedByRelProjectId
4870     */

4871    private Criteria lastNewslettersRelatedByRelProjectIdCriteria = null;
4872      
4873    /**
4874     * If this collection has already been initialized, returns
4875     * the collection. Otherwise returns the results of
4876     * getNewslettersRelatedByRelProjectId(new Criteria())
4877     *
4878     * @throws TorqueException
4879     */

4880    public List JavaDoc getNewslettersRelatedByRelProjectId() throws TorqueException
4881    {
4882              if (collNewslettersRelatedByRelProjectId == null)
4883        {
4884            collNewslettersRelatedByRelProjectId = getNewslettersRelatedByRelProjectId(new Criteria(10));
4885        }
4886        return collNewslettersRelatedByRelProjectId;
4887          }
4888
4889    /**
4890     * If this collection has already been initialized with
4891     * an identical criteria, it returns the collection.
4892     * Otherwise if this Project has previously
4893     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
4894     * If this Project is new, it will return
4895     * an empty collection or the current collection, the criteria
4896     * is ignored on a new object.
4897     *
4898     * @throws TorqueException
4899     */

4900    public List JavaDoc getNewslettersRelatedByRelProjectId(Criteria criteria) throws TorqueException
4901    {
4902              if (collNewslettersRelatedByRelProjectId == null)
4903        {
4904            if (isNew())
4905            {
4906               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
4907            }
4908            else
4909            {
4910                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId() );
4911                        collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelect(criteria);
4912            }
4913        }
4914        else
4915        {
4916            // criteria has no effect for a new object
4917
if (!isNew())
4918            {
4919                // the following code is to determine if a new query is
4920
// called for. If the criteria is the same as the last
4921
// one, just return the collection.
4922
criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
4923                            if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
4924                {
4925                    collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelect(criteria);
4926                }
4927            }
4928        }
4929        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
4930
4931        return collNewslettersRelatedByRelProjectId;
4932          }
4933
4934    /**
4935     * If this collection has already been initialized, returns
4936     * the collection. Otherwise returns the results of
4937     * getNewslettersRelatedByRelProjectId(new Criteria(),Connection)
4938     * This method takes in the Connection also as input so that
4939     * referenced objects can also be obtained using a Connection
4940     * that is taken as input
4941     */

4942    public List JavaDoc getNewslettersRelatedByRelProjectId(Connection JavaDoc con) throws TorqueException
4943    {
4944              if (collNewslettersRelatedByRelProjectId == null)
4945        {
4946            collNewslettersRelatedByRelProjectId = getNewslettersRelatedByRelProjectId(new Criteria(10), con);
4947        }
4948        return collNewslettersRelatedByRelProjectId;
4949          }
4950
4951    /**
4952     * If this collection has already been initialized with
4953     * an identical criteria, it returns the collection.
4954     * Otherwise if this Project has previously
4955     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
4956     * If this Project is new, it will return
4957     * an empty collection or the current collection, the criteria
4958     * is ignored on a new object.
4959     * This method takes in the Connection also as input so that
4960     * referenced objects can also be obtained using a Connection
4961     * that is taken as input
4962     */

4963    public List JavaDoc getNewslettersRelatedByRelProjectId(Criteria criteria, Connection JavaDoc con)
4964            throws TorqueException
4965    {
4966              if (collNewslettersRelatedByRelProjectId == null)
4967        {
4968            if (isNew())
4969            {
4970               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
4971            }
4972            else
4973            {
4974                         criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
4975                         collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelect(criteria, con);
4976             }
4977         }
4978         else
4979         {
4980             // criteria has no effect for a new object
4981
if (!isNew())
4982             {
4983                 // the following code is to determine if a new query is
4984
// called for. If the criteria is the same as the last
4985
// one, just return the collection.
4986
criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
4987                             if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
4988                 {
4989                     collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelect(criteria, con);
4990                 }
4991             }
4992         }
4993         lastNewslettersRelatedByRelProjectIdCriteria = criteria;
4994
4995         return collNewslettersRelatedByRelProjectId;
4996           }
4997
4998                                                            
4999              
5000                    
5001                    
5002                                
5003                                                              
5004                                        
5005                    
5006                                
5007          
5008    /**
5009     * If this collection has already been initialized with
5010     * an identical criteria, it returns the collection.
5011     * Otherwise if this Project is new, it will return
5012     * an empty collection; or if this Project has previously
5013     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5014     *
5015     * This method is protected by default in order to keep the public
5016     * api reasonable. You can provide public methods for those you
5017     * actually need in Project.
5018     */

5019    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinCustomerCategory(Criteria criteria)
5020        throws TorqueException
5021    {
5022                    if (collNewslettersRelatedByRelProjectId == null)
5023        {
5024            if (isNew())
5025            {
5026               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5027            }
5028            else
5029            {
5030                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5031                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
5032            }
5033        }
5034        else
5035        {
5036            // the following code is to determine if a new query is
5037
// called for. If the criteria is the same as the last
5038
// one, just return the collection.
5039

5040                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5041                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5042            {
5043                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
5044            }
5045        }
5046        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5047
5048        return collNewslettersRelatedByRelProjectId;
5049                }
5050                  
5051                    
5052                              
5053                                            
5054                                                                          
5055                                        
5056                    
5057                                
5058          
5059    /**
5060     * If this collection has already been initialized with
5061     * an identical criteria, it returns the collection.
5062     * Otherwise if this Project is new, it will return
5063     * an empty collection; or if this Project has previously
5064     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5065     *
5066     * This method is protected by default in order to keep the public
5067     * api reasonable. You can provide public methods for those you
5068     * actually need in Project.
5069     */

5070    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinProjectRelatedByProjectId(Criteria criteria)
5071        throws TorqueException
5072    {
5073                    if (collNewslettersRelatedByRelProjectId == null)
5074        {
5075            if (isNew())
5076            {
5077               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5078            }
5079            else
5080            {
5081                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5082                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
5083            }
5084        }
5085        else
5086        {
5087            // the following code is to determine if a new query is
5088
// called for. If the criteria is the same as the last
5089
// one, just return the collection.
5090

5091                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5092                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5093            {
5094                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
5095            }
5096        }
5097        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5098
5099        return collNewslettersRelatedByRelProjectId;
5100                }
5101                  
5102                    
5103                    
5104                                            
5105                                                                          
5106                                        
5107                    
5108                                
5109          
5110    /**
5111     * If this collection has already been initialized with
5112     * an identical criteria, it returns the collection.
5113     * Otherwise if this Project is new, it will return
5114     * an empty collection; or if this Project has previously
5115     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5116     *
5117     * This method is protected by default in order to keep the public
5118     * api reasonable. You can provide public methods for those you
5119     * actually need in Project.
5120     */

5121    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinProductRelatedByProductId(Criteria criteria)
5122        throws TorqueException
5123    {
5124                    if (collNewslettersRelatedByRelProjectId == null)
5125        {
5126            if (isNew())
5127            {
5128               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5129            }
5130            else
5131            {
5132                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5133                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
5134            }
5135        }
5136        else
5137        {
5138            // the following code is to determine if a new query is
5139
// called for. If the criteria is the same as the last
5140
// one, just return the collection.
5141

5142                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5143                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5144            {
5145                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
5146            }
5147        }
5148        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5149
5150        return collNewslettersRelatedByRelProjectId;
5151                }
5152                  
5153                    
5154                              
5155                                            
5156                                                                          
5157                                        
5158                    
5159                                            
5160                  
5161                    
5162                    
5163                                            
5164                                                                          
5165                                        
5166                    
5167                                
5168          
5169    /**
5170     * If this collection has already been initialized with
5171     * an identical criteria, it returns the collection.
5172     * Otherwise if this Project is new, it will return
5173     * an empty collection; or if this Project has previously
5174     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5175     *
5176     * This method is protected by default in order to keep the public
5177     * api reasonable. You can provide public methods for those you
5178     * actually need in Project.
5179     */

5180    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinProductRelatedByRelProductId(Criteria criteria)
5181        throws TorqueException
5182    {
5183                    if (collNewslettersRelatedByRelProjectId == null)
5184        {
5185            if (isNew())
5186            {
5187               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5188            }
5189            else
5190            {
5191                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5192                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
5193            }
5194        }
5195        else
5196        {
5197            // the following code is to determine if a new query is
5198
// called for. If the criteria is the same as the last
5199
// one, just return the collection.
5200

5201                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5202                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5203            {
5204                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
5205            }
5206        }
5207        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5208
5209        return collNewslettersRelatedByRelProjectId;
5210                }
5211                  
5212                    
5213                    
5214                                
5215                                                              
5216                                        
5217                    
5218                                
5219          
5220    /**
5221     * If this collection has already been initialized with
5222     * an identical criteria, it returns the collection.
5223     * Otherwise if this Project is new, it will return
5224     * an empty collection; or if this Project has previously
5225     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5226     *
5227     * This method is protected by default in order to keep the public
5228     * api reasonable. You can provide public methods for those you
5229     * actually need in Project.
5230     */

5231    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinCountry(Criteria criteria)
5232        throws TorqueException
5233    {
5234                    if (collNewslettersRelatedByRelProjectId == null)
5235        {
5236            if (isNew())
5237            {
5238               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5239            }
5240            else
5241            {
5242                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5243                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinCountry(criteria);
5244            }
5245        }
5246        else
5247        {
5248            // the following code is to determine if a new query is
5249
// called for. If the criteria is the same as the last
5250
// one, just return the collection.
5251

5252                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5253                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5254            {
5255                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinCountry(criteria);
5256            }
5257        }
5258        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5259
5260        return collNewslettersRelatedByRelProjectId;
5261                }
5262                  
5263                    
5264                    
5265                                            
5266                                                                          
5267                                        
5268                    
5269                                
5270          
5271    /**
5272     * If this collection has already been initialized with
5273     * an identical criteria, it returns the collection.
5274     * Otherwise if this Project is new, it will return
5275     * an empty collection; or if this Project has previously
5276     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5277     *
5278     * This method is protected by default in order to keep the public
5279     * api reasonable. You can provide public methods for those you
5280     * actually need in Project.
5281     */

5282    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinLanguageRelatedByCustLanguageId(Criteria criteria)
5283        throws TorqueException
5284    {
5285                    if (collNewslettersRelatedByRelProjectId == null)
5286        {
5287            if (isNew())
5288            {
5289               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5290            }
5291            else
5292            {
5293                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5294                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
5295            }
5296        }
5297        else
5298        {
5299            // the following code is to determine if a new query is
5300
// called for. If the criteria is the same as the last
5301
// one, just return the collection.
5302

5303                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5304                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5305            {
5306                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
5307            }
5308        }
5309        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5310
5311        return collNewslettersRelatedByRelProjectId;
5312                }
5313                  
5314                    
5315                    
5316                                            
5317                                                                          
5318                                        
5319                    
5320                                
5321          
5322    /**
5323     * If this collection has already been initialized with
5324     * an identical criteria, it returns the collection.
5325     * Otherwise if this Project is new, it will return
5326     * an empty collection; or if this Project has previously
5327     * been saved, it will retrieve related NewslettersRelatedByRelProjectId from storage.
5328     *
5329     * This method is protected by default in order to keep the public
5330     * api reasonable. You can provide public methods for those you
5331     * actually need in Project.
5332     */

5333    protected List JavaDoc getNewslettersRelatedByRelProjectIdJoinLanguageRelatedByLanguageId(Criteria criteria)
5334        throws TorqueException
5335    {
5336                    if (collNewslettersRelatedByRelProjectId == null)
5337        {
5338            if (isNew())
5339            {
5340               collNewslettersRelatedByRelProjectId = new ArrayList JavaDoc();
5341            }
5342            else
5343            {
5344                              criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5345                              collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
5346            }
5347        }
5348        else
5349        {
5350            // the following code is to determine if a new query is
5351
// called for. If the criteria is the same as the last
5352
// one, just return the collection.
5353

5354                        criteria.add(NewsletterPeer.REL_PROJECT_ID, getProjectId());
5355                                    if (!lastNewslettersRelatedByRelProjectIdCriteria.equals(criteria))
5356            {
5357                collNewslettersRelatedByRelProjectId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
5358            }
5359        }
5360        lastNewslettersRelatedByRelProjectIdCriteria = criteria;
5361
5362        return collNewslettersRelatedByRelProjectId;
5363                }
5364                            
5365
5366
5367                          
5368            
5369          /**
5370     * Collection to store aggregation of collSorderItems
5371     */

5372    protected List JavaDoc collSorderItems;
5373
5374    /**
5375     * Temporary storage of collSorderItems to save a possible db hit in
5376     * the event objects are add to the collection, but the
5377     * complete collection is never requested.
5378     */

5379    protected void initSorderItems()
5380    {
5381        if (collSorderItems == null)
5382        {
5383            collSorderItems = new ArrayList JavaDoc();
5384        }
5385    }
5386
5387    /**
5388     * Method called to associate a SorderItem object to this object
5389     * through the SorderItem foreign key attribute
5390     *
5391     * @param l SorderItem
5392     * @throws TorqueException
5393     */

5394    public void addSorderItem(SorderItem l) throws TorqueException
5395    {
5396        getSorderItems().add(l);
5397        l.setProject((Project) this);
5398    }
5399
5400    /**
5401     * The criteria used to select the current contents of collSorderItems
5402     */

5403    private Criteria lastSorderItemsCriteria = null;
5404      
5405    /**
5406     * If this collection has already been initialized, returns
5407     * the collection. Otherwise returns the results of
5408     * getSorderItems(new Criteria())
5409     *
5410     * @throws TorqueException
5411     */

5412    public List JavaDoc getSorderItems() throws TorqueException
5413    {
5414              if (collSorderItems == null)
5415        {
5416            collSorderItems = getSorderItems(new Criteria(10));
5417        }
5418        return collSorderItems;
5419          }
5420
5421    /**
5422     * If this collection has already been initialized with
5423     * an identical criteria, it returns the collection.
5424     * Otherwise if this Project has previously
5425     * been saved, it will retrieve related SorderItems from storage.
5426     * If this Project is new, it will return
5427     * an empty collection or the current collection, the criteria
5428     * is ignored on a new object.
5429     *
5430     * @throws TorqueException
5431     */

5432    public List JavaDoc getSorderItems(Criteria criteria) throws TorqueException
5433    {
5434              if (collSorderItems == null)
5435        {
5436            if (isNew())
5437            {
5438               collSorderItems = new ArrayList JavaDoc();
5439            }
5440            else
5441            {
5442                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId() );
5443                        collSorderItems = SorderItemPeer.doSelect(criteria);
5444            }
5445        }
5446        else
5447        {
5448            // criteria has no effect for a new object
5449
if (!isNew())
5450            {
5451                // the following code is to determine if a new query is
5452
// called for. If the criteria is the same as the last
5453
// one, just return the collection.
5454
criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5455                            if (!lastSorderItemsCriteria.equals(criteria))
5456                {
5457                    collSorderItems = SorderItemPeer.doSelect(criteria);
5458                }
5459            }
5460        }
5461        lastSorderItemsCriteria = criteria;
5462
5463        return collSorderItems;
5464          }
5465
5466    /**
5467     * If this collection has already been initialized, returns
5468     * the collection. Otherwise returns the results of
5469     * getSorderItems(new Criteria(),Connection)
5470     * This method takes in the Connection also as input so that
5471     * referenced objects can also be obtained using a Connection
5472     * that is taken as input
5473     */

5474    public List JavaDoc getSorderItems(Connection JavaDoc con) throws TorqueException
5475    {
5476              if (collSorderItems == null)
5477        {
5478            collSorderItems = getSorderItems(new Criteria(10), con);
5479        }
5480        return collSorderItems;
5481          }
5482
5483    /**
5484     * If this collection has already been initialized with
5485     * an identical criteria, it returns the collection.
5486     * Otherwise if this Project has previously
5487     * been saved, it will retrieve related SorderItems from storage.
5488     * If this Project is new, it will return
5489     * an empty collection or the current collection, the criteria
5490     * is ignored on a new object.
5491     * This method takes in the Connection also as input so that
5492     * referenced objects can also be obtained using a Connection
5493     * that is taken as input
5494     */

5495    public List JavaDoc getSorderItems(Criteria criteria, Connection JavaDoc con)
5496            throws TorqueException
5497    {
5498              if (collSorderItems == null)
5499        {
5500            if (isNew())
5501            {
5502               collSorderItems = new ArrayList JavaDoc();
5503            }
5504            else
5505            {
5506                         criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5507                         collSorderItems = SorderItemPeer.doSelect(criteria, con);
5508             }
5509         }
5510         else
5511         {
5512             // criteria has no effect for a new object
5513
if (!isNew())
5514             {
5515                 // the following code is to determine if a new query is
5516
// called for. If the criteria is the same as the last
5517
// one, just return the collection.
5518
criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5519                             if (!lastSorderItemsCriteria.equals(criteria))
5520                 {
5521                     collSorderItems = SorderItemPeer.doSelect(criteria, con);
5522                 }
5523             }
5524         }
5525         lastSorderItemsCriteria = criteria;
5526
5527         return collSorderItems;
5528           }
5529
5530                                                
5531              
5532                    
5533                    
5534                                
5535                                                              
5536                                        
5537                    
5538                    
5539          
5540    /**
5541     * If this collection has already been initialized with
5542     * an identical criteria, it returns the collection.
5543     * Otherwise if this Project is new, it will return
5544     * an empty collection; or if this Project has previously
5545     * been saved, it will retrieve related SorderItems from storage.
5546     *
5547     * This method is protected by default in order to keep the public
5548     * api reasonable. You can provide public methods for those you
5549     * actually need in Project.
5550     */

5551    protected List JavaDoc getSorderItemsJoinSorder(Criteria criteria)
5552        throws TorqueException
5553    {
5554                    if (collSorderItems == null)
5555        {
5556            if (isNew())
5557            {
5558               collSorderItems = new ArrayList JavaDoc();
5559            }
5560            else
5561            {
5562                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5563                              collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
5564            }
5565        }
5566        else
5567        {
5568            // the following code is to determine if a new query is
5569
// called for. If the criteria is the same as the last
5570
// one, just return the collection.
5571

5572                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5573                                    if (!lastSorderItemsCriteria.equals(criteria))
5574            {
5575                collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria);
5576            }
5577        }
5578        lastSorderItemsCriteria = criteria;
5579
5580        return collSorderItems;
5581                }
5582                  
5583                    
5584                    
5585                                
5586                                                              
5587                                        
5588                    
5589                    
5590          
5591    /**
5592     * If this collection has already been initialized with
5593     * an identical criteria, it returns the collection.
5594     * Otherwise if this Project is new, it will return
5595     * an empty collection; or if this Project has previously
5596     * been saved, it will retrieve related SorderItems from storage.
5597     *
5598     * This method is protected by default in order to keep the public
5599     * api reasonable. You can provide public methods for those you
5600     * actually need in Project.
5601     */

5602    protected List JavaDoc getSorderItemsJoinProduct(Criteria criteria)
5603        throws TorqueException
5604    {
5605                    if (collSorderItems == null)
5606        {
5607            if (isNew())
5608            {
5609               collSorderItems = new ArrayList JavaDoc();
5610            }
5611            else
5612            {
5613                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5614                              collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
5615            }
5616        }
5617        else
5618        {
5619            // the following code is to determine if a new query is
5620
// called for. If the criteria is the same as the last
5621
// one, just return the collection.
5622

5623                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5624                                    if (!lastSorderItemsCriteria.equals(criteria))
5625            {
5626                collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria);
5627            }
5628        }
5629        lastSorderItemsCriteria = criteria;
5630
5631        return collSorderItems;
5632                }
5633                  
5634                    
5635                    
5636                                            
5637                                                                          
5638                                        
5639                    
5640                    
5641          
5642    /**
5643     * If this collection has already been initialized with
5644     * an identical criteria, it returns the collection.
5645     * Otherwise if this Project is new, it will return
5646     * an empty collection; or if this Project has previously
5647     * been saved, it will retrieve related SorderItems from storage.
5648     *
5649     * This method is protected by default in order to keep the public
5650     * api reasonable. You can provide public methods for those you
5651     * actually need in Project.
5652     */

5653    protected List JavaDoc getSorderItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
5654        throws TorqueException
5655    {
5656                    if (collSorderItems == null)
5657        {
5658            if (isNew())
5659            {
5660               collSorderItems = new ArrayList JavaDoc();
5661            }
5662            else
5663            {
5664                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5665                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5666            }
5667        }
5668        else
5669        {
5670            // the following code is to determine if a new query is
5671
// called for. If the criteria is the same as the last
5672
// one, just return the collection.
5673

5674                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5675                                    if (!lastSorderItemsCriteria.equals(criteria))
5676            {
5677                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
5678            }
5679        }
5680        lastSorderItemsCriteria = criteria;
5681
5682        return collSorderItems;
5683                }
5684                  
5685                    
5686                    
5687                                            
5688                                                                          
5689                                        
5690                    
5691                    
5692          
5693    /**
5694     * If this collection has already been initialized with
5695     * an identical criteria, it returns the collection.
5696     * Otherwise if this Project is new, it will return
5697     * an empty collection; or if this Project has previously
5698     * been saved, it will retrieve related SorderItems from storage.
5699     *
5700     * This method is protected by default in order to keep the public
5701     * api reasonable. You can provide public methods for those you
5702     * actually need in Project.
5703     */

5704    protected List JavaDoc getSorderItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
5705        throws TorqueException
5706    {
5707                    if (collSorderItems == null)
5708        {
5709            if (isNew())
5710            {
5711               collSorderItems = new ArrayList JavaDoc();
5712            }
5713            else
5714            {
5715                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5716                              collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5717            }
5718        }
5719        else
5720        {
5721            // the following code is to determine if a new query is
5722
// called for. If the criteria is the same as the last
5723
// one, just return the collection.
5724

5725                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5726                                    if (!lastSorderItemsCriteria.equals(criteria))
5727            {
5728                collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
5729            }
5730        }
5731        lastSorderItemsCriteria = criteria;
5732
5733        return collSorderItems;
5734                }
5735                  
5736                    
5737                              
5738                                
5739                                                              
5740                                        
5741                    
5742                    
5743          
5744    /**
5745     * If this collection has already been initialized with
5746     * an identical criteria, it returns the collection.
5747     * Otherwise if this Project is new, it will return
5748     * an empty collection; or if this Project has previously
5749     * been saved, it will retrieve related SorderItems from storage.
5750     *
5751     * This method is protected by default in order to keep the public
5752     * api reasonable. You can provide public methods for those you
5753     * actually need in Project.
5754     */

5755    protected List JavaDoc getSorderItemsJoinProject(Criteria criteria)
5756        throws TorqueException
5757    {
5758                    if (collSorderItems == null)
5759        {
5760            if (isNew())
5761            {
5762               collSorderItems = new ArrayList JavaDoc();
5763            }
5764            else
5765            {
5766                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5767                              collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
5768            }
5769        }
5770        else
5771        {
5772            // the following code is to determine if a new query is
5773
// called for. If the criteria is the same as the last
5774
// one, just return the collection.
5775

5776                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5777                                    if (!lastSorderItemsCriteria.equals(criteria))
5778            {
5779                collSorderItems = SorderItemPeer.doSelectJoinProject(criteria);
5780            }
5781        }
5782        lastSorderItemsCriteria = criteria;
5783
5784        return collSorderItems;
5785                }
5786                  
5787                    
5788                    
5789                                
5790                                                              
5791                                        
5792                    
5793                    
5794          
5795    /**
5796     * If this collection has already been initialized with
5797     * an identical criteria, it returns the collection.
5798     * Otherwise if this Project is new, it will return
5799     * an empty collection; or if this Project has previously
5800     * been saved, it will retrieve related SorderItems from storage.
5801     *
5802     * This method is protected by default in order to keep the public
5803     * api reasonable. You can provide public methods for those you
5804     * actually need in Project.
5805     */

5806    protected List JavaDoc getSorderItemsJoinCurrency(Criteria criteria)
5807        throws TorqueException
5808    {
5809                    if (collSorderItems == null)
5810        {
5811            if (isNew())
5812            {
5813               collSorderItems = new ArrayList JavaDoc();
5814            }
5815            else
5816            {
5817                              criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5818                              collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
5819            }
5820        }
5821        else
5822        {
5823            // the following code is to determine if a new query is
5824
// called for. If the criteria is the same as the last
5825
// one, just return the collection.
5826

5827                        criteria.add(SorderItemPeer.PROJECT_ID, getProjectId());
5828                                    if (!lastSorderItemsCriteria.equals(criteria))
5829            {
5830                collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria);
5831            }
5832        }
5833        lastSorderItemsCriteria = criteria;
5834
5835        return collSorderItems;
5836                }
5837                            
5838
5839
5840                          
5841            
5842          /**
5843     * Collection to store aggregation of collPaymentItems
5844     */

5845    protected List JavaDoc collPaymentItems;
5846
5847    /**
5848     * Temporary storage of collPaymentItems to save a possible db hit in
5849     * the event objects are add to the collection, but the
5850     * complete collection is never requested.
5851     */

5852    protected void initPaymentItems()
5853    {
5854        if (collPaymentItems == null)
5855        {
5856            collPaymentItems = new ArrayList JavaDoc();
5857        }
5858    }
5859
5860    /**
5861     * Method called to associate a PaymentItem object to this object
5862     * through the PaymentItem foreign key attribute
5863     *
5864     * @param l PaymentItem
5865     * @throws TorqueException
5866     */

5867    public void addPaymentItem(PaymentItem l) throws TorqueException
5868    {
5869        getPaymentItems().add(l);
5870        l.setProject((Project) this);
5871    }
5872
5873    /**
5874     * The criteria used to select the current contents of collPaymentItems
5875     */

5876    private Criteria lastPaymentItemsCriteria = null;
5877      
5878    /**
5879     * If this collection has already been initialized, returns
5880     * the collection. Otherwise returns the results of
5881     * getPaymentItems(new Criteria())
5882     *
5883     * @throws TorqueException
5884     */

5885    public List JavaDoc getPaymentItems() throws TorqueException
5886    {
5887              if (collPaymentItems == null)
5888        {
5889            collPaymentItems = getPaymentItems(new Criteria(10));
5890        }
5891        return collPaymentItems;
5892          }
5893
5894    /**
5895     * If this collection has already been initialized with
5896     * an identical criteria, it returns the collection.
5897     * Otherwise if this Project has previously
5898     * been saved, it will retrieve related PaymentItems from storage.
5899     * If this Project is new, it will return
5900     * an empty collection or the current collection, the criteria
5901     * is ignored on a new object.
5902     *
5903     * @throws TorqueException
5904     */

5905    public List JavaDoc getPaymentItems(Criteria criteria) throws TorqueException
5906    {
5907              if (collPaymentItems == null)
5908        {
5909            if (isNew())
5910            {
5911               collPaymentItems = new ArrayList JavaDoc();
5912            }
5913            else
5914            {
5915                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId() );
5916                        collPaymentItems = PaymentItemPeer.doSelect(criteria);
5917            }
5918        }
5919        else
5920        {
5921            // criteria has no effect for a new object
5922
if (!isNew())
5923            {
5924                // the following code is to determine if a new query is
5925
// called for. If the criteria is the same as the last
5926
// one, just return the collection.
5927
criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
5928                            if (!lastPaymentItemsCriteria.equals(criteria))
5929                {
5930                    collPaymentItems = PaymentItemPeer.doSelect(criteria);
5931                }
5932            }
5933        }
5934        lastPaymentItemsCriteria = criteria;
5935
5936        return collPaymentItems;
5937          }
5938
5939    /**
5940     * If this collection has already been initialized, returns
5941     * the collection. Otherwise returns the results of
5942     * getPaymentItems(new Criteria(),Connection)
5943     * This method takes in the Connection also as input so that
5944     * referenced objects can also be obtained using a Connection
5945     * that is taken as input
5946     */

5947    public List JavaDoc getPaymentItems(Connection JavaDoc con) throws TorqueException
5948    {
5949              if (collPaymentItems == null)
5950        {
5951            collPaymentItems = getPaymentItems(new Criteria(10), con);
5952        }
5953        return collPaymentItems;
5954          }
5955
5956    /**
5957     * If this collection has already been initialized with
5958     * an identical criteria, it returns the collection.
5959     * Otherwise if this Project has previously
5960     * been saved, it will retrieve related PaymentItems from storage.
5961     * If this Project is new, it will return
5962     * an empty collection or the current collection, the criteria
5963     * is ignored on a new object.
5964     * This method takes in the Connection also as input so that
5965     * referenced objects can also be obtained using a Connection
5966     * that is taken as input
5967     */

5968    public List JavaDoc getPaymentItems(Criteria criteria, Connection JavaDoc con)
5969            throws TorqueException
5970    {
5971              if (collPaymentItems == null)
5972        {
5973            if (isNew())
5974            {
5975               collPaymentItems = new ArrayList JavaDoc();
5976            }
5977            else
5978            {
5979                         criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
5980                         collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
5981             }
5982         }
5983         else
5984         {
5985             // criteria has no effect for a new object
5986
if (!isNew())
5987             {
5988                 // the following code is to determine if a new query is
5989
// called for. If the criteria is the same as the last
5990
// one, just return the collection.
5991
criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
5992                             if (!lastPaymentItemsCriteria.equals(criteria))
5993                 {
5994                     collPaymentItems = PaymentItemPeer.doSelect(criteria, con);
5995                 }
5996             }
5997         }
5998         lastPaymentItemsCriteria = criteria;
5999
6000         return collPaymentItems;
6001           }
6002
6003                                                
6004              
6005                    
6006                    
6007                                
6008                                                              
6009                                        
6010                    
6011                    
6012          
6013    /**
6014     * If this collection has already been initialized with
6015     * an identical criteria, it returns the collection.
6016     * Otherwise if this Project is new, it will return
6017     * an empty collection; or if this Project has previously
6018     * been saved, it will retrieve related PaymentItems from storage.
6019     *
6020     * This method is protected by default in order to keep the public
6021     * api reasonable. You can provide public methods for those you
6022     * actually need in Project.
6023     */

6024    protected List JavaDoc getPaymentItemsJoinPayment(Criteria criteria)
6025        throws TorqueException
6026    {
6027                    if (collPaymentItems == null)
6028        {
6029            if (isNew())
6030            {
6031               collPaymentItems = new ArrayList JavaDoc();
6032            }
6033            else
6034            {
6035                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6036                              collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
6037            }
6038        }
6039        else
6040        {
6041            // the following code is to determine if a new query is
6042
// called for. If the criteria is the same as the last
6043
// one, just return the collection.
6044

6045                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6046                                    if (!lastPaymentItemsCriteria.equals(criteria))
6047            {
6048                collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria);
6049            }
6050        }
6051        lastPaymentItemsCriteria = criteria;
6052
6053        return collPaymentItems;
6054                }
6055                  
6056                    
6057                    
6058                                
6059                                                              
6060                                        
6061                    
6062                    
6063          
6064    /**
6065     * If this collection has already been initialized with
6066     * an identical criteria, it returns the collection.
6067     * Otherwise if this Project is new, it will return
6068     * an empty collection; or if this Project has previously
6069     * been saved, it will retrieve related PaymentItems from storage.
6070     *
6071     * This method is protected by default in order to keep the public
6072     * api reasonable. You can provide public methods for those you
6073     * actually need in Project.
6074     */

6075    protected List JavaDoc getPaymentItemsJoinSorder(Criteria criteria)
6076        throws TorqueException
6077    {
6078                    if (collPaymentItems == null)
6079        {
6080            if (isNew())
6081            {
6082               collPaymentItems = new ArrayList JavaDoc();
6083            }
6084            else
6085            {
6086                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6087                              collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
6088            }
6089        }
6090        else
6091        {
6092            // the following code is to determine if a new query is
6093
// called for. If the criteria is the same as the last
6094
// one, just return the collection.
6095

6096                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6097                                    if (!lastPaymentItemsCriteria.equals(criteria))
6098            {
6099                collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria);
6100            }
6101        }
6102        lastPaymentItemsCriteria = criteria;
6103
6104        return collPaymentItems;
6105                }
6106                  
6107                    
6108                    
6109                                
6110                                                              
6111                                        
6112                    
6113                    
6114          
6115    /**
6116     * If this collection has already been initialized with
6117     * an identical criteria, it returns the collection.
6118     * Otherwise if this Project is new, it will return
6119     * an empty collection; or if this Project has previously
6120     * been saved, it will retrieve related PaymentItems from storage.
6121     *
6122     * This method is protected by default in order to keep the public
6123     * api reasonable. You can provide public methods for those you
6124     * actually need in Project.
6125     */

6126    protected List JavaDoc getPaymentItemsJoinProduct(Criteria criteria)
6127        throws TorqueException
6128    {
6129                    if (collPaymentItems == null)
6130        {
6131            if (isNew())
6132            {
6133               collPaymentItems = new ArrayList JavaDoc();
6134            }
6135            else
6136            {
6137                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6138                              collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
6139            }
6140        }
6141        else
6142        {
6143            // the following code is to determine if a new query is
6144
// called for. If the criteria is the same as the last
6145
// one, just return the collection.
6146

6147                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6148                                    if (!lastPaymentItemsCriteria.equals(criteria))
6149            {
6150                collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria);
6151            }
6152        }
6153        lastPaymentItemsCriteria = criteria;
6154
6155        return collPaymentItems;
6156                }
6157                  
6158                    
6159                    
6160                                
6161                                                              
6162                                        
6163                    
6164                    
6165          
6166    /**
6167     * If this collection has already been initialized with
6168     * an identical criteria, it returns the collection.
6169     * Otherwise if this Project is new, it will return
6170     * an empty collection; or if this Project has previously
6171     * been saved, it will retrieve related PaymentItems from storage.
6172     *
6173     * This method is protected by default in order to keep the public
6174     * api reasonable. You can provide public methods for those you
6175     * actually need in Project.
6176     */

6177    protected List JavaDoc getPaymentItemsJoinCurrency(Criteria criteria)
6178        throws TorqueException
6179    {
6180                    if (collPaymentItems == null)
6181        {
6182            if (isNew())
6183            {
6184               collPaymentItems = new ArrayList JavaDoc();
6185            }
6186            else
6187            {
6188                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6189                              collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
6190            }
6191        }
6192        else
6193        {
6194            // the following code is to determine if a new query is
6195
// called for. If the criteria is the same as the last
6196
// one, just return the collection.
6197

6198                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6199                                    if (!lastPaymentItemsCriteria.equals(criteria))
6200            {
6201                collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria);
6202            }
6203        }
6204        lastPaymentItemsCriteria = criteria;
6205
6206        return collPaymentItems;
6207                }
6208                  
6209                    
6210                    
6211                                
6212                                                              
6213                                        
6214                    
6215                    
6216          
6217    /**
6218     * If this collection has already been initialized with
6219     * an identical criteria, it returns the collection.
6220     * Otherwise if this Project is new, it will return
6221     * an empty collection; or if this Project has previously
6222     * been saved, it will retrieve related PaymentItems from storage.
6223     *
6224     * This method is protected by default in order to keep the public
6225     * api reasonable. You can provide public methods for those you
6226     * actually need in Project.
6227     */

6228    protected List JavaDoc getPaymentItemsJoinCustomer(Criteria criteria)
6229        throws TorqueException
6230    {
6231                    if (collPaymentItems == null)
6232        {
6233            if (isNew())
6234            {
6235               collPaymentItems = new ArrayList JavaDoc();
6236            }
6237            else
6238            {
6239                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6240                              collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
6241            }
6242        }
6243        else
6244        {
6245            // the following code is to determine if a new query is
6246
// called for. If the criteria is the same as the last
6247
// one, just return the collection.
6248

6249                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6250                                    if (!lastPaymentItemsCriteria.equals(criteria))
6251            {
6252                collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria);
6253            }
6254        }
6255        lastPaymentItemsCriteria = criteria;
6256
6257        return collPaymentItems;
6258                }
6259                  
6260                    
6261                              
6262                                
6263                                                              
6264                                        
6265                    
6266                    
6267          
6268    /**
6269     * If this collection has already been initialized with
6270     * an identical criteria, it returns the collection.
6271     * Otherwise if this Project is new, it will return
6272     * an empty collection; or if this Project has previously
6273     * been saved, it will retrieve related PaymentItems from storage.
6274     *
6275     * This method is protected by default in order to keep the public
6276     * api reasonable. You can provide public methods for those you
6277     * actually need in Project.
6278     */

6279    protected List JavaDoc getPaymentItemsJoinProject(Criteria criteria)
6280        throws TorqueException
6281    {
6282                    if (collPaymentItems == null)
6283        {
6284            if (isNew())
6285            {
6286               collPaymentItems = new ArrayList JavaDoc();
6287            }
6288            else
6289            {
6290                              criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6291                              collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
6292            }
6293        }
6294        else
6295        {
6296            // the following code is to determine if a new query is
6297
// called for. If the criteria is the same as the last
6298
// one, just return the collection.
6299

6300                        criteria.add(PaymentItemPeer.PROJECT_ID, getProjectId());
6301                                    if (!lastPaymentItemsCriteria.equals(criteria))
6302            {
6303                collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria);
6304            }
6305        }
6306        lastPaymentItemsCriteria = criteria;
6307
6308        return collPaymentItems;
6309                }
6310                            
6311
6312
6313                          
6314            
6315          /**
6316     * Collection to store aggregation of collShipmentItems
6317     */

6318    protected List JavaDoc collShipmentItems;
6319
6320    /**
6321     * Temporary storage of collShipmentItems to save a possible db hit in
6322     * the event objects are add to the collection, but the
6323     * complete collection is never requested.
6324     */

6325    protected void initShipmentItems()
6326    {
6327        if (collShipmentItems == null)
6328        {
6329            collShipmentItems = new ArrayList JavaDoc();
6330        }
6331    }
6332
6333    /**
6334     * Method called to associate a ShipmentItem object to this object
6335     * through the ShipmentItem foreign key attribute
6336     *
6337     * @param l ShipmentItem
6338     * @throws TorqueException
6339     */

6340    public void addShipmentItem(ShipmentItem l) throws TorqueException
6341    {
6342        getShipmentItems().add(l);
6343        l.setProject((Project) this);
6344    }
6345
6346    /**
6347     * The criteria used to select the current contents of collShipmentItems
6348     */

6349    private Criteria lastShipmentItemsCriteria = null;
6350      
6351    /**
6352     * If this collection has already been initialized, returns
6353     * the collection. Otherwise returns the results of
6354     * getShipmentItems(new Criteria())
6355     *
6356     * @throws TorqueException
6357     */

6358    public List JavaDoc getShipmentItems() throws TorqueException
6359    {
6360              if (collShipmentItems == null)
6361        {
6362            collShipmentItems = getShipmentItems(new Criteria(10));
6363        }
6364        return collShipmentItems;
6365          }
6366
6367    /**
6368     * If this collection has already been initialized with
6369     * an identical criteria, it returns the collection.
6370     * Otherwise if this Project has previously
6371     * been saved, it will retrieve related ShipmentItems from storage.
6372     * If this Project is new, it will return
6373     * an empty collection or the current collection, the criteria
6374     * is ignored on a new object.
6375     *
6376     * @throws TorqueException
6377     */

6378    public List JavaDoc getShipmentItems(Criteria criteria) throws TorqueException
6379    {
6380              if (collShipmentItems == null)
6381        {
6382            if (isNew())
6383            {
6384               collShipmentItems = new ArrayList JavaDoc();
6385            }
6386            else
6387            {
6388                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId() );
6389                        collShipmentItems = ShipmentItemPeer.doSelect(criteria);
6390            }
6391        }
6392        else
6393        {
6394            // criteria has no effect for a new object
6395
if (!isNew())
6396            {
6397                // the following code is to determine if a new query is
6398
// called for. If the criteria is the same as the last
6399
// one, just return the collection.
6400
criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6401                            if (!lastShipmentItemsCriteria.equals(criteria))
6402                {
6403                    collShipmentItems = ShipmentItemPeer.doSelect(criteria);
6404                }
6405            }
6406        }
6407        lastShipmentItemsCriteria = criteria;
6408
6409        return collShipmentItems;
6410          }
6411
6412    /**
6413     * If this collection has already been initialized, returns
6414     * the collection. Otherwise returns the results of
6415     * getShipmentItems(new Criteria(),Connection)
6416     * This method takes in the Connection also as input so that
6417     * referenced objects can also be obtained using a Connection
6418     * that is taken as input
6419     */

6420    public List JavaDoc getShipmentItems(Connection JavaDoc con) throws TorqueException
6421    {
6422              if (collShipmentItems == null)
6423        {
6424            collShipmentItems = getShipmentItems(new Criteria(10), con);
6425        }
6426        return collShipmentItems;
6427          }
6428
6429    /**
6430     * If this collection has already been initialized with
6431     * an identical criteria, it returns the collection.
6432     * Otherwise if this Project has previously
6433     * been saved, it will retrieve related ShipmentItems from storage.
6434     * If this Project is new, it will return
6435     * an empty collection or the current collection, the criteria
6436     * is ignored on a new object.
6437     * This method takes in the Connection also as input so that
6438     * referenced objects can also be obtained using a Connection
6439     * that is taken as input
6440     */

6441    public List JavaDoc getShipmentItems(Criteria criteria, Connection JavaDoc con)
6442            throws TorqueException
6443    {
6444              if (collShipmentItems == null)
6445        {
6446            if (isNew())
6447            {
6448               collShipmentItems = new ArrayList JavaDoc();
6449            }
6450            else
6451            {
6452                         criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6453                         collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
6454             }
6455         }
6456         else
6457         {
6458             // criteria has no effect for a new object
6459
if (!isNew())
6460             {
6461                 // the following code is to determine if a new query is
6462
// called for. If the criteria is the same as the last
6463
// one, just return the collection.
6464
criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6465                             if (!lastShipmentItemsCriteria.equals(criteria))
6466                 {
6467                     collShipmentItems = ShipmentItemPeer.doSelect(criteria, con);
6468                 }
6469             }
6470         }
6471         lastShipmentItemsCriteria = criteria;
6472
6473         return collShipmentItems;
6474           }
6475
6476                                                
6477              
6478                    
6479                    
6480                                
6481                                                              
6482                                        
6483                    
6484                    
6485          
6486    /**
6487     * If this collection has already been initialized with
6488     * an identical criteria, it returns the collection.
6489     * Otherwise if this Project is new, it will return
6490     * an empty collection; or if this Project has previously
6491     * been saved, it will retrieve related ShipmentItems from storage.
6492     *
6493     * This method is protected by default in order to keep the public
6494     * api reasonable. You can provide public methods for those you
6495     * actually need in Project.
6496     */

6497    protected List JavaDoc getShipmentItemsJoinShipment(Criteria criteria)
6498        throws TorqueException
6499    {
6500                    if (collShipmentItems == null)
6501        {
6502            if (isNew())
6503            {
6504               collShipmentItems = new ArrayList JavaDoc();
6505            }
6506            else
6507            {
6508                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6509                              collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
6510            }
6511        }
6512        else
6513        {
6514            // the following code is to determine if a new query is
6515
// called for. If the criteria is the same as the last
6516
// one, just return the collection.
6517

6518                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6519                                    if (!lastShipmentItemsCriteria.equals(criteria))
6520            {
6521                collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria);
6522            }
6523        }
6524        lastShipmentItemsCriteria = criteria;
6525
6526        return collShipmentItems;
6527                }
6528                  
6529                    
6530                    
6531                                
6532                                                              
6533                                        
6534                    
6535                    
6536          
6537    /**
6538     * If this collection has already been initialized with
6539     * an identical criteria, it returns the collection.
6540     * Otherwise if this Project is new, it will return
6541     * an empty collection; or if this Project has previously
6542     * been saved, it will retrieve related ShipmentItems from storage.
6543     *
6544     * This method is protected by default in order to keep the public
6545     * api reasonable. You can provide public methods for those you
6546     * actually need in Project.
6547     */

6548    protected List JavaDoc getShipmentItemsJoinSorder(Criteria criteria)
6549        throws TorqueException
6550    {
6551                    if (collShipmentItems == null)
6552        {
6553            if (isNew())
6554            {
6555               collShipmentItems = new ArrayList JavaDoc();
6556            }
6557            else
6558            {
6559                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6560                              collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
6561            }
6562        }
6563        else
6564        {
6565            // the following code is to determine if a new query is
6566
// called for. If the criteria is the same as the last
6567
// one, just return the collection.
6568

6569                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6570                                    if (!lastShipmentItemsCriteria.equals(criteria))
6571            {
6572                collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria);
6573            }
6574        }
6575        lastShipmentItemsCriteria = criteria;
6576
6577        return collShipmentItems;
6578                }
6579                  
6580                    
6581                    
6582                                
6583                                                              
6584                                        
6585                    
6586                    
6587          
6588    /**
6589     * If this collection has already been initialized with
6590     * an identical criteria, it returns the collection.
6591     * Otherwise if this Project is new, it will return
6592     * an empty collection; or if this Project has previously
6593     * been saved, it will retrieve related ShipmentItems from storage.
6594     *
6595     * This method is protected by default in order to keep the public
6596     * api reasonable. You can provide public methods for those you
6597     * actually need in Project.
6598     */

6599    protected List JavaDoc getShipmentItemsJoinProduct(Criteria criteria)
6600        throws TorqueException
6601    {
6602                    if (collShipmentItems == null)
6603        {
6604            if (isNew())
6605            {
6606               collShipmentItems = new ArrayList JavaDoc();
6607            }
6608            else
6609            {
6610                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6611                              collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
6612            }
6613        }
6614        else
6615        {
6616            // the following code is to determine if a new query is
6617
// called for. If the criteria is the same as the last
6618
// one, just return the collection.
6619

6620                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6621                                    if (!lastShipmentItemsCriteria.equals(criteria))
6622            {
6623                collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria);
6624            }
6625        }
6626        lastShipmentItemsCriteria = criteria;
6627
6628        return collShipmentItems;
6629                }
6630                  
6631                    
6632                    
6633                                            
6634                                                                          
6635                                        
6636                    
6637                    
6638          
6639    /**
6640     * If this collection has already been initialized with
6641     * an identical criteria, it returns the collection.
6642     * Otherwise if this Project is new, it will return
6643     * an empty collection; or if this Project has previously
6644     * been saved, it will retrieve related ShipmentItems from storage.
6645     *
6646     * This method is protected by default in order to keep the public
6647     * api reasonable. You can provide public methods for those you
6648     * actually need in Project.
6649     */

6650    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
6651        throws TorqueException
6652    {
6653                    if (collShipmentItems == null)
6654        {
6655            if (isNew())
6656            {
6657               collShipmentItems = new ArrayList JavaDoc();
6658            }
6659            else
6660            {
6661                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6662                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
6663            }
6664        }
6665        else
6666        {
6667            // the following code is to determine if a new query is
6668
// called for. If the criteria is the same as the last
6669
// one, just return the collection.
6670

6671                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6672                                    if (!lastShipmentItemsCriteria.equals(criteria))
6673            {
6674                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
6675            }
6676        }
6677        lastShipmentItemsCriteria = criteria;
6678
6679        return collShipmentItems;
6680                }
6681                  
6682                    
6683                    
6684                                            
6685                                                                          
6686                                        
6687                    
6688                    
6689          
6690    /**
6691     * If this collection has already been initialized with
6692     * an identical criteria, it returns the collection.
6693     * Otherwise if this Project is new, it will return
6694     * an empty collection; or if this Project has previously
6695     * been saved, it will retrieve related ShipmentItems from storage.
6696     *
6697     * This method is protected by default in order to keep the public
6698     * api reasonable. You can provide public methods for those you
6699     * actually need in Project.
6700     */

6701    protected List JavaDoc getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
6702        throws TorqueException
6703    {
6704                    if (collShipmentItems == null)
6705        {
6706            if (isNew())
6707            {
6708               collShipmentItems = new ArrayList JavaDoc();
6709            }
6710            else
6711            {
6712                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6713                              collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
6714            }
6715        }
6716        else
6717        {
6718            // the following code is to determine if a new query is
6719
// called for. If the criteria is the same as the last
6720
// one, just return the collection.
6721

6722                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6723                                    if (!lastShipmentItemsCriteria.equals(criteria))
6724            {
6725                collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
6726            }
6727        }
6728        lastShipmentItemsCriteria = criteria;
6729
6730        return collShipmentItems;
6731                }
6732                  
6733                    
6734                              
6735                                
6736                                                              
6737                                        
6738                    
6739                    
6740          
6741    /**
6742     * If this collection has already been initialized with
6743     * an identical criteria, it returns the collection.
6744     * Otherwise if this Project is new, it will return
6745     * an empty collection; or if this Project has previously
6746     * been saved, it will retrieve related ShipmentItems from storage.
6747     *
6748     * This method is protected by default in order to keep the public
6749     * api reasonable. You can provide public methods for those you
6750     * actually need in Project.
6751     */

6752    protected List JavaDoc getShipmentItemsJoinProject(Criteria criteria)
6753        throws TorqueException
6754    {
6755                    if (collShipmentItems == null)
6756        {
6757            if (isNew())
6758            {
6759               collShipmentItems = new ArrayList JavaDoc();
6760            }
6761            else
6762            {
6763                              criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6764                              collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
6765            }
6766        }
6767        else
6768        {
6769            // the following code is to determine if a new query is
6770
// called for. If the criteria is the same as the last
6771
// one, just return the collection.
6772

6773                        criteria.add(ShipmentItemPeer.PROJECT_ID, getProjectId());
6774                                    if (!lastShipmentItemsCriteria.equals(criteria))
6775            {
6776                collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria);
6777            }
6778        }
6779        lastShipmentItemsCriteria = criteria;
6780
6781        return collShipmentItems;
6782                }
6783                            
6784
6785
6786                          
6787            
6788          /**
6789     * Collection to store aggregation of collServiceItems
6790     */

6791    protected List JavaDoc collServiceItems;
6792
6793    /**
6794     * Temporary storage of collServiceItems to save a possible db hit in
6795     * the event objects are add to the collection, but the
6796     * complete collection is never requested.
6797     */

6798    protected void initServiceItems()
6799    {
6800        if (collServiceItems == null)
6801        {
6802            collServiceItems = new ArrayList JavaDoc();
6803        }
6804    }
6805
6806    /**
6807     * Method called to associate a ServiceItem object to this object
6808     * through the ServiceItem foreign key attribute
6809     *
6810     * @param l ServiceItem
6811     * @throws TorqueException
6812     */

6813    public void addServiceItem(ServiceItem l) throws TorqueException
6814    {
6815        getServiceItems().add(l);
6816        l.setProject((Project) this);
6817    }
6818
6819    /**
6820     * The criteria used to select the current contents of collServiceItems
6821     */

6822    private Criteria lastServiceItemsCriteria = null;
6823      
6824    /**
6825     * If this collection has already been initialized, returns
6826     * the collection. Otherwise returns the results of
6827     * getServiceItems(new Criteria())
6828     *
6829     * @throws TorqueException
6830     */

6831    public List JavaDoc getServiceItems() throws TorqueException
6832    {
6833              if (collServiceItems == null)
6834        {
6835            collServiceItems = getServiceItems(new Criteria(10));
6836        }
6837        return collServiceItems;
6838          }
6839
6840    /**
6841     * If this collection has already been initialized with
6842     * an identical criteria, it returns the collection.
6843     * Otherwise if this Project has previously
6844     * been saved, it will retrieve related ServiceItems from storage.
6845     * If this Project is new, it will return
6846     * an empty collection or the current collection, the criteria
6847     * is ignored on a new object.
6848     *
6849     * @throws TorqueException
6850     */

6851    public List JavaDoc getServiceItems(Criteria criteria) throws TorqueException
6852    {
6853              if (collServiceItems == null)
6854        {
6855            if (isNew())
6856            {
6857               collServiceItems = new ArrayList JavaDoc();
6858            }
6859            else
6860            {
6861                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId() );
6862                        collServiceItems = ServiceItemPeer.doSelect(criteria);
6863            }
6864        }
6865        else
6866        {
6867            // criteria has no effect for a new object
6868
if (!isNew())
6869            {
6870                // the following code is to determine if a new query is
6871
// called for. If the criteria is the same as the last
6872
// one, just return the collection.
6873
criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
6874                            if (!lastServiceItemsCriteria.equals(criteria))
6875                {
6876                    collServiceItems = ServiceItemPeer.doSelect(criteria);
6877                }
6878            }
6879        }
6880        lastServiceItemsCriteria = criteria;
6881
6882        return collServiceItems;
6883          }
6884
6885    /**
6886     * If this collection has already been initialized, returns
6887     * the collection. Otherwise returns the results of
6888     * getServiceItems(new Criteria(),Connection)
6889     * This method takes in the Connection also as input so that
6890     * referenced objects can also be obtained using a Connection
6891     * that is taken as input
6892     */

6893    public List JavaDoc getServiceItems(Connection JavaDoc con) throws TorqueException
6894    {
6895              if (collServiceItems == null)
6896        {
6897            collServiceItems = getServiceItems(new Criteria(10), con);
6898        }
6899        return collServiceItems;
6900          }
6901
6902    /**
6903     * If this collection has already been initialized with
6904     * an identical criteria, it returns the collection.
6905     * Otherwise if this Project has previously
6906     * been saved, it will retrieve related ServiceItems from storage.
6907     * If this Project is new, it will return
6908     * an empty collection or the current collection, the criteria
6909     * is ignored on a new object.
6910     * This method takes in the Connection also as input so that
6911     * referenced objects can also be obtained using a Connection
6912     * that is taken as input
6913     */

6914    public List JavaDoc getServiceItems(Criteria criteria, Connection JavaDoc con)
6915            throws TorqueException
6916    {
6917              if (collServiceItems == null)
6918        {
6919            if (isNew())
6920            {
6921               collServiceItems = new ArrayList JavaDoc();
6922            }
6923            else
6924            {
6925                         criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
6926                         collServiceItems = ServiceItemPeer.doSelect(criteria, con);
6927             }
6928         }
6929         else
6930         {
6931             // criteria has no effect for a new object
6932
if (!isNew())
6933             {
6934                 // the following code is to determine if a new query is
6935
// called for. If the criteria is the same as the last
6936
// one, just return the collection.
6937
criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
6938                             if (!lastServiceItemsCriteria.equals(criteria))
6939                 {
6940                     collServiceItems = ServiceItemPeer.doSelect(criteria, con);
6941                 }
6942             }
6943         }
6944         lastServiceItemsCriteria = criteria;
6945
6946         return collServiceItems;
6947           }
6948
6949                                                
6950              
6951                    
6952                    
6953                                
6954                                                              
6955                                        
6956                    
6957                    
6958          
6959    /**
6960     * If this collection has already been initialized with
6961     * an identical criteria, it returns the collection.
6962     * Otherwise if this Project is new, it will return
6963     * an empty collection; or if this Project has previously
6964     * been saved, it will retrieve related ServiceItems from storage.
6965     *
6966     * This method is protected by default in order to keep the public
6967     * api reasonable. You can provide public methods for those you
6968     * actually need in Project.
6969     */

6970    protected List JavaDoc getServiceItemsJoinService(Criteria criteria)
6971        throws TorqueException
6972    {
6973                    if (collServiceItems == null)
6974        {
6975            if (isNew())
6976            {
6977               collServiceItems = new ArrayList JavaDoc();
6978            }
6979            else
6980            {
6981                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
6982                              collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
6983            }
6984        }
6985        else
6986        {
6987            // the following code is to determine if a new query is
6988
// called for. If the criteria is the same as the last
6989
// one, just return the collection.
6990

6991                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
6992                                    if (!lastServiceItemsCriteria.equals(criteria))
6993            {
6994                collServiceItems = ServiceItemPeer.doSelectJoinService(criteria);
6995            }
6996        }
6997        lastServiceItemsCriteria = criteria;
6998
6999        return collServiceItems;
7000                }
7001                  
7002                    
7003                    
7004                                
7005                                                              
7006                                        
7007                    
7008                    
7009          
7010    /**
7011     * If this collection has already been initialized with
7012     * an identical criteria, it returns the collection.
7013     * Otherwise if this Project is new, it will return
7014     * an empty collection; or if this Project has previously
7015     * been saved, it will retrieve related ServiceItems from storage.
7016     *
7017     * This method is protected by default in order to keep the public
7018     * api reasonable. You can provide public methods for those you
7019     * actually need in Project.
7020     */

7021    protected List JavaDoc getServiceItemsJoinSorder(Criteria criteria)
7022        throws TorqueException
7023    {
7024                    if (collServiceItems == null)
7025        {
7026            if (isNew())
7027            {
7028               collServiceItems = new ArrayList JavaDoc();
7029            }
7030            else
7031            {
7032                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7033                              collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
7034            }
7035        }
7036        else
7037        {
7038            // the following code is to determine if a new query is
7039
// called for. If the criteria is the same as the last
7040
// one, just return the collection.
7041

7042                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7043                                    if (!lastServiceItemsCriteria.equals(criteria))
7044            {
7045                collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria);
7046            }
7047        }
7048        lastServiceItemsCriteria = criteria;
7049
7050        return collServiceItems;
7051                }
7052                  
7053                    
7054                    
7055                                
7056                                                              
7057                                        
7058                    
7059                    
7060          
7061    /**
7062     * If this collection has already been initialized with
7063     * an identical criteria, it returns the collection.
7064     * Otherwise if this Project is new, it will return
7065     * an empty collection; or if this Project has previously
7066     * been saved, it will retrieve related ServiceItems from storage.
7067     *
7068     * This method is protected by default in order to keep the public
7069     * api reasonable. You can provide public methods for those you
7070     * actually need in Project.
7071     */

7072    protected List JavaDoc getServiceItemsJoinProduct(Criteria criteria)
7073        throws TorqueException
7074    {
7075                    if (collServiceItems == null)
7076        {
7077            if (isNew())
7078            {
7079               collServiceItems = new ArrayList JavaDoc();
7080            }
7081            else
7082            {
7083                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7084                              collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
7085            }
7086        }
7087        else
7088        {
7089            // the following code is to determine if a new query is
7090
// called for. If the criteria is the same as the last
7091
// one, just return the collection.
7092

7093                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7094                                    if (!lastServiceItemsCriteria.equals(criteria))
7095            {
7096                collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria);
7097            }
7098        }
7099        lastServiceItemsCriteria = criteria;
7100
7101        return collServiceItems;
7102                }
7103                  
7104                    
7105                    
7106                                            
7107                                                                          
7108                                        
7109                    
7110                    
7111          
7112    /**
7113     * If this collection has already been initialized with
7114     * an identical criteria, it returns the collection.
7115     * Otherwise if this Project is new, it will return
7116     * an empty collection; or if this Project has previously
7117     * been saved, it will retrieve related ServiceItems from storage.
7118     *
7119     * This method is protected by default in order to keep the public
7120     * api reasonable. You can provide public methods for those you
7121     * actually need in Project.
7122     */

7123    protected List JavaDoc getServiceItemsJoinCustomerRelatedByCustomerId(Criteria criteria)
7124        throws TorqueException
7125    {
7126                    if (collServiceItems == null)
7127        {
7128            if (isNew())
7129            {
7130               collServiceItems = new ArrayList JavaDoc();
7131            }
7132            else
7133            {
7134                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7135                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
7136            }
7137        }
7138        else
7139        {
7140            // the following code is to determine if a new query is
7141
// called for. If the criteria is the same as the last
7142
// one, just return the collection.
7143

7144                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7145                                    if (!lastServiceItemsCriteria.equals(criteria))
7146            {
7147                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria);
7148            }
7149        }
7150        lastServiceItemsCriteria = criteria;
7151
7152        return collServiceItems;
7153                }
7154                  
7155                    
7156                    
7157                                            
7158                                                                          
7159                                        
7160                    
7161                    
7162          
7163    /**
7164     * If this collection has already been initialized with
7165     * an identical criteria, it returns the collection.
7166     * Otherwise if this Project is new, it will return
7167     * an empty collection; or if this Project has previously
7168     * been saved, it will retrieve related ServiceItems from storage.
7169     *
7170     * This method is protected by default in order to keep the public
7171     * api reasonable. You can provide public methods for those you
7172     * actually need in Project.
7173     */

7174    protected List JavaDoc getServiceItemsJoinCustomerRelatedByRecipientId(Criteria criteria)
7175        throws TorqueException
7176    {
7177                    if (collServiceItems == null)
7178        {
7179            if (isNew())
7180            {
7181               collServiceItems = new ArrayList JavaDoc();
7182            }
7183            else
7184            {
7185                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7186                              collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
7187            }
7188        }
7189        else
7190        {
7191            // the following code is to determine if a new query is
7192
// called for. If the criteria is the same as the last
7193
// one, just return the collection.
7194

7195                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7196                                    if (!lastServiceItemsCriteria.equals(criteria))
7197            {
7198                collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria);
7199            }
7200        }
7201        lastServiceItemsCriteria = criteria;
7202
7203        return collServiceItems;
7204                }
7205                  
7206                    
7207                              
7208                                
7209                                                              
7210                                        
7211                    
7212                    
7213          
7214    /**
7215     * If this collection has already been initialized with
7216     * an identical criteria, it returns the collection.
7217     * Otherwise if this Project is new, it will return
7218     * an empty collection; or if this Project has previously
7219     * been saved, it will retrieve related ServiceItems from storage.
7220     *
7221     * This method is protected by default in order to keep the public
7222     * api reasonable. You can provide public methods for those you
7223     * actually need in Project.
7224     */

7225    protected List JavaDoc getServiceItemsJoinProject(Criteria criteria)
7226        throws TorqueException
7227    {
7228                    if (collServiceItems == null)
7229        {
7230            if (isNew())
7231            {
7232               collServiceItems = new ArrayList JavaDoc();
7233            }
7234            else
7235            {
7236                              criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7237                              collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
7238            }
7239        }
7240        else
7241        {
7242            // the following code is to determine if a new query is
7243
// called for. If the criteria is the same as the last
7244
// one, just return the collection.
7245

7246                        criteria.add(ServiceItemPeer.PROJECT_ID, getProjectId());
7247                                    if (!lastServiceItemsCriteria.equals(criteria))
7248            {
7249                collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria);
7250            }
7251        }
7252        lastServiceItemsCriteria = criteria;
7253
7254        return collServiceItems;
7255                }
7256                            
7257
7258
7259          
7260    private static List JavaDoc fieldNames = null;
7261
7262    /**
7263     * Generate a list of field names.
7264     *
7265     * @return a list of field names
7266     */

7267    public static synchronized List JavaDoc getFieldNames()
7268    {
7269        if (fieldNames == null)
7270        {
7271            fieldNames = new ArrayList JavaDoc();
7272              fieldNames.add("ProjectId");
7273              fieldNames.add("ProjectCode");
7274              fieldNames.add("Status");
7275              fieldNames.add("Priority");
7276              fieldNames.add("ProjectCatId");
7277              fieldNames.add("ProjectName");
7278              fieldNames.add("StartDate");
7279              fieldNames.add("EndDate");
7280              fieldNames.add("Expenses");
7281              fieldNames.add("Revenues");
7282              fieldNames.add("Custom1");
7283              fieldNames.add("Custom2");
7284              fieldNames.add("Custom3");
7285              fieldNames.add("Custom4");
7286              fieldNames.add("Custom5");
7287              fieldNames.add("Custom6");
7288              fieldNames.add("Notes");
7289              fieldNames.add("Created");
7290              fieldNames.add("Modified");
7291              fieldNames.add("CreatedBy");
7292              fieldNames.add("ModifiedBy");
7293              fieldNames = Collections.unmodifiableList(fieldNames);
7294        }
7295        return fieldNames;
7296    }
7297
7298    /**
7299     * Retrieves a field from the object by name passed in as a String.
7300     *
7301     * @param name field name
7302     * @return value
7303     */

7304    public Object JavaDoc getByName(String JavaDoc name)
7305    {
7306          if (name.equals("ProjectId"))
7307        {
7308                return new Integer JavaDoc(getProjectId());
7309            }
7310          if (name.equals("ProjectCode"))
7311        {
7312                return getProjectCode();
7313            }
7314          if (name.equals("Status"))
7315        {
7316                return new Integer JavaDoc(getStatus());
7317            }
7318          if (name.equals("Priority"))
7319        {
7320                return new Integer JavaDoc(getPriority());
7321            }
7322          if (name.equals("ProjectCatId"))
7323        {
7324                return new Integer JavaDoc(getProjectCatId());
7325            }
7326          if (name.equals("ProjectName"))
7327        {
7328                return getProjectName();
7329            }
7330          if (name.equals("StartDate"))
7331        {
7332                return getStartDate();
7333            }
7334          if (name.equals("EndDate"))
7335        {
7336                return getEndDate();
7337            }
7338          if (name.equals("Expenses"))
7339        {
7340                return getExpenses();
7341            }
7342          if (name.equals("Revenues"))
7343        {
7344                return getRevenues();
7345            }
7346          if (name.equals("Custom1"))
7347        {
7348                return getCustom1();
7349            }
7350          if (name.equals("Custom2"))
7351        {
7352                return getCustom2();
7353            }
7354          if (name.equals("Custom3"))
7355        {
7356                return getCustom3();
7357            }
7358          if (name.equals("Custom4"))
7359        {
7360                return getCustom4();
7361            }
7362          if (name.equals("Custom5"))
7363        {
7364                return getCustom5();
7365            }
7366          if (name.equals("Custom6"))
7367        {
7368                return getCustom6();
7369            }
7370          if (name.equals("Notes"))
7371        {
7372                return getNotes();
7373            }
7374          if (name.equals("Created"))
7375        {
7376                return getCreated();
7377            }
7378          if (name.equals("Modified"))
7379        {
7380                return getModified();
7381            }
7382          if (name.equals("CreatedBy"))
7383        {
7384                return getCreatedBy();
7385            }
7386          if (name.equals("ModifiedBy"))
7387        {
7388                return getModifiedBy();
7389            }
7390          return null;
7391    }
7392    
7393    /**
7394     * Retrieves a field from the object by name passed in
7395     * as a String. The String must be one of the static
7396     * Strings defined in this Class' Peer.
7397     *
7398     * @param name peer name
7399     * @return value
7400     */

7401    public Object JavaDoc getByPeerName(String JavaDoc name)
7402    {
7403          if (name.equals(ProjectPeer.PROJECT_ID))
7404        {
7405                return new Integer JavaDoc(getProjectId());
7406            }
7407          if (name.equals(ProjectPeer.PROJECT_CODE))
7408        {
7409                return getProjectCode();
7410            }
7411          if (name.equals(ProjectPeer.STATUS))
7412        {
7413                return new Integer JavaDoc(getStatus());
7414            }
7415          if (name.equals(ProjectPeer.PRIORITY))
7416        {
7417                return new Integer JavaDoc(getPriority());
7418            }
7419          if (name.equals(ProjectPeer.PROJECT_CAT_ID))
7420        {
7421                return new Integer JavaDoc(getProjectCatId());
7422            }
7423          if (name.equals(ProjectPeer.PROJECT_NAME))
7424        {
7425                return getProjectName();
7426            }
7427          if (name.equals(ProjectPeer.START_DATE))
7428        {
7429                return getStartDate();
7430            }
7431          if (name.equals(ProjectPeer.END_DATE))
7432        {
7433                return getEndDate();
7434            }
7435          if (name.equals(ProjectPeer.EXPENSES))
7436        {
7437                return getExpenses();
7438            }
7439          if (name.equals(ProjectPeer.REVENUES))
7440        {
7441                return getRevenues();
7442            }
7443          if (name.equals(ProjectPeer.CUSTOM_1))
7444        {
7445                return getCustom1();
7446            }
7447          if (name.equals(ProjectPeer.CUSTOM_2))
7448        {
7449                return getCustom2();
7450            }
7451          if (name.equals(ProjectPeer.CUSTOM_3))
7452        {
7453                return getCustom3();
7454            }
7455          if (name.equals(ProjectPeer.CUSTOM_4))
7456        {
7457                return getCustom4();
7458            }
7459          if (name.equals(ProjectPeer.CUSTOM_5))
7460        {
7461                return getCustom5();
7462            }
7463          if (name.equals(ProjectPeer.CUSTOM_6))
7464        {
7465                return getCustom6();
7466            }
7467          if (name.equals(ProjectPeer.NOTES))
7468        {
7469                return getNotes();
7470            }
7471          if (name.equals(ProjectPeer.CREATED))
7472        {
7473                return getCreated();
7474            }
7475          if (name.equals(ProjectPeer.MODIFIED))
7476        {
7477                return getModified();
7478            }
7479          if (name.equals(ProjectPeer.CREATED_BY))
7480        {
7481                return getCreatedBy();
7482            }
7483          if (name.equals(ProjectPeer.MODIFIED_BY))
7484        {
7485                return getModifiedBy();
7486            }
7487          return null;
7488    }
7489
7490    /**
7491     * Retrieves a field from the object by Position as specified
7492     * in the xml schema. Zero-based.
7493     *
7494     * @param pos position in xml schema
7495     * @return value
7496     */

7497    public Object JavaDoc getByPosition(int pos)
7498    {
7499            if (pos == 0)
7500        {
7501                return new Integer JavaDoc(getProjectId());
7502            }
7503              if (pos == 1)
7504        {
7505                return getProjectCode();
7506            }
7507              if (pos == 2)
7508        {
7509                return new Integer JavaDoc(getStatus());
7510            }
7511              if (pos == 3)
7512        {
7513                return new Integer JavaDoc(getPriority());
7514            }
7515              if (pos == 4)
7516        {
7517                return new Integer JavaDoc(getProjectCatId());
7518            }
7519              if (pos == 5)
7520        {
7521                return getProjectName();
7522            }
7523              if (pos == 6)
7524        {
7525                return getStartDate();
7526            }
7527              if (pos == 7)
7528        {
7529                return getEndDate();
7530            }
7531              if (pos == 8)
7532        {
7533                return getExpenses();
7534            }
7535              if (pos == 9)
7536        {
7537                return getRevenues();
7538            }
7539              if (pos == 10)
7540        {
7541                return getCustom1();
7542            }
7543              if (pos == 11)
7544        {
7545                return getCustom2();
7546            }
7547              if (pos == 12)
7548        {
7549                return getCustom3();
7550            }
7551              if (pos == 13)
7552        {
7553                return getCustom4();
7554            }
7555              if (pos == 14)
7556        {
7557                return getCustom5();
7558            }
7559              if (pos == 15)
7560        {
7561                return getCustom6();
7562            }
7563              if (pos == 16)
7564        {
7565                return getNotes();
7566            }
7567              if (pos == 17)
7568        {
7569                return getCreated();
7570            }
7571              if (pos == 18)
7572        {
7573                return getModified();
7574            }
7575              if (pos == 19)
7576        {
7577                return getCreatedBy();
7578            }
7579              if (pos == 20)
7580        {
7581                return getModifiedBy();
7582            }
7583              return null;
7584    }
7585     
7586    /**
7587     * Stores the object in the database. If the object is new,
7588     * it inserts it; otherwise an update is performed.
7589     *
7590     * @throws Exception
7591     */

7592    public void save() throws Exception JavaDoc
7593    {
7594          save(ProjectPeer.getMapBuilder()
7595                .getDatabaseMap().getName());
7596      }
7597
7598    /**
7599     * Stores the object in the database. If the object is new,
7600     * it inserts it; otherwise an update is performed.
7601       * Note: this code is here because the method body is
7602     * auto-generated conditionally and therefore needs to be
7603     * in this file instead of in the super class, BaseObject.
7604       *
7605     * @param dbName
7606     * @throws TorqueException
7607     */

7608    public void save(String JavaDoc dbName) throws TorqueException
7609    {
7610        Connection JavaDoc con = null;
7611          try
7612        {
7613            con = Transaction.begin(dbName);
7614            save(con);
7615            Transaction.commit(con);
7616        }
7617        catch(TorqueException e)
7618        {
7619            Transaction.safeRollback(con);
7620            throw e;
7621        }
7622      }
7623
7624      /** flag to prevent endless save loop, if this object is referenced
7625        by another object which falls in this transaction. */

7626    private boolean alreadyInSave = false;
7627      /**
7628     * Stores the object in the database. If the object is new,
7629     * it inserts it; otherwise an update is performed. This method
7630     * is meant to be used as part of a transaction, otherwise use
7631     * the save() method and the connection details will be handled
7632     * internally
7633     *
7634     * @param con
7635     * @throws TorqueException
7636     */

7637    public void save(Connection JavaDoc con) throws TorqueException
7638    {
7639          if (!alreadyInSave)
7640        {
7641            alreadyInSave = true;
7642
7643
7644  
7645            // If this object has been modified, then save it to the database.
7646
if (isModified())
7647            {
7648                if (isNew())
7649                {
7650                    ProjectPeer.doInsert((Project) this, con);
7651                    setNew(false);
7652                }
7653                else
7654                {
7655                    ProjectPeer.doUpdate((Project) this, con);
7656                }
7657            }
7658
7659                                      
7660                
7661                    if (collSorders != null)
7662            {
7663                for (int i = 0; i < collSorders.size(); i++)
7664                {
7665                    ((Sorder) collSorders.get(i)).save(con);
7666                }
7667            }
7668                                                  
7669                
7670                    if (collPayments != null)
7671            {
7672                for (int i = 0; i < collPayments.size(); i++)
7673                {
7674                    ((Payment) collPayments.get(i)).save(con);
7675                }
7676            }
7677                                                  
7678                
7679                    if (collServices != null)
7680            {
7681                for (int i = 0; i < collServices.size(); i++)
7682                {
7683                    ((Service) collServices.get(i)).save(con);
7684                }
7685            }
7686                                                  
7687                
7688                    if (collShipments != null)
7689            {
7690                for (int i = 0; i < collShipments.size(); i++)
7691                {
7692                    ((Shipment) collShipments.get(i)).save(con);
7693                }
7694            }
7695                                                  
7696                
7697                    if (collPrintSubscriptions != null)
7698            {
7699                for (int i = 0; i < collPrintSubscriptions.size(); i++)
7700                {
7701                    ((PrintSubscription) collPrintSubscriptions.get(i)).save(con);
7702                }
7703            }
7704                                                  
7705                
7706                    if (collOnlineSubscriptions != null)
7707            {
7708                for (int i = 0; i < collOnlineSubscriptions.size(); i++)
7709                {
7710                    ((OnlineSubscription) collOnlineSubscriptions.get(i)).save(con);
7711                }
7712            }
7713                                                  
7714                
7715                    if (collInboxEvents != null)
7716            {
7717                for (int i = 0; i < collInboxEvents.size(); i++)
7718                {
7719                    ((InboxEvent) collInboxEvents.get(i)).save(con);
7720                }
7721            }
7722                                                  
7723                
7724                    if (collOutboxEvents != null)
7725            {
7726                for (int i = 0; i < collOutboxEvents.size(); i++)
7727                {
7728                    ((OutboxEvent) collOutboxEvents.get(i)).save(con);
7729                }
7730            }
7731                                                  
7732                
7733                    if (collNewsSubscriptions != null)
7734            {
7735                for (int i = 0; i < collNewsSubscriptions.size(); i++)
7736                {
7737                    ((NewsSubscription) collNewsSubscriptions.get(i)).save(con);
7738                }
7739            }
7740                                                            
7741                
7742                    if (collNewslettersRelatedByProjectId != null)
7743            {
7744                for (int i = 0; i < collNewslettersRelatedByProjectId.size(); i++)
7745                {
7746                    ((Newsletter) collNewslettersRelatedByProjectId.get(i)).save(con);
7747                }
7748            }
7749                                                            
7750                
7751                    if (collNewslettersRelatedByRelProjectId != null)
7752            {
7753                for (int i = 0; i < collNewslettersRelatedByRelProjectId.size(); i++)
7754                {
7755                    ((Newsletter) collNewslettersRelatedByRelProjectId.get(i)).save(con);
7756                }
7757            }
7758                                                  
7759                
7760                    if (collSorderItems != null)
7761            {
7762                for (int i = 0; i < collSorderItems.size(); i++)
7763                {
7764                    ((SorderItem) collSorderItems.get(i)).save(con);
7765                }
7766            }
7767                                                  
7768                
7769                    if (collPaymentItems != null)
7770            {
7771                for (int i = 0; i < collPaymentItems.size(); i++)
7772                {
7773                    ((PaymentItem) collPaymentItems.get(i)).save(con);
7774                }
7775            }
7776                                                  
7777                
7778                    if (collShipmentItems != null)
7779            {
7780                for (int i = 0; i < collShipmentItems.size(); i++)
7781                {
7782                    ((ShipmentItem) collShipmentItems.get(i)).save(con);
7783                }
7784            }
7785                                                  
7786                
7787                    if (collServiceItems != null)
7788            {
7789                for (int i = 0; i < collServiceItems.size(); i++)
7790                {
7791                    ((ServiceItem) collServiceItems.get(i)).save(con);
7792                }
7793            }
7794                                  alreadyInSave = false;
7795        }
7796      }
7797
7798                        
7799      /**
7800     * Set the PrimaryKey using ObjectKey.
7801     *
7802     * @param key projectId ObjectKey
7803     */

7804    public void setPrimaryKey(ObjectKey key)
7805        throws TorqueException
7806    {
7807            setProjectId(((NumberKey) key).intValue());
7808        }
7809
7810    /**
7811     * Set the PrimaryKey using a String.
7812     *
7813     * @param key
7814     */

7815    public void setPrimaryKey(String JavaDoc key) throws TorqueException
7816    {
7817            setProjectId(Integer.parseInt(key));
7818        }
7819
7820  
7821    /**
7822     * returns an id that differentiates this object from others
7823     * of its class.
7824     */

7825    public ObjectKey getPrimaryKey()
7826    {
7827          return SimpleKey.keyFor(getProjectId());
7828      }
7829 
7830    /**
7831     * get an id that differentiates this object from others
7832     * of its class.
7833     */

7834    public String JavaDoc getQueryKey()
7835    {
7836        if (getPrimaryKey() == null)
7837        {
7838            return "";
7839        }
7840        else
7841        {
7842            return getPrimaryKey().toString();
7843        }
7844    }
7845
7846    /**
7847     * set an id that differentiates this object from others
7848     * of its class.
7849     */

7850    public void setQueryKey(String JavaDoc key)
7851        throws TorqueException
7852    {
7853        setPrimaryKey(key);
7854    }
7855
7856    /**
7857     * Makes a copy of this object.
7858     * It creates a new object filling in the simple attributes.
7859       * It then fills all the association collections and sets the
7860     * related objects to isNew=true.
7861       */

7862      public Project copy() throws TorqueException
7863    {
7864        return copyInto(new Project());
7865    }
7866  
7867    protected Project copyInto(Project copyObj) throws TorqueException
7868    {
7869          copyObj.setProjectId(projectId);
7870          copyObj.setProjectCode(projectCode);
7871          copyObj.setStatus(status);
7872          copyObj.setPriority(priority);
7873          copyObj.setProjectCatId(projectCatId);
7874          copyObj.setProjectName(projectName);
7875          copyObj.setStartDate(startDate);
7876          copyObj.setEndDate(endDate);
7877          copyObj.setExpenses(expenses);
7878          copyObj.setRevenues(revenues);
7879          copyObj.setCustom1(custom1);
7880          copyObj.setCustom2(custom2);
7881          copyObj.setCustom3(custom3);
7882          copyObj.setCustom4(custom4);
7883          copyObj.setCustom5(custom5);
7884          copyObj.setCustom6(custom6);
7885          copyObj.setNotes(notes);
7886          copyObj.setCreated(created);
7887          copyObj.setModified(modified);
7888          copyObj.setCreatedBy(createdBy);
7889          copyObj.setModifiedBy(modifiedBy);
7890  
7891                            copyObj.setProjectId( 0);
7892                                                                                                                                    
7893                                      
7894                            
7895        List JavaDoc v = getSorders();
7896        for (int i = 0; i < v.size(); i++)
7897        {
7898            Sorder obj = (Sorder) v.get(i);
7899            copyObj.addSorder(obj.copy());
7900        }
7901                                                  
7902                            
7903        v = getPayments();
7904        for (int i = 0; i < v.size(); i++)
7905        {
7906            Payment obj = (Payment) v.get(i);
7907            copyObj.addPayment(obj.copy());
7908        }
7909                                                  
7910                            
7911        v = getServices();
7912        for (int i = 0; i < v.size(); i++)
7913        {
7914            Service obj = (Service) v.get(i);
7915            copyObj.addService(obj.copy());
7916        }
7917                                                  
7918                            
7919        v = getShipments();
7920        for (int i = 0; i < v.size(); i++)
7921        {
7922            Shipment obj = (Shipment) v.get(i);
7923            copyObj.addShipment(obj.copy());
7924        }
7925                                                  
7926                            
7927        v = getPrintSubscriptions();
7928        for (int i = 0; i < v.size(); i++)
7929        {
7930            PrintSubscription obj = (PrintSubscription) v.get(i);
7931            copyObj.addPrintSubscription(obj.copy());
7932        }
7933                                                  
7934                            
7935        v = getOnlineSubscriptions();
7936        for (int i = 0; i < v.size(); i++)
7937        {
7938            OnlineSubscription obj = (OnlineSubscription) v.get(i);
7939            copyObj.addOnlineSubscription(obj.copy());
7940        }
7941                                                  
7942                            
7943        v = getInboxEvents();
7944        for (int i = 0; i < v.size(); i++)
7945        {
7946            InboxEvent obj = (InboxEvent) v.get(i);
7947            copyObj.addInboxEvent(obj.copy());
7948        }
7949                                                  
7950                            
7951        v = getOutboxEvents();
7952        for (int i = 0; i < v.size(); i++)
7953        {
7954            OutboxEvent obj = (OutboxEvent) v.get(i);
7955            copyObj.addOutboxEvent(obj.copy());
7956        }
7957                                                  
7958                            
7959        v = getNewsSubscriptions();
7960        for (int i = 0; i < v.size(); i++)
7961        {
7962            NewsSubscription obj = (NewsSubscription) v.get(i);
7963            copyObj.addNewsSubscription(obj.copy());
7964        }
7965                                                            
7966                            
7967        v = getNewslettersRelatedByProjectId();
7968        for (int i = 0; i < v.size(); i++)
7969        {
7970            Newsletter obj = (Newsletter) v.get(i);
7971            copyObj.addNewsletterRelatedByProjectId(obj.copy());
7972        }
7973                                                            
7974                            
7975        v = getNewslettersRelatedByRelProjectId();
7976        for (int i = 0; i < v.size(); i++)
7977        {
7978            Newsletter obj = (Newsletter) v.get(i);
7979            copyObj.addNewsletterRelatedByRelProjectId(obj.copy());
7980        }
7981                                                  
7982                            
7983        v = getSorderItems();
7984        for (int i = 0; i < v.size(); i++)
7985        {
7986            SorderItem obj = (SorderItem) v.get(i);
7987            copyObj.addSorderItem(obj.copy());
7988        }
7989                                                  
7990                            
7991        v = getPaymentItems();
7992        for (int i = 0; i < v.size(); i++)
7993        {
7994            PaymentItem obj = (PaymentItem) v.get(i);
7995            copyObj.addPaymentItem(obj.copy());
7996        }
7997                                                  
7998                            
7999        v = getShipmentItems();
8000        for (int i = 0; i < v.size(); i++)
8001        {
8002            ShipmentItem obj = (ShipmentItem) v.get(i);
8003            copyObj.addShipmentItem(obj.copy());
8004        }
8005                                                  
8006                            
8007        v = getServiceItems();
8008        for (int i = 0; i < v.size(); i++)
8009        {
8010            ServiceItem obj = (ServiceItem) v.get(i);
8011            copyObj.addServiceItem(obj.copy());
8012        }
8013                            return copyObj;
8014    }
8015
8016    /**
8017     * returns a peer instance associated with this om. Since Peer classes
8018     * are not to have any instance attributes, this method returns the
8019     * same instance for all member of this class. The method could therefore
8020     * be static, but this would prevent one from overriding the behavior.
8021     */

8022    public ProjectPeer getPeer()
8023    {
8024        return peer;
8025    }
8026
8027    public String JavaDoc toString()
8028    {
8029        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
8030        str.append("Project:\n");
8031        str.append("ProjectId = ")
8032               .append(getProjectId())
8033             .append("\n");
8034        str.append("ProjectCode = ")
8035               .append(getProjectCode())
8036             .append("\n");
8037        str.append("Status = ")
8038               .append(getStatus())
8039             .append("\n");
8040        str.append("Priority = ")
8041               .append(getPriority())
8042             .append("\n");
8043        str.append("ProjectCatId = ")
8044               .append(getProjectCatId())
8045             .append("\n");
8046        str.append("ProjectName = ")
8047               .append(getProjectName())
8048             .append("\n");
8049        str.append("StartDate = ")
8050               .append(getStartDate())
8051             .append("\n");
8052        str.append("EndDate = ")
8053               .append(getEndDate())
8054             .append("\n");
8055        str.append("Expenses = ")
8056               .append(getExpenses())
8057             .append("\n");
8058        str.append("Revenues = ")
8059               .append(getRevenues())
8060             .append("\n");
8061        str.append("Custom1 = ")
8062               .append(getCustom1())
8063             .append("\n");
8064        str.append("Custom2 = ")
8065               .append(getCustom2())
8066             .append("\n");
8067        str.append("Custom3 = ")
8068               .append(getCustom3())
8069             .append("\n");
8070        str.append("Custom4 = ")
8071               .append(getCustom4())
8072             .append("\n");
8073        str.append("Custom5 = ")
8074               .append(getCustom5())
8075             .append("\n");
8076        str.append("Custom6 = ")
8077               .append(getCustom6())
8078             .append("\n");
8079        str.append("Notes = ")
8080               .append(getNotes())
8081             .append("\n");
8082        str.append("Created = ")
8083               .append(getCreated())
8084             .append("\n");
8085        str.append("Modified = ")
8086               .append(getModified())
8087             .append("\n");
8088        str.append("CreatedBy = ")
8089               .append(getCreatedBy())
8090             .append("\n");
8091        str.append("ModifiedBy = ")
8092               .append(getModifiedBy())
8093             .append("\n");
8094        return(str.toString());
8095    }
8096}
8097
Popular Tags