KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > om > BaseIssue


1 package org.tigris.scarab.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.fulcrum.intake.Retrievable;
13 import org.apache.torque.TorqueException;
14 import org.apache.torque.om.BaseObject;
15 import org.apache.torque.om.ComboKey;
16 import org.apache.torque.om.DateKey;
17 import org.apache.torque.om.NumberKey;
18 import org.apache.torque.om.ObjectKey;
19 import org.apache.torque.om.SimpleKey;
20 import org.apache.torque.om.StringKey;
21 import org.apache.torque.om.Persistent;
22 import org.apache.torque.util.Criteria;
23 import org.apache.torque.util.Transaction;
24
25     
26     
27     
28   
29 /**
30  * You should not use this class directly. It should not even be
31  * extended all references should be to Issue
32  */

33 public abstract class BaseIssue extends BaseObject
34     implements org.apache.fulcrum.intake.Retrievable
35 {
36     /** The Peer class */
37     private static final IssuePeer peer =
38         new IssuePeer();
39
40         
41     /** The value for the issueId field */
42     private Long JavaDoc issueId;
43       
44     /** The value for the idPrefix field */
45     private String JavaDoc idPrefix;
46       
47     /** The value for the idCount field */
48     private int idCount;
49       
50     /** The value for the idDomain field */
51     private String JavaDoc idDomain;
52       
53     /** The value for the typeId field */
54     private Integer JavaDoc typeId;
55       
56     /** The value for the moduleId field */
57     private Integer JavaDoc moduleId;
58       
59     /** The value for the createdTransId field */
60     private Long JavaDoc createdTransId;
61                                                                 
62     /** The value for the deleted field */
63     private boolean deleted = false;
64   
65     
66     /**
67      * Get the IssueId
68      *
69      * @return Long
70      */

71     public Long JavaDoc getIssueId()
72     {
73         return issueId;
74     }
75
76                                               
77     /**
78      * Set the value of IssueId
79      *
80      * @param v new value
81      */

82     public void setIssueId(Long JavaDoc v) throws TorqueException
83     {
84     
85                   if (!ObjectUtils.equals(this.issueId, v))
86               {
87             this.issueId = v;
88             setModified(true);
89         }
90     
91           
92                                   
93         // update associated Activity
94
if (collActivitys != null)
95         {
96             for (int i = 0; i < collActivitys.size(); i++)
97             {
98                 ((Activity) collActivitys.get(i))
99                         .setIssueId(v);
100             }
101         }
102                                           
103         // update associated Attachment
104
if (collAttachments != null)
105         {
106             for (int i = 0; i < collAttachments.size(); i++)
107             {
108                 ((Attachment) collAttachments.get(i))
109                         .setIssueId(v);
110             }
111         }
112                                           
113         // update associated Depend
114
if (collDependsRelatedByObservedId != null)
115         {
116             for (int i = 0; i < collDependsRelatedByObservedId.size(); i++)
117             {
118                 ((Depend) collDependsRelatedByObservedId.get(i))
119                         .setObservedId(v);
120             }
121         }
122                                           
123         // update associated Depend
124
if (collDependsRelatedByObserverId != null)
125         {
126             for (int i = 0; i < collDependsRelatedByObserverId.size(); i++)
127             {
128                 ((Depend) collDependsRelatedByObserverId.get(i))
129                         .setObserverId(v);
130             }
131         }
132                                           
133         // update associated AttributeValue
134
if (collAttributeValues != null)
135         {
136             for (int i = 0; i < collAttributeValues.size(); i++)
137             {
138                 ((AttributeValue) collAttributeValues.get(i))
139                         .setIssueId(v);
140             }
141         }
142                                           
143         // update associated IssueVote
144
if (collIssueVotes != null)
145         {
146             for (int i = 0; i < collIssueVotes.size(); i++)
147             {
148                 ((IssueVote) collIssueVotes.get(i))
149                         .setIssueId(v);
150             }
151         }
152                                           
153         // update associated IssueTemplateInfo
154
if (collIssueTemplateInfos != null)
155         {
156             for (int i = 0; i < collIssueTemplateInfos.size(); i++)
157             {
158                 ((IssueTemplateInfo) collIssueTemplateInfos.get(i))
159                         .setIssueId(v);
160             }
161         }
162                       }
163   
164     /**
165      * Get the IdPrefix
166      *
167      * @return String
168      */

169     public String JavaDoc getIdPrefix()
170     {
171         return idPrefix;
172     }
173
174                         
175     /**
176      * Set the value of IdPrefix
177      *
178      * @param v new value
179      */

180     public void setIdPrefix(String JavaDoc v)
181     {
182     
183                   if (!ObjectUtils.equals(this.idPrefix, v))
184               {
185             this.idPrefix = v;
186             setModified(true);
187         }
188     
189           
190               }
191   
192     /**
193      * Get the IdCount
194      *
195      * @return int
196      */

197     public int getIdCount()
198     {
199         return idCount;
200     }
201
202                         
203     /**
204      * Set the value of IdCount
205      *
206      * @param v new value
207      */

208     public void setIdCount(int v)
209     {
210     
211                   if (this.idCount != v)
212               {
213             this.idCount = v;
214             setModified(true);
215         }
216     
217           
218               }
219   
220     /**
221      * Get the IdDomain
222      *
223      * @return String
224      */

225     public String JavaDoc getIdDomain()
226     {
227         return idDomain;
228     }
229
230                         
231     /**
232      * Set the value of IdDomain
233      *
234      * @param v new value
235      */

236     public void setIdDomain(String JavaDoc v)
237     {
238     
239                   if (!ObjectUtils.equals(this.idDomain, v))
240               {
241             this.idDomain = v;
242             setModified(true);
243         }
244     
245           
246               }
247   
248     /**
249      * Get the TypeId
250      *
251      * @return Integer
252      */

253     public Integer JavaDoc getTypeId()
254     {
255         return typeId;
256     }
257
258                               
259     /**
260      * Set the value of TypeId
261      *
262      * @param v new value
263      */

264     public void setTypeId(Integer JavaDoc v) throws TorqueException
265     {
266     
267                   if (!ObjectUtils.equals(this.typeId, v))
268               {
269             this.typeId = v;
270             setModified(true);
271         }
272     
273                                   
274                 if (aIssueType != null && !ObjectUtils.equals(aIssueType.getIssueTypeId(), v))
275                 {
276             aIssueType = null;
277         }
278       
279               }
280   
281     /**
282      * Get the ModuleId
283      *
284      * @return Integer
285      */

286     public Integer JavaDoc getModuleId()
287     {
288         return moduleId;
289     }
290
291                               
292     /**
293      * Set the value of ModuleId
294      *
295      * @param v new value
296      */

297     public void setModuleId(Integer JavaDoc v) throws TorqueException
298     {
299     
300                   if (!ObjectUtils.equals(this.moduleId, v))
301               {
302             this.moduleId = v;
303             setModified(true);
304         }
305     
306                                           
307                 if (aModule != null && !ObjectUtils.equals(aModule.getModuleId(), v))
308                 {
309             aModule = null;
310         }
311       
312               }
313   
314     /**
315      * Get the CreatedTransId
316      *
317      * @return Long
318      */

319     public Long JavaDoc getCreatedTransId()
320     {
321         return createdTransId;
322     }
323
324                               
325     /**
326      * Set the value of CreatedTransId
327      *
328      * @param v new value
329      */

330     public void setCreatedTransId(Long JavaDoc v) throws TorqueException
331     {
332     
333                   if (!ObjectUtils.equals(this.createdTransId, v))
334               {
335             this.createdTransId = v;
336             setModified(true);
337         }
338     
339                                   
340                 if (aActivitySet != null && !ObjectUtils.equals(aActivitySet.getActivitySetId(), v))
341                 {
342             aActivitySet = null;
343         }
344       
345               }
346   
347     /**
348      * Get the Deleted
349      *
350      * @return boolean
351      */

352     public boolean getDeleted()
353     {
354         return deleted;
355     }
356
357                         
358     /**
359      * Set the value of Deleted
360      *
361      * @param v new value
362      */

363     public void setDeleted(boolean v)
364     {
365     
366                   if (this.deleted != v)
367               {
368             this.deleted = v;
369             setModified(true);
370         }
371     
372           
373               }
374   
375       
376             
377                   
378         private Module aModule;
379
380     /**
381      * Declares an association between this object and a Module object
382      *
383      * @param v Module
384      * @throws TorqueException
385      */

386     public void setModule(Module v) throws TorqueException
387     {
388             if (v == null)
389         {
390                   setModuleId((Integer JavaDoc) null);
391               }
392         else
393         {
394             setModuleId(v.getModuleId());
395         }
396             aModule = v;
397     }
398
399                         
400     /**
401      * Get the associated Module object
402      *
403      * @return the associated Module object
404      * @throws TorqueException
405      */

406     public Module getModule() throws TorqueException
407     {
408         if ( !ObjectUtils.equals(getModuleId(), null) )
409         {
410                 return ModuleManager.getInstance(SimpleKey.keyFor(getModuleId()));
411             }
412         return aModule;
413     }
414
415     /**
416      * Provides convenient way to set a relationship based on a
417      * ObjectKey, for example
418      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
419      *
420          */

421     public void setModuleKey(ObjectKey key) throws TorqueException
422     {
423     
424                     setModuleId(new Integer JavaDoc(((NumberKey) key).intValue()));
425               }
426   
427         
428                   
429         private IssueType aIssueType;
430
431     /**
432      * Declares an association between this object and a IssueType object
433      *
434      * @param v IssueType
435      * @throws TorqueException
436      */

437     public void setIssueType(IssueType v) throws TorqueException
438     {
439             if (v == null)
440         {
441                   setTypeId((Integer JavaDoc) null);
442               }
443         else
444         {
445             setTypeId(v.getIssueTypeId());
446         }
447             aIssueType = v;
448     }
449
450                         
451     /**
452      * Get the associated IssueType object
453      *
454      * @return the associated IssueType object
455      * @throws TorqueException
456      */

457     public IssueType getIssueType() throws TorqueException
458     {
459         if ( !ObjectUtils.equals(getTypeId(), null) )
460         {
461                 return IssueTypeManager.getInstance(SimpleKey.keyFor(getTypeId()));
462             }
463         return aIssueType;
464     }
465
466     /**
467      * Provides convenient way to set a relationship based on a
468      * ObjectKey, for example
469      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
470      *
471          */

472     public void setIssueTypeKey(ObjectKey key) throws TorqueException
473     {
474     
475                     setTypeId(new Integer JavaDoc(((NumberKey) key).intValue()));
476               }
477   
478         
479                   
480         private ActivitySet aActivitySet;
481
482     /**
483      * Declares an association between this object and a ActivitySet object
484      *
485      * @param v ActivitySet
486      * @throws TorqueException
487      */

488     public void setActivitySet(ActivitySet v) throws TorqueException
489     {
490             if (v == null)
491         {
492                   setCreatedTransId((Long JavaDoc) null);
493               }
494         else
495         {
496             setCreatedTransId(v.getActivitySetId());
497         }
498             aActivitySet = v;
499     }
500
501                         
502     /**
503      * Get the associated ActivitySet object
504      *
505      * @return the associated ActivitySet object
506      * @throws TorqueException
507      */

508     public ActivitySet getActivitySet() throws TorqueException
509     {
510         if ( !ObjectUtils.equals(getCreatedTransId(), null) )
511         {
512                 return ActivitySetManager.getInstance(SimpleKey.keyFor(getCreatedTransId()));
513             }
514         return aActivitySet;
515     }
516
517     /**
518      * Provides convenient way to set a relationship based on a
519      * ObjectKey, for example
520      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
521      *
522          */

523     public void setActivitySetKey(ObjectKey key) throws TorqueException
524     {
525     
526                     setCreatedTransId(new Long JavaDoc(((NumberKey) key).longValue()));
527               }
528      
529                                 
530             
531     /**
532      * Collection to store aggregation of collActivitys
533      */

534     protected List JavaDoc collActivitys;
535
536     /**
537      * Temporary storage of collActivitys to save a possible db hit in
538      * the event objects are add to the collection, but the
539      * complete collection is never requested.
540      */

541     protected void initActivitys()
542     {
543         if (collActivitys == null)
544         {
545             collActivitys = new ArrayList JavaDoc();
546         }
547     }
548
549             
550     /**
551      * Method called to associate a Activity object to this object
552      * through the Activity foreign key attribute
553      *
554      * @param l Activity
555      * @throws TorqueException
556      */

557     public void addActivity(Activity l) throws TorqueException
558     {
559         getActivitys().add(l);
560         l.setIssue((Issue)this);
561     }
562
563     /**
564      * The criteria used to select the current contents of collActivitys
565      */

566     private Criteria lastActivitysCriteria = null;
567
568     /**
569      * If this collection has already been initialized, returns
570      * the collection. Otherwise returns the results of
571      * getActivitys(new Criteria())
572      *
573      * @throws TorqueException
574      */

575     public List JavaDoc getActivitys() throws TorqueException
576     {
577         if (collActivitys == null)
578         {
579             collActivitys = getActivitys(new Criteria(10));
580         }
581         return collActivitys;
582     }
583
584     /**
585      * If this collection has already been initialized with
586      * an identical criteria, it returns the collection.
587      * Otherwise if this Issue has previously
588      * been saved, it will retrieve related Activitys from storage.
589      * If this Issue is new, it will return
590      * an empty collection or the current collection, the criteria
591      * is ignored on a new object.
592      *
593      * @throws TorqueException
594      */

595     public List JavaDoc getActivitys(Criteria criteria) throws TorqueException
596     {
597         if (collActivitys == null)
598         {
599             if (isNew())
600             {
601                collActivitys = new ArrayList JavaDoc();
602             }
603             else
604             {
605                       criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
606                       collActivitys = ActivityPeer.doSelect(criteria);
607             }
608         }
609         else
610         {
611             // criteria has no effect for a new object
612
if (!isNew())
613             {
614                 // the following code is to determine if a new query is
615
// called for. If the criteria is the same as the last
616
// one, just return the collection.
617
criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
618                       if (!lastActivitysCriteria.equals(criteria))
619                 {
620                     collActivitys = ActivityPeer.doSelect(criteria);
621                 }
622             }
623         }
624         lastActivitysCriteria = criteria;
625
626         return collActivitys;
627     }
628
629     /**
630      * If this collection has already been initialized, returns
631      * the collection. Otherwise returns the results of
632      * getActivitys(new Criteria(),Connection)
633      * This method takes in the Connection also as input so that
634      * referenced objects can also be obtained using a Connection
635      * that is taken as input
636      */

637     public List JavaDoc getActivitys(Connection JavaDoc con) throws TorqueException
638     {
639         if (collActivitys == null)
640         {
641             collActivitys = getActivitys(new Criteria(10),con);
642         }
643         return collActivitys;
644     }
645
646     /**
647      * If this collection has already been initialized with
648      * an identical criteria, it returns the collection.
649      * Otherwise if this Issue has previously
650      * been saved, it will retrieve related Activitys from storage.
651      * If this Issue is new, it will return
652      * an empty collection or the current collection, the criteria
653      * is ignored on a new object.
654      * This method takes in the Connection also as input so that
655      * referenced objects can also be obtained using a Connection
656      * that is taken as input
657      */

658     public List JavaDoc getActivitys(Criteria criteria,Connection JavaDoc con) throws TorqueException
659     {
660         if (collActivitys == null)
661         {
662             if (isNew())
663             {
664                collActivitys = new ArrayList JavaDoc();
665             }
666             else
667             {
668                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
669                        collActivitys = ActivityPeer.doSelect(criteria,con);
670              }
671          }
672          else
673          {
674              // criteria has no effect for a new object
675
if (!isNew())
676              {
677                  // the following code is to determine if a new query is
678
// called for. If the criteria is the same as the last
679
// one, just return the collection.
680
criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
681                      if (!lastActivitysCriteria.equals(criteria))
682                  {
683                      collActivitys = ActivityPeer.doSelect(criteria,con);
684                  }
685              }
686          }
687          lastActivitysCriteria = criteria;
688
689          return collActivitys;
690      }
691
692                                                                   
693               
694                     
695                               
696                                 
697                                                               
698                                         
699                     
700                     
701           
702     /**
703      * If this collection has already been initialized with
704      * an identical criteria, it returns the collection.
705      * Otherwise if this Issue is new, it will return
706      * an empty collection; or if this Issue has previously
707      * been saved, it will retrieve related Activitys from storage.
708      *
709      * This method is protected by default in order to keep the public
710      * api reasonable. You can provide public methods for those you
711      * actually need in Issue.
712      */

713     protected List JavaDoc getActivitysJoinIssue(Criteria criteria)
714         throws TorqueException
715     {
716         if (collActivitys == null)
717         {
718             if (isNew())
719             {
720                collActivitys = new ArrayList JavaDoc();
721             }
722             else
723             {
724                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
725                             collActivitys = ActivityPeer.doSelectJoinIssue(criteria);
726             }
727         }
728         else
729         {
730             // the following code is to determine if a new query is
731
// called for. If the criteria is the same as the last
732
// one, just return the collection.
733

734                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
735                         if (!lastActivitysCriteria.equals(criteria))
736             {
737                 collActivitys = ActivityPeer.doSelectJoinIssue(criteria);
738             }
739         }
740         lastActivitysCriteria = criteria;
741
742         return collActivitys;
743     }
744                   
745                     
746                     
747                                 
748                                                               
749                                         
750                     
751                     
752           
753     /**
754      * If this collection has already been initialized with
755      * an identical criteria, it returns the collection.
756      * Otherwise if this Issue is new, it will return
757      * an empty collection; or if this Issue has previously
758      * been saved, it will retrieve related Activitys from storage.
759      *
760      * This method is protected by default in order to keep the public
761      * api reasonable. You can provide public methods for those you
762      * actually need in Issue.
763      */

764     protected List JavaDoc getActivitysJoinAttribute(Criteria criteria)
765         throws TorqueException
766     {
767         if (collActivitys == null)
768         {
769             if (isNew())
770             {
771                collActivitys = new ArrayList JavaDoc();
772             }
773             else
774             {
775                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
776                             collActivitys = ActivityPeer.doSelectJoinAttribute(criteria);
777             }
778         }
779         else
780         {
781             // the following code is to determine if a new query is
782
// called for. If the criteria is the same as the last
783
// one, just return the collection.
784

785                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
786                         if (!lastActivitysCriteria.equals(criteria))
787             {
788                 collActivitys = ActivityPeer.doSelectJoinAttribute(criteria);
789             }
790         }
791         lastActivitysCriteria = criteria;
792
793         return collActivitys;
794     }
795                   
796                     
797                     
798                                 
799                                                               
800                                         
801                     
802                     
803           
804     /**
805      * If this collection has already been initialized with
806      * an identical criteria, it returns the collection.
807      * Otherwise if this Issue is new, it will return
808      * an empty collection; or if this Issue has previously
809      * been saved, it will retrieve related Activitys from storage.
810      *
811      * This method is protected by default in order to keep the public
812      * api reasonable. You can provide public methods for those you
813      * actually need in Issue.
814      */

815     protected List JavaDoc getActivitysJoinActivitySet(Criteria criteria)
816         throws TorqueException
817     {
818         if (collActivitys == null)
819         {
820             if (isNew())
821             {
822                collActivitys = new ArrayList JavaDoc();
823             }
824             else
825             {
826                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
827                             collActivitys = ActivityPeer.doSelectJoinActivitySet(criteria);
828             }
829         }
830         else
831         {
832             // the following code is to determine if a new query is
833
// called for. If the criteria is the same as the last
834
// one, just return the collection.
835

836                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
837                         if (!lastActivitysCriteria.equals(criteria))
838             {
839                 collActivitys = ActivityPeer.doSelectJoinActivitySet(criteria);
840             }
841         }
842         lastActivitysCriteria = criteria;
843
844         return collActivitys;
845     }
846                   
847                     
848                     
849                                             
850                                                                           
851                                         
852                     
853                     
854           
855     /**
856      * If this collection has already been initialized with
857      * an identical criteria, it returns the collection.
858      * Otherwise if this Issue is new, it will return
859      * an empty collection; or if this Issue has previously
860      * been saved, it will retrieve related Activitys from storage.
861      *
862      * This method is protected by default in order to keep the public
863      * api reasonable. You can provide public methods for those you
864      * actually need in Issue.
865      */

866     protected List JavaDoc getActivitysJoinScarabUserImplRelatedByOldUserId(Criteria criteria)
867         throws TorqueException
868     {
869         if (collActivitys == null)
870         {
871             if (isNew())
872             {
873                collActivitys = new ArrayList JavaDoc();
874             }
875             else
876             {
877                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
878                             collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
879             }
880         }
881         else
882         {
883             // the following code is to determine if a new query is
884
// called for. If the criteria is the same as the last
885
// one, just return the collection.
886

887                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
888                         if (!lastActivitysCriteria.equals(criteria))
889             {
890                 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
891             }
892         }
893         lastActivitysCriteria = criteria;
894
895         return collActivitys;
896     }
897                   
898                     
899                     
900                                             
901                                                                           
902                                         
903                     
904                     
905           
906     /**
907      * If this collection has already been initialized with
908      * an identical criteria, it returns the collection.
909      * Otherwise if this Issue is new, it will return
910      * an empty collection; or if this Issue has previously
911      * been saved, it will retrieve related Activitys from storage.
912      *
913      * This method is protected by default in order to keep the public
914      * api reasonable. You can provide public methods for those you
915      * actually need in Issue.
916      */

917     protected List JavaDoc getActivitysJoinScarabUserImplRelatedByNewUserId(Criteria criteria)
918         throws TorqueException
919     {
920         if (collActivitys == null)
921         {
922             if (isNew())
923             {
924                collActivitys = new ArrayList JavaDoc();
925             }
926             else
927             {
928                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
929                             collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
930             }
931         }
932         else
933         {
934             // the following code is to determine if a new query is
935
// called for. If the criteria is the same as the last
936
// one, just return the collection.
937

938                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
939                         if (!lastActivitysCriteria.equals(criteria))
940             {
941                 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
942             }
943         }
944         lastActivitysCriteria = criteria;
945
946         return collActivitys;
947     }
948                   
949                     
950                     
951                                             
952                                                                           
953                                         
954                     
955                     
956           
957     /**
958      * If this collection has already been initialized with
959      * an identical criteria, it returns the collection.
960      * Otherwise if this Issue is new, it will return
961      * an empty collection; or if this Issue has previously
962      * been saved, it will retrieve related Activitys from storage.
963      *
964      * This method is protected by default in order to keep the public
965      * api reasonable. You can provide public methods for those you
966      * actually need in Issue.
967      */

968     protected List JavaDoc getActivitysJoinAttributeOptionRelatedByOldOptionId(Criteria criteria)
969         throws TorqueException
970     {
971         if (collActivitys == null)
972         {
973             if (isNew())
974             {
975                collActivitys = new ArrayList JavaDoc();
976             }
977             else
978             {
979                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
980                             collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
981             }
982         }
983         else
984         {
985             // the following code is to determine if a new query is
986
// called for. If the criteria is the same as the last
987
// one, just return the collection.
988

989                             criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
990                         if (!lastActivitysCriteria.equals(criteria))
991             {
992                 collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
993             }
994         }
995         lastActivitysCriteria = criteria;
996
997         return collActivitys;
998     }
999                   
1000                    
1001                    
1002                                            
1003                                                                          
1004                                        
1005                    
1006                    
1007          
1008    /**
1009     * If this collection has already been initialized with
1010     * an identical criteria, it returns the collection.
1011     * Otherwise if this Issue is new, it will return
1012     * an empty collection; or if this Issue has previously
1013     * been saved, it will retrieve related Activitys from storage.
1014     *
1015     * This method is protected by default in order to keep the public
1016     * api reasonable. You can provide public methods for those you
1017     * actually need in Issue.
1018     */

1019    protected List JavaDoc getActivitysJoinAttributeOptionRelatedByNewOptionId(Criteria criteria)
1020        throws TorqueException
1021    {
1022        if (collActivitys == null)
1023        {
1024            if (isNew())
1025            {
1026               collActivitys = new ArrayList JavaDoc();
1027            }
1028            else
1029            {
1030                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1031                            collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1032            }
1033        }
1034        else
1035        {
1036            // the following code is to determine if a new query is
1037
// called for. If the criteria is the same as the last
1038
// one, just return the collection.
1039

1040                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1041                        if (!lastActivitysCriteria.equals(criteria))
1042            {
1043                collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1044            }
1045        }
1046        lastActivitysCriteria = criteria;
1047
1048        return collActivitys;
1049    }
1050                  
1051                    
1052                    
1053                                
1054                                                              
1055                                        
1056                    
1057                    
1058          
1059    /**
1060     * If this collection has already been initialized with
1061     * an identical criteria, it returns the collection.
1062     * Otherwise if this Issue is new, it will return
1063     * an empty collection; or if this Issue has previously
1064     * been saved, it will retrieve related Activitys from storage.
1065     *
1066     * This method is protected by default in order to keep the public
1067     * api reasonable. You can provide public methods for those you
1068     * actually need in Issue.
1069     */

1070    protected List JavaDoc getActivitysJoinAttachment(Criteria criteria)
1071        throws TorqueException
1072    {
1073        if (collActivitys == null)
1074        {
1075            if (isNew())
1076            {
1077               collActivitys = new ArrayList JavaDoc();
1078            }
1079            else
1080            {
1081                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1082                            collActivitys = ActivityPeer.doSelectJoinAttachment(criteria);
1083            }
1084        }
1085        else
1086        {
1087            // the following code is to determine if a new query is
1088
// called for. If the criteria is the same as the last
1089
// one, just return the collection.
1090

1091                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1092                        if (!lastActivitysCriteria.equals(criteria))
1093            {
1094                collActivitys = ActivityPeer.doSelectJoinAttachment(criteria);
1095            }
1096        }
1097        lastActivitysCriteria = criteria;
1098
1099        return collActivitys;
1100    }
1101                  
1102                    
1103                    
1104                                
1105                                                              
1106                                        
1107                    
1108                    
1109          
1110    /**
1111     * If this collection has already been initialized with
1112     * an identical criteria, it returns the collection.
1113     * Otherwise if this Issue is new, it will return
1114     * an empty collection; or if this Issue has previously
1115     * been saved, it will retrieve related Activitys from storage.
1116     *
1117     * This method is protected by default in order to keep the public
1118     * api reasonable. You can provide public methods for those you
1119     * actually need in Issue.
1120     */

1121    protected List JavaDoc getActivitysJoinDepend(Criteria criteria)
1122        throws TorqueException
1123    {
1124        if (collActivitys == null)
1125        {
1126            if (isNew())
1127            {
1128               collActivitys = new ArrayList JavaDoc();
1129            }
1130            else
1131            {
1132                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1133                            collActivitys = ActivityPeer.doSelectJoinDepend(criteria);
1134            }
1135        }
1136        else
1137        {
1138            // the following code is to determine if a new query is
1139
// called for. If the criteria is the same as the last
1140
// one, just return the collection.
1141

1142                            criteria.add(ActivityPeer.ISSUE_ID, getIssueId() );
1143                        if (!lastActivitysCriteria.equals(criteria))
1144            {
1145                collActivitys = ActivityPeer.doSelectJoinDepend(criteria);
1146            }
1147        }
1148        lastActivitysCriteria = criteria;
1149
1150        return collActivitys;
1151    }
1152                            
1153
1154
1155                          
1156            
1157    /**
1158     * Collection to store aggregation of collAttachments
1159     */

1160    protected List JavaDoc collAttachments;
1161
1162    /**
1163     * Temporary storage of collAttachments to save a possible db hit in
1164     * the event objects are add to the collection, but the
1165     * complete collection is never requested.
1166     */

1167    protected void initAttachments()
1168    {
1169        if (collAttachments == null)
1170        {
1171            collAttachments = new ArrayList JavaDoc();
1172        }
1173    }
1174
1175            
1176    /**
1177     * Method called to associate a Attachment object to this object
1178     * through the Attachment foreign key attribute
1179     *
1180     * @param l Attachment
1181     * @throws TorqueException
1182     */

1183    public void addAttachment(Attachment l) throws TorqueException
1184    {
1185        getAttachments().add(l);
1186        l.setIssue((Issue)this);
1187    }
1188
1189    /**
1190     * The criteria used to select the current contents of collAttachments
1191     */

1192    private Criteria lastAttachmentsCriteria = null;
1193
1194    /**
1195     * If this collection has already been initialized, returns
1196     * the collection. Otherwise returns the results of
1197     * getAttachments(new Criteria())
1198     *
1199     * @throws TorqueException
1200     */

1201    public List JavaDoc getAttachments() throws TorqueException
1202    {
1203        if (collAttachments == null)
1204        {
1205            collAttachments = getAttachments(new Criteria(10));
1206        }
1207        return collAttachments;
1208    }
1209
1210    /**
1211     * If this collection has already been initialized with
1212     * an identical criteria, it returns the collection.
1213     * Otherwise if this Issue has previously
1214     * been saved, it will retrieve related Attachments from storage.
1215     * If this Issue is new, it will return
1216     * an empty collection or the current collection, the criteria
1217     * is ignored on a new object.
1218     *
1219     * @throws TorqueException
1220     */

1221    public List JavaDoc getAttachments(Criteria criteria) throws TorqueException
1222    {
1223        if (collAttachments == null)
1224        {
1225            if (isNew())
1226            {
1227               collAttachments = new ArrayList JavaDoc();
1228            }
1229            else
1230            {
1231                      criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1232                      collAttachments = AttachmentPeer.doSelect(criteria);
1233            }
1234        }
1235        else
1236        {
1237            // criteria has no effect for a new object
1238
if (!isNew())
1239            {
1240                // the following code is to determine if a new query is
1241
// called for. If the criteria is the same as the last
1242
// one, just return the collection.
1243
criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1244                      if (!lastAttachmentsCriteria.equals(criteria))
1245                {
1246                    collAttachments = AttachmentPeer.doSelect(criteria);
1247                }
1248            }
1249        }
1250        lastAttachmentsCriteria = criteria;
1251
1252        return collAttachments;
1253    }
1254
1255    /**
1256     * If this collection has already been initialized, returns
1257     * the collection. Otherwise returns the results of
1258     * getAttachments(new Criteria(),Connection)
1259     * This method takes in the Connection also as input so that
1260     * referenced objects can also be obtained using a Connection
1261     * that is taken as input
1262     */

1263    public List JavaDoc getAttachments(Connection JavaDoc con) throws TorqueException
1264    {
1265        if (collAttachments == null)
1266        {
1267            collAttachments = getAttachments(new Criteria(10),con);
1268        }
1269        return collAttachments;
1270    }
1271
1272    /**
1273     * If this collection has already been initialized with
1274     * an identical criteria, it returns the collection.
1275     * Otherwise if this Issue has previously
1276     * been saved, it will retrieve related Attachments from storage.
1277     * If this Issue is new, it will return
1278     * an empty collection or the current collection, the criteria
1279     * is ignored on a new object.
1280     * This method takes in the Connection also as input so that
1281     * referenced objects can also be obtained using a Connection
1282     * that is taken as input
1283     */

1284    public List JavaDoc getAttachments(Criteria criteria,Connection JavaDoc con) throws TorqueException
1285    {
1286        if (collAttachments == null)
1287        {
1288            if (isNew())
1289            {
1290               collAttachments = new ArrayList JavaDoc();
1291            }
1292            else
1293            {
1294                       criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1295                       collAttachments = AttachmentPeer.doSelect(criteria,con);
1296             }
1297         }
1298         else
1299         {
1300             // criteria has no effect for a new object
1301
if (!isNew())
1302             {
1303                 // the following code is to determine if a new query is
1304
// called for. If the criteria is the same as the last
1305
// one, just return the collection.
1306
criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1307                     if (!lastAttachmentsCriteria.equals(criteria))
1308                 {
1309                     collAttachments = AttachmentPeer.doSelect(criteria,con);
1310                 }
1311             }
1312         }
1313         lastAttachmentsCriteria = criteria;
1314
1315         return collAttachments;
1316     }
1317
1318                                    
1319              
1320                    
1321                              
1322                                
1323                                                              
1324                                        
1325                    
1326                    
1327          
1328    /**
1329     * If this collection has already been initialized with
1330     * an identical criteria, it returns the collection.
1331     * Otherwise if this Issue is new, it will return
1332     * an empty collection; or if this Issue has previously
1333     * been saved, it will retrieve related Attachments from storage.
1334     *
1335     * This method is protected by default in order to keep the public
1336     * api reasonable. You can provide public methods for those you
1337     * actually need in Issue.
1338     */

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

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

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

1411                            criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1412                        if (!lastAttachmentsCriteria.equals(criteria))
1413            {
1414                collAttachments = AttachmentPeer.doSelectJoinAttachmentType(criteria);
1415            }
1416        }
1417        lastAttachmentsCriteria = criteria;
1418
1419        return collAttachments;
1420    }
1421                  
1422                    
1423                    
1424                                            
1425                                                                          
1426                                        
1427                    
1428                    
1429          
1430    /**
1431     * If this collection has already been initialized with
1432     * an identical criteria, it returns the collection.
1433     * Otherwise if this Issue is new, it will return
1434     * an empty collection; or if this Issue has previously
1435     * been saved, it will retrieve related Attachments from storage.
1436     *
1437     * This method is protected by default in order to keep the public
1438     * api reasonable. You can provide public methods for those you
1439     * actually need in Issue.
1440     */

1441    protected List JavaDoc getAttachmentsJoinScarabUserImplRelatedByCreatedBy(Criteria criteria)
1442        throws TorqueException
1443    {
1444        if (collAttachments == null)
1445        {
1446            if (isNew())
1447            {
1448               collAttachments = new ArrayList JavaDoc();
1449            }
1450            else
1451            {
1452                            criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1453                            collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByCreatedBy(criteria);
1454            }
1455        }
1456        else
1457        {
1458            // the following code is to determine if a new query is
1459
// called for. If the criteria is the same as the last
1460
// one, just return the collection.
1461

1462                            criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1463                        if (!lastAttachmentsCriteria.equals(criteria))
1464            {
1465                collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByCreatedBy(criteria);
1466            }
1467        }
1468        lastAttachmentsCriteria = criteria;
1469
1470        return collAttachments;
1471    }
1472                  
1473                    
1474                    
1475                                            
1476                                                                          
1477                                        
1478                    
1479                    
1480          
1481    /**
1482     * If this collection has already been initialized with
1483     * an identical criteria, it returns the collection.
1484     * Otherwise if this Issue is new, it will return
1485     * an empty collection; or if this Issue has previously
1486     * been saved, it will retrieve related Attachments from storage.
1487     *
1488     * This method is protected by default in order to keep the public
1489     * api reasonable. You can provide public methods for those you
1490     * actually need in Issue.
1491     */

1492    protected List JavaDoc getAttachmentsJoinScarabUserImplRelatedByModifiedBy(Criteria criteria)
1493        throws TorqueException
1494    {
1495        if (collAttachments == null)
1496        {
1497            if (isNew())
1498            {
1499               collAttachments = new ArrayList JavaDoc();
1500            }
1501            else
1502            {
1503                            criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1504                            collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByModifiedBy(criteria);
1505            }
1506        }
1507        else
1508        {
1509            // the following code is to determine if a new query is
1510
// called for. If the criteria is the same as the last
1511
// one, just return the collection.
1512

1513                            criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() );
1514                        if (!lastAttachmentsCriteria.equals(criteria))
1515            {
1516                collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByModifiedBy(criteria);
1517            }
1518        }
1519        lastAttachmentsCriteria = criteria;
1520
1521        return collAttachments;
1522    }
1523                            
1524
1525
1526                                  
1527            
1528    /**
1529     * Collection to store aggregation of collDependsRelatedByObservedId
1530     */

1531    protected List JavaDoc collDependsRelatedByObservedId;
1532
1533    /**
1534     * Temporary storage of collDependsRelatedByObservedId to save a possible db hit in
1535     * the event objects are add to the collection, but the
1536     * complete collection is never requested.
1537     */

1538    protected void initDependsRelatedByObservedId()
1539    {
1540        if (collDependsRelatedByObservedId == null)
1541        {
1542            collDependsRelatedByObservedId = new ArrayList JavaDoc();
1543        }
1544    }
1545
1546            
1547    /**
1548     * Method called to associate a Depend object to this object
1549     * through the Depend foreign key attribute
1550     *
1551     * @param l Depend
1552     * @throws TorqueException
1553     */

1554    public void addDependRelatedByObservedId(Depend l) throws TorqueException
1555    {
1556        getDependsRelatedByObservedId().add(l);
1557        l.setIssueRelatedByObservedId((Issue)this);
1558    }
1559
1560    /**
1561     * The criteria used to select the current contents of collDependsRelatedByObservedId
1562     */

1563    private Criteria lastDependsRelatedByObservedIdCriteria = null;
1564
1565    /**
1566     * If this collection has already been initialized, returns
1567     * the collection. Otherwise returns the results of
1568     * getDependsRelatedByObservedId(new Criteria())
1569     *
1570     * @throws TorqueException
1571     */

1572    public List JavaDoc getDependsRelatedByObservedId() throws TorqueException
1573    {
1574        if (collDependsRelatedByObservedId == null)
1575        {
1576            collDependsRelatedByObservedId = getDependsRelatedByObservedId(new Criteria(10));
1577        }
1578        return collDependsRelatedByObservedId;
1579    }
1580
1581    /**
1582     * If this collection has already been initialized with
1583     * an identical criteria, it returns the collection.
1584     * Otherwise if this Issue has previously
1585     * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1586     * If this Issue is new, it will return
1587     * an empty collection or the current collection, the criteria
1588     * is ignored on a new object.
1589     *
1590     * @throws TorqueException
1591     */

1592    public List JavaDoc getDependsRelatedByObservedId(Criteria criteria) throws TorqueException
1593    {
1594        if (collDependsRelatedByObservedId == null)
1595        {
1596            if (isNew())
1597            {
1598               collDependsRelatedByObservedId = new ArrayList JavaDoc();
1599            }
1600            else
1601            {
1602                      criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1603                      collDependsRelatedByObservedId = DependPeer.doSelect(criteria);
1604            }
1605        }
1606        else
1607        {
1608            // criteria has no effect for a new object
1609
if (!isNew())
1610            {
1611                // the following code is to determine if a new query is
1612
// called for. If the criteria is the same as the last
1613
// one, just return the collection.
1614
criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1615                      if (!lastDependsRelatedByObservedIdCriteria.equals(criteria))
1616                {
1617                    collDependsRelatedByObservedId = DependPeer.doSelect(criteria);
1618                }
1619            }
1620        }
1621        lastDependsRelatedByObservedIdCriteria = criteria;
1622
1623        return collDependsRelatedByObservedId;
1624    }
1625
1626    /**
1627     * If this collection has already been initialized, returns
1628     * the collection. Otherwise returns the results of
1629     * getDependsRelatedByObservedId(new Criteria(),Connection)
1630     * This method takes in the Connection also as input so that
1631     * referenced objects can also be obtained using a Connection
1632     * that is taken as input
1633     */

1634    public List JavaDoc getDependsRelatedByObservedId(Connection JavaDoc con) throws TorqueException
1635    {
1636        if (collDependsRelatedByObservedId == null)
1637        {
1638            collDependsRelatedByObservedId = getDependsRelatedByObservedId(new Criteria(10),con);
1639        }
1640        return collDependsRelatedByObservedId;
1641    }
1642
1643    /**
1644     * If this collection has already been initialized with
1645     * an identical criteria, it returns the collection.
1646     * Otherwise if this Issue has previously
1647     * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1648     * If this Issue is new, it will return
1649     * an empty collection or the current collection, the criteria
1650     * is ignored on a new object.
1651     * This method takes in the Connection also as input so that
1652     * referenced objects can also be obtained using a Connection
1653     * that is taken as input
1654     */

1655    public List JavaDoc getDependsRelatedByObservedId(Criteria criteria,Connection JavaDoc con) throws TorqueException
1656    {
1657        if (collDependsRelatedByObservedId == null)
1658        {
1659            if (isNew())
1660            {
1661               collDependsRelatedByObservedId = new ArrayList JavaDoc();
1662            }
1663            else
1664            {
1665                       criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1666                       collDependsRelatedByObservedId = DependPeer.doSelect(criteria,con);
1667             }
1668         }
1669         else
1670         {
1671             // criteria has no effect for a new object
1672
if (!isNew())
1673             {
1674                 // the following code is to determine if a new query is
1675
// called for. If the criteria is the same as the last
1676
// one, just return the collection.
1677
criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1678                     if (!lastDependsRelatedByObservedIdCriteria.equals(criteria))
1679                 {
1680                     collDependsRelatedByObservedId = DependPeer.doSelect(criteria,con);
1681                 }
1682             }
1683         }
1684         lastDependsRelatedByObservedIdCriteria = criteria;
1685
1686         return collDependsRelatedByObservedId;
1687     }
1688
1689                              
1690              
1691                    
1692                              
1693                                            
1694                                                                          
1695                                        
1696                    
1697                                            
1698                  
1699                    
1700                              
1701                                            
1702                                                                          
1703                                        
1704                    
1705                                
1706          
1707    /**
1708     * If this collection has already been initialized with
1709     * an identical criteria, it returns the collection.
1710     * Otherwise if this Issue is new, it will return
1711     * an empty collection; or if this Issue has previously
1712     * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1713     *
1714     * This method is protected by default in order to keep the public
1715     * api reasonable. You can provide public methods for those you
1716     * actually need in Issue.
1717     */

1718    protected List JavaDoc getDependsRelatedByObservedIdJoinIssueRelatedByObserverId(Criteria criteria)
1719        throws TorqueException
1720    {
1721        if (collDependsRelatedByObservedId == null)
1722        {
1723            if (isNew())
1724            {
1725               collDependsRelatedByObservedId = new ArrayList JavaDoc();
1726            }
1727            else
1728            {
1729                            criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1730                            collDependsRelatedByObservedId = DependPeer.doSelectJoinIssueRelatedByObserverId(criteria);
1731            }
1732        }
1733        else
1734        {
1735            // the following code is to determine if a new query is
1736
// called for. If the criteria is the same as the last
1737
// one, just return the collection.
1738

1739                            criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1740                        if (!lastDependsRelatedByObservedIdCriteria.equals(criteria))
1741            {
1742                collDependsRelatedByObservedId = DependPeer.doSelectJoinIssueRelatedByObserverId(criteria);
1743            }
1744        }
1745        lastDependsRelatedByObservedIdCriteria = criteria;
1746
1747        return collDependsRelatedByObservedId;
1748    }
1749                  
1750                    
1751                    
1752                                
1753                                                              
1754                                        
1755                    
1756                                
1757          
1758    /**
1759     * If this collection has already been initialized with
1760     * an identical criteria, it returns the collection.
1761     * Otherwise if this Issue is new, it will return
1762     * an empty collection; or if this Issue has previously
1763     * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1764     *
1765     * This method is protected by default in order to keep the public
1766     * api reasonable. You can provide public methods for those you
1767     * actually need in Issue.
1768     */

1769    protected List JavaDoc getDependsRelatedByObservedIdJoinDependType(Criteria criteria)
1770        throws TorqueException
1771    {
1772        if (collDependsRelatedByObservedId == null)
1773        {
1774            if (isNew())
1775            {
1776               collDependsRelatedByObservedId = new ArrayList JavaDoc();
1777            }
1778            else
1779            {
1780                            criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1781                            collDependsRelatedByObservedId = DependPeer.doSelectJoinDependType(criteria);
1782            }
1783        }
1784        else
1785        {
1786            // the following code is to determine if a new query is
1787
// called for. If the criteria is the same as the last
1788
// one, just return the collection.
1789

1790                            criteria.add(DependPeer.OBSERVED_ID, getIssueId() );
1791                        if (!lastDependsRelatedByObservedIdCriteria.equals(criteria))
1792            {
1793                collDependsRelatedByObservedId = DependPeer.doSelectJoinDependType(criteria);
1794            }
1795        }
1796        lastDependsRelatedByObservedIdCriteria = criteria;
1797
1798        return collDependsRelatedByObservedId;
1799    }
1800                            
1801
1802
1803                                  
1804            
1805    /**
1806     * Collection to store aggregation of collDependsRelatedByObserverId
1807     */

1808    protected List JavaDoc collDependsRelatedByObserverId;
1809
1810    /**
1811     * Temporary storage of collDependsRelatedByObserverId to save a possible db hit in
1812     * the event objects are add to the collection, but the
1813     * complete collection is never requested.
1814     */

1815    protected void initDependsRelatedByObserverId()
1816    {
1817        if (collDependsRelatedByObserverId == null)
1818        {
1819            collDependsRelatedByObserverId = new ArrayList JavaDoc();
1820        }
1821    }
1822
1823            
1824    /**
1825     * Method called to associate a Depend object to this object
1826     * through the Depend foreign key attribute
1827     *
1828     * @param l Depend
1829     * @throws TorqueException
1830     */

1831    public void addDependRelatedByObserverId(Depend l) throws TorqueException
1832    {
1833        getDependsRelatedByObserverId().add(l);
1834        l.setIssueRelatedByObserverId((Issue)this);
1835    }
1836
1837    /**
1838     * The criteria used to select the current contents of collDependsRelatedByObserverId
1839     */

1840    private Criteria lastDependsRelatedByObserverIdCriteria = null;
1841
1842    /**
1843     * If this collection has already been initialized, returns
1844     * the collection. Otherwise returns the results of
1845     * getDependsRelatedByObserverId(new Criteria())
1846     *
1847     * @throws TorqueException
1848     */

1849    public List JavaDoc getDependsRelatedByObserverId() throws TorqueException
1850    {
1851        if (collDependsRelatedByObserverId == null)
1852        {
1853            collDependsRelatedByObserverId = getDependsRelatedByObserverId(new Criteria(10));
1854        }
1855        return collDependsRelatedByObserverId;
1856    }
1857
1858    /**
1859     * If this collection has already been initialized with
1860     * an identical criteria, it returns the collection.
1861     * Otherwise if this Issue has previously
1862     * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1863     * If this Issue is new, it will return
1864     * an empty collection or the current collection, the criteria
1865     * is ignored on a new object.
1866     *
1867     * @throws TorqueException
1868     */

1869    public List JavaDoc getDependsRelatedByObserverId(Criteria criteria) throws TorqueException
1870    {
1871        if (collDependsRelatedByObserverId == null)
1872        {
1873            if (isNew())
1874            {
1875               collDependsRelatedByObserverId = new ArrayList JavaDoc();
1876            }
1877            else
1878            {
1879                      criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
1880                      collDependsRelatedByObserverId = DependPeer.doSelect(criteria);
1881            }
1882        }
1883        else
1884        {
1885            // criteria has no effect for a new object
1886
if (!isNew())
1887            {
1888                // the following code is to determine if a new query is
1889
// called for. If the criteria is the same as the last
1890
// one, just return the collection.
1891
criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
1892                      if (!lastDependsRelatedByObserverIdCriteria.equals(criteria))
1893                {
1894                    collDependsRelatedByObserverId = DependPeer.doSelect(criteria);
1895                }
1896            }
1897        }
1898        lastDependsRelatedByObserverIdCriteria = criteria;
1899
1900        return collDependsRelatedByObserverId;
1901    }
1902
1903    /**
1904     * If this collection has already been initialized, returns
1905     * the collection. Otherwise returns the results of
1906     * getDependsRelatedByObserverId(new Criteria(),Connection)
1907     * This method takes in the Connection also as input so that
1908     * referenced objects can also be obtained using a Connection
1909     * that is taken as input
1910     */

1911    public List JavaDoc getDependsRelatedByObserverId(Connection JavaDoc con) throws TorqueException
1912    {
1913        if (collDependsRelatedByObserverId == null)
1914        {
1915            collDependsRelatedByObserverId = getDependsRelatedByObserverId(new Criteria(10),con);
1916        }
1917        return collDependsRelatedByObserverId;
1918    }
1919
1920    /**
1921     * If this collection has already been initialized with
1922     * an identical criteria, it returns the collection.
1923     * Otherwise if this Issue has previously
1924     * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1925     * If this Issue is new, it will return
1926     * an empty collection or the current collection, the criteria
1927     * is ignored on a new object.
1928     * This method takes in the Connection also as input so that
1929     * referenced objects can also be obtained using a Connection
1930     * that is taken as input
1931     */

1932    public List JavaDoc getDependsRelatedByObserverId(Criteria criteria,Connection JavaDoc con) throws TorqueException
1933    {
1934        if (collDependsRelatedByObserverId == null)
1935        {
1936            if (isNew())
1937            {
1938               collDependsRelatedByObserverId = new ArrayList JavaDoc();
1939            }
1940            else
1941            {
1942                       criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
1943                       collDependsRelatedByObserverId = DependPeer.doSelect(criteria,con);
1944             }
1945         }
1946         else
1947         {
1948             // criteria has no effect for a new object
1949
if (!isNew())
1950             {
1951                 // the following code is to determine if a new query is
1952
// called for. If the criteria is the same as the last
1953
// one, just return the collection.
1954
criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
1955                     if (!lastDependsRelatedByObserverIdCriteria.equals(criteria))
1956                 {
1957                     collDependsRelatedByObserverId = DependPeer.doSelect(criteria,con);
1958                 }
1959             }
1960         }
1961         lastDependsRelatedByObserverIdCriteria = criteria;
1962
1963         return collDependsRelatedByObserverId;
1964     }
1965
1966                              
1967              
1968                    
1969                              
1970                                            
1971                                                                          
1972                                        
1973                    
1974                                
1975          
1976    /**
1977     * If this collection has already been initialized with
1978     * an identical criteria, it returns the collection.
1979     * Otherwise if this Issue is new, it will return
1980     * an empty collection; or if this Issue has previously
1981     * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1982     *
1983     * This method is protected by default in order to keep the public
1984     * api reasonable. You can provide public methods for those you
1985     * actually need in Issue.
1986     */

1987    protected List JavaDoc getDependsRelatedByObserverIdJoinIssueRelatedByObservedId(Criteria criteria)
1988        throws TorqueException
1989    {
1990        if (collDependsRelatedByObserverId == null)
1991        {
1992            if (isNew())
1993            {
1994               collDependsRelatedByObserverId = new ArrayList JavaDoc();
1995            }
1996            else
1997            {
1998                            criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
1999                            collDependsRelatedByObserverId = DependPeer.doSelectJoinIssueRelatedByObservedId(criteria);
2000            }
2001        }
2002        else
2003        {
2004            // the following code is to determine if a new query is
2005
// called for. If the criteria is the same as the last
2006
// one, just return the collection.
2007

2008                            criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
2009                        if (!lastDependsRelatedByObserverIdCriteria.equals(criteria))
2010            {
2011                collDependsRelatedByObserverId = DependPeer.doSelectJoinIssueRelatedByObservedId(criteria);
2012            }
2013        }
2014        lastDependsRelatedByObserverIdCriteria = criteria;
2015
2016        return collDependsRelatedByObserverId;
2017    }
2018                  
2019                    
2020                              
2021                                            
2022                                                                          
2023                                        
2024                    
2025                                            
2026                  
2027                    
2028                    
2029                                
2030                                                              
2031                                        
2032                    
2033                                
2034          
2035    /**
2036     * If this collection has already been initialized with
2037     * an identical criteria, it returns the collection.
2038     * Otherwise if this Issue is new, it will return
2039     * an empty collection; or if this Issue has previously
2040     * been saved, it will retrieve related DependsRelatedByObserverId from storage.
2041     *
2042     * This method is protected by default in order to keep the public
2043     * api reasonable. You can provide public methods for those you
2044     * actually need in Issue.
2045     */

2046    protected List JavaDoc getDependsRelatedByObserverIdJoinDependType(Criteria criteria)
2047        throws TorqueException
2048    {
2049        if (collDependsRelatedByObserverId == null)
2050        {
2051            if (isNew())
2052            {
2053               collDependsRelatedByObserverId = new ArrayList JavaDoc();
2054            }
2055            else
2056            {
2057                            criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
2058                            collDependsRelatedByObserverId = DependPeer.doSelectJoinDependType(criteria);
2059            }
2060        }
2061        else
2062        {
2063            // the following code is to determine if a new query is
2064
// called for. If the criteria is the same as the last
2065
// one, just return the collection.
2066

2067                            criteria.add(DependPeer.OBSERVER_ID, getIssueId() );
2068                        if (!lastDependsRelatedByObserverIdCriteria.equals(criteria))
2069            {
2070                collDependsRelatedByObserverId = DependPeer.doSelectJoinDependType(criteria);
2071            }
2072        }
2073        lastDependsRelatedByObserverIdCriteria = criteria;
2074
2075        return collDependsRelatedByObserverId;
2076    }
2077                            
2078
2079
2080                          
2081            
2082    /**
2083     * Collection to store aggregation of collAttributeValues
2084     */

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

2092    protected void initAttributeValues()
2093    {
2094        if (collAttributeValues == null)
2095        {
2096            collAttributeValues = new ArrayList JavaDoc();
2097        }
2098    }
2099
2100            
2101    /**
2102     * Method called to associate a AttributeValue object to this object
2103     * through the AttributeValue foreign key attribute
2104     *
2105     * @param l AttributeValue
2106     * @throws TorqueException
2107     */

2108    public void addAttributeValue(AttributeValue l) throws TorqueException
2109    {
2110        getAttributeValues().add(l);
2111        l.setIssue((Issue)this);
2112    }
2113
2114    /**
2115     * The criteria used to select the current contents of collAttributeValues
2116     */

2117    private Criteria lastAttributeValuesCriteria = null;
2118
2119    /**
2120     * If this collection has already been initialized, returns
2121     * the collection. Otherwise returns the results of
2122     * getAttributeValues(new Criteria())
2123     *
2124     * @throws TorqueException
2125     */

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

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

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

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

2264    protected List JavaDoc getAttributeValuesJoinIssue(Criteria criteria)
2265        throws TorqueException
2266    {
2267        if (collAttributeValues == null)
2268        {
2269            if (isNew())
2270            {
2271               collAttributeValues = new ArrayList JavaDoc();
2272            }
2273            else
2274            {
2275                            criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() );
2276                            collAttributeValues = AttributeValuePeer.doSelectJoinIssue(criteria);
2277            }
2278        }
2279        else
2280        {
2281            // the following code is to determine if a new query is
2282
// called for. If the criteria is the same as the last
2283
// one, just return the collection.
2284

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

2315    protected List JavaDoc getAttributeValuesJoinAttribute(Criteria criteria)
2316        throws TorqueException
2317    {
2318        if (collAttributeValues == null)
2319        {
2320            if (isNew())
2321            {
2322               collAttributeValues = new ArrayList JavaDoc();
2323            }
2324            else
2325            {
2326                            criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() );
2327                            collAttributeValues = AttributeValuePeer.doSelectJoinAttribute(criteria);
2328            }
2329        }
2330        else
2331        {
2332            // the following code is to determine if a new query is
2333
// called for. If the criteria is the same as the last
2334
// one, just return the collection.
2335

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

2366    protected List JavaDoc getAttributeValuesJoinAttributeOption(Criteria criteria)
2367        throws TorqueException
2368    {
2369        if (collAttributeValues == null)
2370        {
2371            if (isNew())
2372            {
2373               collAttributeValues = new ArrayList JavaDoc();
2374            }
2375            else
2376            {
2377                            criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() );
2378                            collAttributeValues = AttributeValuePeer.doSelectJoinAttributeOption(criteria);
2379            }
2380        }
2381        else
2382        {
2383            // the following code is to determine if a new query is
2384
// called for. If the criteria is the same as the last
2385
// one, just return the collection.
2386

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

2417    protected List JavaDoc getAttributeValuesJoinScarabUserImpl(Criteria criteria)
2418        throws TorqueException
2419    {
2420        if (collAttributeValues == null)
2421        {
2422            if (isNew())
2423            {
2424               collAttributeValues = new ArrayList JavaDoc();
2425            }
2426            else
2427            {
2428                            criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() );
2429                            collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria);
2430            }
2431        }
2432        else
2433        {
2434            // the following code is to determine if a new query is
2435
// called for. If the criteria is the same as the last
2436
// one, just return the collection.
2437

2438                            criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() );
2439                        if (!lastAttributeValuesCriteria.equals(criteria))
2440            {
2441                collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria);
2442            }
2443        }
2444        lastAttributeValuesCriteria = criteria;
2445
2446        return collAttributeValues;
2447    }
2448                            
2449
2450
2451                          
2452            
2453    /**
2454     * Collection to store aggregation of collIssueVotes
2455     */

2456    protected List JavaDoc collIssueVotes;
2457
2458    /**
2459     * Temporary storage of collIssueVotes to save a possible db hit in
2460     * the event objects are add to the collection, but the
2461     * complete collection is never requested.
2462     */

2463    protected void initIssueVotes()
2464    {
2465        if (collIssueVotes == null)
2466        {
2467            collIssueVotes = new ArrayList JavaDoc();
2468        }
2469    }
2470
2471            
2472    /**
2473     * Method called to associate a IssueVote object to this object
2474     * through the IssueVote foreign key attribute
2475     *
2476     * @param l IssueVote
2477     * @throws TorqueException
2478     */

2479    public void addIssueVote(IssueVote l) throws TorqueException
2480    {
2481        getIssueVotes().add(l);
2482        l.setIssue((Issue)this);
2483    }
2484
2485    /**
2486     * The criteria used to select the current contents of collIssueVotes
2487     */

2488    private Criteria lastIssueVotesCriteria = null;
2489
2490    /**
2491     * If this collection has already been initialized, returns
2492     * the collection. Otherwise returns the results of
2493     * getIssueVotes(new Criteria())
2494     *
2495     * @throws TorqueException
2496     */

2497    public List JavaDoc getIssueVotes() throws TorqueException
2498    {
2499        if (collIssueVotes == null)
2500        {
2501            collIssueVotes = getIssueVotes(new Criteria(10));
2502        }
2503        return collIssueVotes;
2504    }
2505
2506    /**
2507     * If this collection has already been initialized with
2508     * an identical criteria, it returns the collection.
2509     * Otherwise if this Issue has previously
2510     * been saved, it will retrieve related IssueVotes from storage.
2511     * If this Issue is new, it will return
2512     * an empty collection or the current collection, the criteria
2513     * is ignored on a new object.
2514     *
2515     * @throws TorqueException
2516     */

2517    public List JavaDoc getIssueVotes(Criteria criteria) throws TorqueException
2518    {
2519        if (collIssueVotes == null)
2520        {
2521            if (isNew())
2522            {
2523               collIssueVotes = new ArrayList JavaDoc();
2524            }
2525            else
2526            {
2527                      criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2528                      collIssueVotes = IssueVotePeer.doSelect(criteria);
2529            }
2530        }
2531        else
2532        {
2533            // criteria has no effect for a new object
2534
if (!isNew())
2535            {
2536                // the following code is to determine if a new query is
2537
// called for. If the criteria is the same as the last
2538
// one, just return the collection.
2539
criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2540                      if (!lastIssueVotesCriteria.equals(criteria))
2541                {
2542                    collIssueVotes = IssueVotePeer.doSelect(criteria);
2543                }
2544            }
2545        }
2546        lastIssueVotesCriteria = criteria;
2547
2548        return collIssueVotes;
2549    }
2550
2551    /**
2552     * If this collection has already been initialized, returns
2553     * the collection. Otherwise returns the results of
2554     * getIssueVotes(new Criteria(),Connection)
2555     * This method takes in the Connection also as input so that
2556     * referenced objects can also be obtained using a Connection
2557     * that is taken as input
2558     */

2559    public List JavaDoc getIssueVotes(Connection JavaDoc con) throws TorqueException
2560    {
2561        if (collIssueVotes == null)
2562        {
2563            collIssueVotes = getIssueVotes(new Criteria(10),con);
2564        }
2565        return collIssueVotes;
2566    }
2567
2568    /**
2569     * If this collection has already been initialized with
2570     * an identical criteria, it returns the collection.
2571     * Otherwise if this Issue has previously
2572     * been saved, it will retrieve related IssueVotes from storage.
2573     * If this Issue is new, it will return
2574     * an empty collection or the current collection, the criteria
2575     * is ignored on a new object.
2576     * This method takes in the Connection also as input so that
2577     * referenced objects can also be obtained using a Connection
2578     * that is taken as input
2579     */

2580    public List JavaDoc getIssueVotes(Criteria criteria,Connection JavaDoc con) throws TorqueException
2581    {
2582        if (collIssueVotes == null)
2583        {
2584            if (isNew())
2585            {
2586               collIssueVotes = new ArrayList JavaDoc();
2587            }
2588            else
2589            {
2590                       criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2591                       collIssueVotes = IssueVotePeer.doSelect(criteria,con);
2592             }
2593         }
2594         else
2595         {
2596             // criteria has no effect for a new object
2597
if (!isNew())
2598             {
2599                 // the following code is to determine if a new query is
2600
// called for. If the criteria is the same as the last
2601
// one, just return the collection.
2602
criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2603                     if (!lastIssueVotesCriteria.equals(criteria))
2604                 {
2605                     collIssueVotes = IssueVotePeer.doSelect(criteria,con);
2606                 }
2607             }
2608         }
2609         lastIssueVotesCriteria = criteria;
2610
2611         return collIssueVotes;
2612     }
2613
2614                        
2615              
2616                    
2617                              
2618                                
2619                                                              
2620                                        
2621                    
2622                    
2623          
2624    /**
2625     * If this collection has already been initialized with
2626     * an identical criteria, it returns the collection.
2627     * Otherwise if this Issue is new, it will return
2628     * an empty collection; or if this Issue has previously
2629     * been saved, it will retrieve related IssueVotes from storage.
2630     *
2631     * This method is protected by default in order to keep the public
2632     * api reasonable. You can provide public methods for those you
2633     * actually need in Issue.
2634     */

2635    protected List JavaDoc getIssueVotesJoinIssue(Criteria criteria)
2636        throws TorqueException
2637    {
2638        if (collIssueVotes == null)
2639        {
2640            if (isNew())
2641            {
2642               collIssueVotes = new ArrayList JavaDoc();
2643            }
2644            else
2645            {
2646                            criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2647                            collIssueVotes = IssueVotePeer.doSelectJoinIssue(criteria);
2648            }
2649        }
2650        else
2651        {
2652            // the following code is to determine if a new query is
2653
// called for. If the criteria is the same as the last
2654
// one, just return the collection.
2655

2656                            criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2657                        if (!lastIssueVotesCriteria.equals(criteria))
2658            {
2659                collIssueVotes = IssueVotePeer.doSelectJoinIssue(criteria);
2660            }
2661        }
2662        lastIssueVotesCriteria = criteria;
2663
2664        return collIssueVotes;
2665    }
2666                  
2667                    
2668                    
2669                                
2670                                                              
2671                                        
2672                    
2673                    
2674          
2675    /**
2676     * If this collection has already been initialized with
2677     * an identical criteria, it returns the collection.
2678     * Otherwise if this Issue is new, it will return
2679     * an empty collection; or if this Issue has previously
2680     * been saved, it will retrieve related IssueVotes from storage.
2681     *
2682     * This method is protected by default in order to keep the public
2683     * api reasonable. You can provide public methods for those you
2684     * actually need in Issue.
2685     */

2686    protected List JavaDoc getIssueVotesJoinScarabUserImpl(Criteria criteria)
2687        throws TorqueException
2688    {
2689        if (collIssueVotes == null)
2690        {
2691            if (isNew())
2692            {
2693               collIssueVotes = new ArrayList JavaDoc();
2694            }
2695            else
2696            {
2697                            criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2698                            collIssueVotes = IssueVotePeer.doSelectJoinScarabUserImpl(criteria);
2699            }
2700        }
2701        else
2702        {
2703            // the following code is to determine if a new query is
2704
// called for. If the criteria is the same as the last
2705
// one, just return the collection.
2706

2707                            criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() );
2708                        if (!lastIssueVotesCriteria.equals(criteria))
2709            {
2710                collIssueVotes = IssueVotePeer.doSelectJoinScarabUserImpl(criteria);
2711            }
2712        }
2713        lastIssueVotesCriteria = criteria;
2714
2715        return collIssueVotes;
2716    }
2717                            
2718
2719
2720                          
2721            
2722    /**
2723     * Collection to store aggregation of collIssueTemplateInfos
2724     */

2725    protected List JavaDoc collIssueTemplateInfos;
2726
2727    /**
2728     * Temporary storage of collIssueTemplateInfos to save a possible db hit in
2729     * the event objects are add to the collection, but the
2730     * complete collection is never requested.
2731     */

2732    protected void initIssueTemplateInfos()
2733    {
2734        if (collIssueTemplateInfos == null)
2735        {
2736            collIssueTemplateInfos = new ArrayList JavaDoc();
2737        }
2738    }
2739
2740            
2741    /**
2742     * Method called to associate a IssueTemplateInfo object to this object
2743     * through the IssueTemplateInfo foreign key attribute
2744     *
2745     * @param l IssueTemplateInfo
2746     * @throws TorqueException
2747     */

2748    public void addIssueTemplateInfo(IssueTemplateInfo l) throws TorqueException
2749    {
2750        getIssueTemplateInfos().add(l);
2751        l.setIssue((Issue)this);
2752    }
2753
2754    /**
2755     * The criteria used to select the current contents of collIssueTemplateInfos
2756     */

2757    private Criteria lastIssueTemplateInfosCriteria = null;
2758
2759    /**
2760     * If this collection has already been initialized, returns
2761     * the collection. Otherwise returns the results of
2762     * getIssueTemplateInfos(new Criteria())
2763     *
2764     * @throws TorqueException
2765     */

2766    public List JavaDoc getIssueTemplateInfos() throws TorqueException
2767    {
2768        if (collIssueTemplateInfos == null)
2769        {
2770            collIssueTemplateInfos = getIssueTemplateInfos(new Criteria(10));
2771        }
2772        return collIssueTemplateInfos;
2773    }
2774
2775    /**
2776     * If this collection has already been initialized with
2777     * an identical criteria, it returns the collection.
2778     * Otherwise if this Issue has previously
2779     * been saved, it will retrieve related IssueTemplateInfos from storage.
2780     * If this Issue is new, it will return
2781     * an empty collection or the current collection, the criteria
2782     * is ignored on a new object.
2783     *
2784     * @throws TorqueException
2785     */

2786    public List JavaDoc getIssueTemplateInfos(Criteria criteria) throws TorqueException
2787    {
2788        if (collIssueTemplateInfos == null)
2789        {
2790            if (isNew())
2791            {
2792               collIssueTemplateInfos = new ArrayList JavaDoc();
2793            }
2794            else
2795            {
2796                      criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2797                      collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria);
2798            }
2799        }
2800        else
2801        {
2802            // criteria has no effect for a new object
2803
if (!isNew())
2804            {
2805                // the following code is to determine if a new query is
2806
// called for. If the criteria is the same as the last
2807
// one, just return the collection.
2808
criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2809                      if (!lastIssueTemplateInfosCriteria.equals(criteria))
2810                {
2811                    collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria);
2812                }
2813            }
2814        }
2815        lastIssueTemplateInfosCriteria = criteria;
2816
2817        return collIssueTemplateInfos;
2818    }
2819
2820    /**
2821     * If this collection has already been initialized, returns
2822     * the collection. Otherwise returns the results of
2823     * getIssueTemplateInfos(new Criteria(),Connection)
2824     * This method takes in the Connection also as input so that
2825     * referenced objects can also be obtained using a Connection
2826     * that is taken as input
2827     */

2828    public List JavaDoc getIssueTemplateInfos(Connection JavaDoc con) throws TorqueException
2829    {
2830        if (collIssueTemplateInfos == null)
2831        {
2832            collIssueTemplateInfos = getIssueTemplateInfos(new Criteria(10),con);
2833        }
2834        return collIssueTemplateInfos;
2835    }
2836
2837    /**
2838     * If this collection has already been initialized with
2839     * an identical criteria, it returns the collection.
2840     * Otherwise if this Issue has previously
2841     * been saved, it will retrieve related IssueTemplateInfos from storage.
2842     * If this Issue is new, it will return
2843     * an empty collection or the current collection, the criteria
2844     * is ignored on a new object.
2845     * This method takes in the Connection also as input so that
2846     * referenced objects can also be obtained using a Connection
2847     * that is taken as input
2848     */

2849    public List JavaDoc getIssueTemplateInfos(Criteria criteria,Connection JavaDoc con) throws TorqueException
2850    {
2851        if (collIssueTemplateInfos == null)
2852        {
2853            if (isNew())
2854            {
2855               collIssueTemplateInfos = new ArrayList JavaDoc();
2856            }
2857            else
2858            {
2859                       criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2860                       collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria,con);
2861             }
2862         }
2863         else
2864         {
2865             // criteria has no effect for a new object
2866
if (!isNew())
2867             {
2868                 // the following code is to determine if a new query is
2869
// called for. If the criteria is the same as the last
2870
// one, just return the collection.
2871
criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2872                     if (!lastIssueTemplateInfosCriteria.equals(criteria))
2873                 {
2874                     collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria,con);
2875                 }
2876             }
2877         }
2878         lastIssueTemplateInfosCriteria = criteria;
2879
2880         return collIssueTemplateInfos;
2881     }
2882
2883                        
2884              
2885                    
2886                              
2887                                
2888                                                              
2889                                        
2890                    
2891                    
2892          
2893    /**
2894     * If this collection has already been initialized with
2895     * an identical criteria, it returns the collection.
2896     * Otherwise if this Issue is new, it will return
2897     * an empty collection; or if this Issue has previously
2898     * been saved, it will retrieve related IssueTemplateInfos from storage.
2899     *
2900     * This method is protected by default in order to keep the public
2901     * api reasonable. You can provide public methods for those you
2902     * actually need in Issue.
2903     */

2904    protected List JavaDoc getIssueTemplateInfosJoinIssue(Criteria criteria)
2905        throws TorqueException
2906    {
2907        if (collIssueTemplateInfos == null)
2908        {
2909            if (isNew())
2910            {
2911               collIssueTemplateInfos = new ArrayList JavaDoc();
2912            }
2913            else
2914            {
2915                            criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2916                            collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinIssue(criteria);
2917            }
2918        }
2919        else
2920        {
2921            // the following code is to determine if a new query is
2922
// called for. If the criteria is the same as the last
2923
// one, just return the collection.
2924

2925                            criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2926                        if (!lastIssueTemplateInfosCriteria.equals(criteria))
2927            {
2928                collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinIssue(criteria);
2929            }
2930        }
2931        lastIssueTemplateInfosCriteria = criteria;
2932
2933        return collIssueTemplateInfos;
2934    }
2935                  
2936                    
2937                    
2938                                
2939                                                              
2940                                        
2941                    
2942                    
2943          
2944    /**
2945     * If this collection has already been initialized with
2946     * an identical criteria, it returns the collection.
2947     * Otherwise if this Issue is new, it will return
2948     * an empty collection; or if this Issue has previously
2949     * been saved, it will retrieve related IssueTemplateInfos from storage.
2950     *
2951     * This method is protected by default in order to keep the public
2952     * api reasonable. You can provide public methods for those you
2953     * actually need in Issue.
2954     */

2955    protected List JavaDoc getIssueTemplateInfosJoinScope(Criteria criteria)
2956        throws TorqueException
2957    {
2958        if (collIssueTemplateInfos == null)
2959        {
2960            if (isNew())
2961            {
2962               collIssueTemplateInfos = new ArrayList JavaDoc();
2963            }
2964            else
2965            {
2966                            criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2967                            collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinScope(criteria);
2968            }
2969        }
2970        else
2971        {
2972            // the following code is to determine if a new query is
2973
// called for. If the criteria is the same as the last
2974
// one, just return the collection.
2975

2976                            criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() );
2977                        if (!lastIssueTemplateInfosCriteria.equals(criteria))
2978            {
2979                collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinScope(criteria);
2980            }
2981        }
2982        lastIssueTemplateInfosCriteria = criteria;
2983
2984        return collIssueTemplateInfos;
2985    }
2986                            
2987
2988
2989          
2990    private static List JavaDoc fieldNames = null;
2991
2992    /**
2993     * Generate a list of field names.
2994     *
2995     * @return a list of field names
2996     */

2997    public static synchronized List JavaDoc getFieldNames()
2998    {
2999        if (fieldNames == null)
3000        {
3001            fieldNames = new ArrayList JavaDoc();
3002              fieldNames.add("IssueId");
3003              fieldNames.add("IdPrefix");
3004              fieldNames.add("IdCount");
3005              fieldNames.add("IdDomain");
3006              fieldNames.add("TypeId");
3007              fieldNames.add("ModuleId");
3008              fieldNames.add("CreatedTransId");
3009              fieldNames.add("Deleted");
3010              fieldNames = Collections.unmodifiableList(fieldNames);
3011        }
3012        return fieldNames;
3013    }
3014
3015    /**
3016     * Retrieves a field from the object by name passed in as a String.
3017     *
3018     * @param name field name
3019     * @return value
3020     */

3021    public Object JavaDoc getByName(String JavaDoc name)
3022    {
3023          if (name.equals("IssueId"))
3024        {
3025                return getIssueId();
3026            }
3027          if (name.equals("IdPrefix"))
3028        {
3029                return getIdPrefix();
3030            }
3031          if (name.equals("IdCount"))
3032        {
3033                return new Integer JavaDoc(getIdCount());
3034            }
3035          if (name.equals("IdDomain"))
3036        {
3037                return getIdDomain();
3038            }
3039          if (name.equals("TypeId"))
3040        {
3041                return getTypeId();
3042            }
3043          if (name.equals("ModuleId"))
3044        {
3045                return getModuleId();
3046            }
3047          if (name.equals("CreatedTransId"))
3048        {
3049                return getCreatedTransId();
3050            }
3051          if (name.equals("Deleted"))
3052        {
3053                return Boolean.valueOf(getDeleted());
3054            }
3055          return null;
3056    }
3057    
3058    /**
3059     * Retrieves a field from the object by name passed in
3060     * as a String. The String must be one of the static
3061     * Strings defined in this Class' Peer.
3062     *
3063     * @param name peer name
3064     * @return value
3065     */

3066    public Object JavaDoc getByPeerName(String JavaDoc name)
3067    {
3068          if (name.equals(IssuePeer.ISSUE_ID))
3069        {
3070                return getIssueId();
3071            }
3072          if (name.equals(IssuePeer.ID_PREFIX))
3073        {
3074                return getIdPrefix();
3075            }
3076          if (name.equals(IssuePeer.ID_COUNT))
3077        {
3078                return new Integer JavaDoc(getIdCount());
3079            }
3080          if (name.equals(IssuePeer.ID_DOMAIN))
3081        {
3082                return getIdDomain();
3083            }
3084          if (name.equals(IssuePeer.TYPE_ID))
3085        {
3086                return getTypeId();
3087            }
3088          if (name.equals(IssuePeer.MODULE_ID))
3089        {
3090                return getModuleId();
3091            }
3092          if (name.equals(IssuePeer.CREATED_TRANS_ID))
3093        {
3094                return getCreatedTransId();
3095            }
3096          if (name.equals(IssuePeer.DELETED))
3097        {
3098                return Boolean.valueOf(getDeleted());
3099            }
3100          return null;
3101    }
3102
3103    /**
3104     * Retrieves a field from the object by Position as specified
3105     * in the xml schema. Zero-based.
3106     *
3107     * @param pos position in xml schema
3108     * @return value
3109     */

3110    public Object JavaDoc getByPosition(int pos)
3111    {
3112            if (pos == 0)
3113        {
3114                return getIssueId();
3115            }
3116              if (pos == 1)
3117        {
3118                return getIdPrefix();
3119            }
3120              if (pos == 2)
3121        {
3122                return new Integer JavaDoc(getIdCount());
3123            }
3124              if (pos == 3)
3125        {
3126                return getIdDomain();
3127            }
3128              if (pos == 4)
3129        {
3130                return getTypeId();
3131            }
3132              if (pos == 5)
3133        {
3134                return getModuleId();
3135            }
3136              if (pos == 6)
3137        {
3138                return getCreatedTransId();
3139            }
3140              if (pos == 7)
3141        {
3142                return Boolean.valueOf(getDeleted());
3143            }
3144              return null;
3145    }
3146     
3147    /**
3148     * Stores the object in the database. If the object is new,
3149     * it inserts it; otherwise an update is performed.
3150     *
3151     * @throws Exception
3152     */

3153    public void save() throws Exception JavaDoc
3154    {
3155          save(IssuePeer.getMapBuilder()
3156                .getDatabaseMap().getName());
3157      }
3158
3159    /**
3160     * Stores the object in the database. If the object is new,
3161     * it inserts it; otherwise an update is performed.
3162       * Note: this code is here because the method body is
3163     * auto-generated conditionally and therefore needs to be
3164     * in this file instead of in the super class, BaseObject.
3165       *
3166     * @param dbName
3167     * @throws TorqueException
3168     */

3169    public void save(String JavaDoc dbName) throws TorqueException
3170    {
3171        Connection JavaDoc con = null;
3172          try
3173        {
3174            con = Transaction.begin(dbName);
3175            save(con);
3176            Transaction.commit(con);
3177        }
3178        catch(TorqueException e)
3179        {
3180            Transaction.safeRollback(con);
3181            throw e;
3182        }
3183      }
3184
3185      /** flag to prevent endless save loop, if this object is referenced
3186        by another object which falls in this transaction. */

3187    private boolean alreadyInSave = false;
3188      /**
3189     * Stores the object in the database. If the object is new,
3190     * it inserts it; otherwise an update is performed. This method
3191     * is meant to be used as part of a transaction, otherwise use
3192     * the save() method and the connection details will be handled
3193     * internally
3194     *
3195     * @param con
3196     * @throws TorqueException
3197     */

3198    public void save(Connection JavaDoc con) throws TorqueException
3199    {
3200          if (!alreadyInSave)
3201        {
3202            alreadyInSave = true;
3203
3204
3205  
3206            // If this object has been modified, then save it to the database.
3207
if (isModified())
3208            {
3209                if (isNew())
3210                {
3211                    IssuePeer.doInsert((Issue)this, con);
3212                    setNew(false);
3213                }
3214                else
3215                {
3216                    IssuePeer.doUpdate((Issue)this, con);
3217                }
3218
3219                      if (isCacheOnSave())
3220                {
3221                    IssueManager.putInstance(this);
3222                }
3223              }
3224
3225                                      
3226                            if (collActivitys != null)
3227            {
3228                for (int i = 0; i < collActivitys.size(); i++)
3229                {
3230                    ((Activity)collActivitys.get(i)).save(con);
3231                }
3232            }
3233                                          
3234                            if (collAttachments != null)
3235            {
3236                for (int i = 0; i < collAttachments.size(); i++)
3237                {
3238                    ((Attachment)collAttachments.get(i)).save(con);
3239                }
3240            }
3241                                                    
3242                            if (collDependsRelatedByObservedId != null)
3243            {
3244                for (int i = 0; i < collDependsRelatedByObservedId.size(); i++)
3245                {
3246                    ((Depend)collDependsRelatedByObservedId.get(i)).save(con);
3247                }
3248            }
3249                                                    
3250                            if (collDependsRelatedByObserverId != null)
3251            {
3252                for (int i = 0; i < collDependsRelatedByObserverId.size(); i++)
3253                {
3254                    ((Depend)collDependsRelatedByObserverId.get(i)).save(con);
3255                }
3256            }
3257                                          
3258                            if (collAttributeValues != null)
3259            {
3260                for (int i = 0; i < collAttributeValues.size(); i++)
3261                {
3262                    ((AttributeValue)collAttributeValues.get(i)).save(con);
3263                }
3264            }
3265                                          
3266                            if (collIssueVotes != null)
3267            {
3268                for (int i = 0; i < collIssueVotes.size(); i++)
3269                {
3270                    ((IssueVote)collIssueVotes.get(i)).save(con);
3271                }
3272            }
3273                                          
3274                            if (collIssueTemplateInfos != null)
3275            {
3276                for (int i = 0; i < collIssueTemplateInfos.size(); i++)
3277                {
3278                    ((IssueTemplateInfo)collIssueTemplateInfos.get(i)).save(con);
3279                }
3280            }
3281                          alreadyInSave = false;
3282        }
3283      }
3284
3285    /**
3286     * Specify whether to cache the object after saving to the db.
3287     * This method returns false
3288     */

3289    protected boolean isCacheOnSave()
3290    {
3291        return true;
3292    }
3293
3294                        
3295      /**
3296     * Set the PrimaryKey using ObjectKey.
3297     *
3298     * @param issueId ObjectKey
3299     */

3300    public void setPrimaryKey(ObjectKey issueId)
3301        throws TorqueException {
3302            setIssueId(new Long JavaDoc(((NumberKey)issueId).longValue()));
3303        }
3304
3305    /**
3306     * Set the PrimaryKey using a String.
3307     *
3308     * @param key
3309     */

3310    public void setPrimaryKey(String JavaDoc key) throws TorqueException
3311    {
3312            setIssueId(new Long JavaDoc(key));
3313        }
3314
3315  
3316    /**
3317     * returns an id that differentiates this object from others
3318     * of its class.
3319     */

3320    public ObjectKey getPrimaryKey()
3321    {
3322          return SimpleKey.keyFor(getIssueId());
3323      }
3324 
3325    /**
3326     * get an id that differentiates this object from others
3327     * of its class.
3328     */

3329    public String JavaDoc getQueryKey()
3330    {
3331        if (getPrimaryKey() == null)
3332        {
3333            return "";
3334        }
3335        else
3336        {
3337            return getPrimaryKey().toString();
3338        }
3339    }
3340
3341    /**
3342     * set an id that differentiates this object from others
3343     * of its class.
3344     */

3345    public void setQueryKey(String JavaDoc key)
3346        throws TorqueException
3347    {
3348        setPrimaryKey(key);
3349    }
3350
3351    /**
3352     * Makes a copy of this object.
3353     * It creates a new object filling in the simple attributes.
3354       * It then fills all the association collections and sets the
3355     * related objects to isNew=true.
3356       */

3357      public Issue copy() throws TorqueException
3358    {
3359        Issue copyObj = new Issue();
3360            copyObj.setIssueId(issueId);
3361          copyObj.setIdPrefix(idPrefix);
3362          copyObj.setIdCount(idCount);
3363          copyObj.setIdDomain(idDomain);
3364          copyObj.setTypeId(typeId);
3365          copyObj.setModuleId(moduleId);
3366          copyObj.setCreatedTransId(createdTransId);
3367          copyObj.setDeleted(deleted);
3368  
3369                      copyObj.setIssueId((Long JavaDoc)null);
3370                                                      
3371                                      
3372                
3373        List JavaDoc v = getActivitys();
3374        for (int i = 0; i < v.size(); i++)
3375        {
3376            Activity obj = (Activity) v.get(i);
3377            copyObj.addActivity(obj.copy());
3378        }
3379                                                  
3380                
3381        v = getAttachments();
3382        for (int i = 0; i < v.size(); i++)
3383        {
3384            Attachment obj = (Attachment) v.get(i);
3385            copyObj.addAttachment(obj.copy());
3386        }
3387                                                            
3388                
3389        v = getDependsRelatedByObservedId();
3390        for (int i = 0; i < v.size(); i++)
3391        {
3392            Depend obj = (Depend) v.get(i);
3393            copyObj.addDependRelatedByObservedId(obj.copy());
3394        }
3395                                                            
3396                
3397        v = getDependsRelatedByObserverId();
3398        for (int i = 0; i < v.size(); i++)
3399        {
3400            Depend obj = (Depend) v.get(i);
3401            copyObj.addDependRelatedByObserverId(obj.copy());
3402        }
3403                                                  
3404                
3405        v = getAttributeValues();
3406        for (int i = 0; i < v.size(); i++)
3407        {
3408            AttributeValue obj = (AttributeValue) v.get(i);
3409            copyObj.addAttributeValue(obj.copy());
3410        }
3411                                                  
3412                
3413        v = getIssueVotes();
3414        for (int i = 0; i < v.size(); i++)
3415        {
3416            IssueVote obj = (IssueVote) v.get(i);
3417            copyObj.addIssueVote(obj.copy());
3418        }
3419                                                  
3420                
3421        v = getIssueTemplateInfos();
3422        for (int i = 0; i < v.size(); i++)
3423        {
3424            IssueTemplateInfo obj = (IssueTemplateInfo) v.get(i);
3425            copyObj.addIssueTemplateInfo(obj.copy());
3426        }
3427                            return copyObj;
3428    }
3429
3430    /**
3431     * returns a peer instance associated with this om. Since Peer classes
3432     * are not to have any instance attributes, this method returns the
3433     * same instance for all member of this class. The method could therefore
3434     * be static, but this would prevent one from overriding the behavior.
3435     */

3436    public IssuePeer getPeer()
3437    {
3438        return peer;
3439    }
3440
3441    public String JavaDoc toString()
3442    {
3443        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
3444        str.append("Issue:\n");
3445        str.append("IssueId = ")
3446               .append(getIssueId())
3447             .append("\n");
3448        str.append("IdPrefix = ")
3449               .append(getIdPrefix())
3450             .append("\n");
3451        str.append("IdCount = ")
3452               .append(getIdCount())
3453             .append("\n");
3454        str.append("IdDomain = ")
3455               .append(getIdDomain())
3456             .append("\n");
3457        str.append("TypeId = ")
3458               .append(getTypeId())
3459             .append("\n");
3460        str.append("ModuleId = ")
3461               .append(getModuleId())
3462             .append("\n");
3463        str.append("CreatedTransId = ")
3464               .append(getCreatedTransId())
3465             .append("\n");
3466        str.append("Deleted = ")
3467               .append(getDeleted())
3468             .append("\n");
3469        return(str.toString());
3470    }
3471}
3472
Popular Tags