KickJava   Java API By Example, From Geeks To Geeks.

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


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 Attribute
32  */

33 public abstract class BaseAttribute extends BaseObject
34     implements org.apache.fulcrum.intake.Retrievable
35 {
36     /** The Peer class */
37     private static final AttributePeer peer =
38         new AttributePeer();
39
40         
41     /** The value for the attributeId field */
42     private Integer JavaDoc attributeId;
43       
44     /** The value for the name field */
45     private String JavaDoc name;
46       
47     /** The value for the typeId field */
48     private Integer JavaDoc typeId;
49       
50     /** The value for the permission field */
51     private String JavaDoc permission;
52       
53     /** The value for the requiredOptionId field */
54     private Integer JavaDoc requiredOptionId;
55       
56     /** The value for the description field */
57     private String JavaDoc description;
58       
59     /** The value for the action field */
60     private String JavaDoc action;
61       
62     /** The value for the createdBy field */
63     private Integer JavaDoc createdBy;
64       
65     /** The value for the createdDate field */
66     private Date JavaDoc createdDate;
67                                                                 
68     /** The value for the deleted field */
69     private boolean deleted = false;
70   
71     
72     /**
73      * Get the AttributeId
74      *
75      * @return Integer
76      */

77     public Integer JavaDoc getAttributeId()
78     {
79         return attributeId;
80     }
81
82                                               
83     /**
84      * Set the value of AttributeId
85      *
86      * @param v new value
87      */

88     public void setAttributeId(Integer JavaDoc v) throws TorqueException
89     {
90     
91                   if (!ObjectUtils.equals(this.attributeId, v))
92               {
93             this.attributeId = v;
94             setModified(true);
95         }
96     
97           
98                                   
99         // update associated Activity
100
if (collActivitys != null)
101         {
102             for (int i = 0; i < collActivitys.size(); i++)
103             {
104                 ((Activity) collActivitys.get(i))
105                         .setAttributeId(v);
106             }
107         }
108                                           
109         // update associated Condition
110
if (collConditions != null)
111         {
112             for (int i = 0; i < collConditions.size(); i++)
113             {
114                 ((Condition) collConditions.get(i))
115                         .setAttributeId(v);
116             }
117         }
118                                           
119         // update associated RAttributeAttributeGroup
120
if (collRAttributeAttributeGroups != null)
121         {
122             for (int i = 0; i < collRAttributeAttributeGroups.size(); i++)
123             {
124                 ((RAttributeAttributeGroup) collRAttributeAttributeGroups.get(i))
125                         .setAttributeId(v);
126             }
127         }
128                                           
129         // update associated AttributeOption
130
if (collAttributeOptions != null)
131         {
132             for (int i = 0; i < collAttributeOptions.size(); i++)
133             {
134                 ((AttributeOption) collAttributeOptions.get(i))
135                         .setAttributeId(v);
136             }
137         }
138                                           
139         // update associated AttributeValue
140
if (collAttributeValues != null)
141         {
142             for (int i = 0; i < collAttributeValues.size(); i++)
143             {
144                 ((AttributeValue) collAttributeValues.get(i))
145                         .setAttributeId(v);
146             }
147         }
148                                           
149         // update associated RModuleAttribute
150
if (collRModuleAttributes != null)
151         {
152             for (int i = 0; i < collRModuleAttributes.size(); i++)
153             {
154                 ((RModuleAttribute) collRModuleAttributes.get(i))
155                         .setAttributeId(v);
156             }
157         }
158                                           
159         // update associated RIssueTypeAttribute
160
if (collRIssueTypeAttributes != null)
161         {
162             for (int i = 0; i < collRIssueTypeAttributes.size(); i++)
163             {
164                 ((RIssueTypeAttribute) collRIssueTypeAttributes.get(i))
165                         .setAttributeId(v);
166             }
167         }
168                                           
169         // update associated RModuleUserAttribute
170
if (collRModuleUserAttributes != null)
171         {
172             for (int i = 0; i < collRModuleUserAttributes.size(); i++)
173             {
174                 ((RModuleUserAttribute) collRModuleUserAttributes.get(i))
175                         .setAttributeId(v);
176             }
177         }
178                                           
179         // update associated Transition
180
if (collTransitions != null)
181         {
182             for (int i = 0; i < collTransitions.size(); i++)
183             {
184                 ((Transition) collTransitions.get(i))
185                         .setAttributeId(v);
186             }
187         }
188                       }
189   
190     /**
191      * Get the Name
192      *
193      * @return String
194      */

195     public String JavaDoc getName()
196     {
197         return name;
198     }
199
200                         
201     /**
202      * Set the value of Name
203      *
204      * @param v new value
205      */

206     public void setName(String JavaDoc v)
207     {
208     
209                   if (!ObjectUtils.equals(this.name, v))
210               {
211             this.name = v;
212             setModified(true);
213         }
214     
215           
216               }
217   
218     /**
219      * Get the TypeId
220      *
221      * @return Integer
222      */

223     public Integer JavaDoc getTypeId()
224     {
225         return typeId;
226     }
227
228                               
229     /**
230      * Set the value of TypeId
231      *
232      * @param v new value
233      */

234     public void setTypeId(Integer JavaDoc v) throws TorqueException
235     {
236     
237                   if (!ObjectUtils.equals(this.typeId, v))
238               {
239             this.typeId = v;
240             setModified(true);
241         }
242     
243                                   
244                 if (aAttributeType != null && !ObjectUtils.equals(aAttributeType.getAttributeTypeId(), v))
245                 {
246             aAttributeType = null;
247         }
248       
249               }
250   
251     /**
252      * Get the Permission
253      *
254      * @return String
255      */

256     public String JavaDoc getPermission()
257     {
258         return permission;
259     }
260
261                         
262     /**
263      * Set the value of Permission
264      *
265      * @param v new value
266      */

267     public void setPermission(String JavaDoc v)
268     {
269     
270                   if (!ObjectUtils.equals(this.permission, v))
271               {
272             this.permission = v;
273             setModified(true);
274         }
275     
276           
277               }
278   
279     /**
280      * Get the RequiredOptionId
281      *
282      * @return Integer
283      */

284     public Integer JavaDoc getRequiredOptionId()
285     {
286         return requiredOptionId;
287     }
288
289                               
290     /**
291      * Set the value of RequiredOptionId
292      *
293      * @param v new value
294      */

295     public void setRequiredOptionId(Integer JavaDoc v) throws TorqueException
296     {
297     
298                   if (!ObjectUtils.equals(this.requiredOptionId, v))
299               {
300             this.requiredOptionId = v;
301             setModified(true);
302         }
303     
304                                   
305                 if (aAttributeOption != null && !ObjectUtils.equals(aAttributeOption.getOptionId(), v))
306                 {
307             aAttributeOption = null;
308         }
309       
310               }
311   
312     /**
313      * Get the Description
314      *
315      * @return String
316      */

317     public String JavaDoc getDescription()
318     {
319         return description;
320     }
321
322                         
323     /**
324      * Set the value of Description
325      *
326      * @param v new value
327      */

328     public void setDescription(String JavaDoc v)
329     {
330     
331                   if (!ObjectUtils.equals(this.description, v))
332               {
333             this.description = v;
334             setModified(true);
335         }
336     
337           
338               }
339   
340     /**
341      * Get the Action
342      *
343      * @return String
344      */

345     public String JavaDoc getAction()
346     {
347         return action;
348     }
349
350                         
351     /**
352      * Set the value of Action
353      *
354      * @param v new value
355      */

356     public void setAction(String JavaDoc v)
357     {
358     
359                   if (!ObjectUtils.equals(this.action, v))
360               {
361             this.action = v;
362             setModified(true);
363         }
364     
365           
366               }
367   
368     /**
369      * Get the CreatedBy
370      *
371      * @return Integer
372      */

373     public Integer JavaDoc getCreatedBy()
374     {
375         return createdBy;
376     }
377
378                               
379     /**
380      * Set the value of CreatedBy
381      *
382      * @param v new value
383      */

384     public void setCreatedBy(Integer JavaDoc v) throws TorqueException
385     {
386     
387                   if (!ObjectUtils.equals(this.createdBy, v))
388               {
389             this.createdBy = v;
390             setModified(true);
391         }
392     
393                                           
394                 if (aScarabUser != null && !ObjectUtils.equals(aScarabUser.getUserId(), v))
395                 {
396             aScarabUser = null;
397         }
398       
399               }
400   
401     /**
402      * Get the CreatedDate
403      *
404      * @return Date
405      */

406     public Date JavaDoc getCreatedDate()
407     {
408         return createdDate;
409     }
410
411                         
412     /**
413      * Set the value of CreatedDate
414      *
415      * @param v new value
416      */

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

434     public boolean getDeleted()
435     {
436         return deleted;
437     }
438
439                         
440     /**
441      * Set the value of Deleted
442      *
443      * @param v new value
444      */

445     public void setDeleted(boolean v)
446     {
447     
448                   if (this.deleted != v)
449               {
450             this.deleted = v;
451             setModified(true);
452         }
453     
454           
455               }
456   
457       
458         
459                   
460         private AttributeType aAttributeType;
461
462     /**
463      * Declares an association between this object and a AttributeType object
464      *
465      * @param v AttributeType
466      * @throws TorqueException
467      */

468     public void setAttributeType(AttributeType v) throws TorqueException
469     {
470             if (v == null)
471         {
472                   setTypeId((Integer JavaDoc) null);
473               }
474         else
475         {
476             setTypeId(v.getAttributeTypeId());
477         }
478             aAttributeType = v;
479     }
480
481                         
482     /**
483      * Get the associated AttributeType object
484      *
485      * @return the associated AttributeType object
486      * @throws TorqueException
487      */

488     public AttributeType getAttributeType() throws TorqueException
489     {
490         if ( !ObjectUtils.equals(getTypeId(), null) )
491         {
492                 return AttributeTypeManager.getInstance(SimpleKey.keyFor(getTypeId()));
493             }
494         return aAttributeType;
495     }
496
497     /**
498      * Provides convenient way to set a relationship based on a
499      * ObjectKey, for example
500      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
501      *
502          */

503     public void setAttributeTypeKey(ObjectKey key) throws TorqueException
504     {
505     
506                     setTypeId(new Integer JavaDoc(((NumberKey) key).intValue()));
507               }
508   
509         
510                   
511         private AttributeOption aAttributeOption;
512
513     /**
514      * Declares an association between this object and a AttributeOption object
515      *
516      * @param v AttributeOption
517      * @throws TorqueException
518      */

519     public void setAttributeOption(AttributeOption v) throws TorqueException
520     {
521             if (v == null)
522         {
523                   setRequiredOptionId((Integer JavaDoc) null);
524               }
525         else
526         {
527             setRequiredOptionId(v.getOptionId());
528         }
529             aAttributeOption = v;
530     }
531
532                         
533     /**
534      * Get the associated AttributeOption object
535      *
536      * @return the associated AttributeOption object
537      * @throws TorqueException
538      */

539     public AttributeOption getAttributeOption() throws TorqueException
540     {
541         if ( !ObjectUtils.equals(getRequiredOptionId(), null) )
542         {
543                 return AttributeOptionManager.getInstance(SimpleKey.keyFor(getRequiredOptionId()));
544             }
545         return aAttributeOption;
546     }
547
548     /**
549      * Provides convenient way to set a relationship based on a
550      * ObjectKey, for example
551      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
552      *
553          */

554     public void setAttributeOptionKey(ObjectKey key) throws TorqueException
555     {
556     
557                     setRequiredOptionId(new Integer JavaDoc(((NumberKey) key).intValue()));
558               }
559   
560             
561                   
562         private ScarabUser aScarabUser;
563
564     /**
565      * Declares an association between this object and a ScarabUser object
566      *
567      * @param v ScarabUser
568      * @throws TorqueException
569      */

570     public void setScarabUser(ScarabUser v) throws TorqueException
571     {
572             if (v == null)
573         {
574                   setCreatedBy((Integer JavaDoc) null);
575               }
576         else
577         {
578             setCreatedBy(v.getUserId());
579         }
580             aScarabUser = v;
581     }
582
583                         
584     /**
585      * Get the associated ScarabUser object
586      *
587      * @return the associated ScarabUser object
588      * @throws TorqueException
589      */

590     public ScarabUser getScarabUser() throws TorqueException
591     {
592         if ( !ObjectUtils.equals(getCreatedBy(), null) )
593         {
594                 return ScarabUserManager.getInstance(SimpleKey.keyFor(getCreatedBy()));
595             }
596         return aScarabUser;
597     }
598
599     /**
600      * Provides convenient way to set a relationship based on a
601      * ObjectKey, for example
602      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
603      *
604          */

605     public void setScarabUserKey(ObjectKey key) throws TorqueException
606     {
607     
608                     setCreatedBy(new Integer JavaDoc(((NumberKey) key).intValue()));
609               }
610      
611                                 
612             
613     /**
614      * Collection to store aggregation of collActivitys
615      */

616     protected List JavaDoc collActivitys;
617
618     /**
619      * Temporary storage of collActivitys to save a possible db hit in
620      * the event objects are add to the collection, but the
621      * complete collection is never requested.
622      */

623     protected void initActivitys()
624     {
625         if (collActivitys == null)
626         {
627             collActivitys = new ArrayList JavaDoc();
628         }
629     }
630
631             
632     /**
633      * Method called to associate a Activity object to this object
634      * through the Activity foreign key attribute
635      *
636      * @param l Activity
637      * @throws TorqueException
638      */

639     public void addActivity(Activity l) throws TorqueException
640     {
641         getActivitys().add(l);
642         l.setAttribute((Attribute)this);
643     }
644
645     /**
646      * The criteria used to select the current contents of collActivitys
647      */

648     private Criteria lastActivitysCriteria = null;
649
650     /**
651      * If this collection has already been initialized, returns
652      * the collection. Otherwise returns the results of
653      * getActivitys(new Criteria())
654      *
655      * @throws TorqueException
656      */

657     public List JavaDoc getActivitys() throws TorqueException
658     {
659         if (collActivitys == null)
660         {
661             collActivitys = getActivitys(new Criteria(10));
662         }
663         return collActivitys;
664     }
665
666     /**
667      * If this collection has already been initialized with
668      * an identical criteria, it returns the collection.
669      * Otherwise if this Attribute has previously
670      * been saved, it will retrieve related Activitys from storage.
671      * If this Attribute is new, it will return
672      * an empty collection or the current collection, the criteria
673      * is ignored on a new object.
674      *
675      * @throws TorqueException
676      */

677     public List JavaDoc getActivitys(Criteria criteria) throws TorqueException
678     {
679         if (collActivitys == null)
680         {
681             if (isNew())
682             {
683                collActivitys = new ArrayList JavaDoc();
684             }
685             else
686             {
687                       criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
688                       collActivitys = ActivityPeer.doSelect(criteria);
689             }
690         }
691         else
692         {
693             // criteria has no effect for a new object
694
if (!isNew())
695             {
696                 // the following code is to determine if a new query is
697
// called for. If the criteria is the same as the last
698
// one, just return the collection.
699
criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
700                       if (!lastActivitysCriteria.equals(criteria))
701                 {
702                     collActivitys = ActivityPeer.doSelect(criteria);
703                 }
704             }
705         }
706         lastActivitysCriteria = criteria;
707
708         return collActivitys;
709     }
710
711     /**
712      * If this collection has already been initialized, returns
713      * the collection. Otherwise returns the results of
714      * getActivitys(new Criteria(),Connection)
715      * This method takes in the Connection also as input so that
716      * referenced objects can also be obtained using a Connection
717      * that is taken as input
718      */

719     public List JavaDoc getActivitys(Connection JavaDoc con) throws TorqueException
720     {
721         if (collActivitys == null)
722         {
723             collActivitys = getActivitys(new Criteria(10),con);
724         }
725         return collActivitys;
726     }
727
728     /**
729      * If this collection has already been initialized with
730      * an identical criteria, it returns the collection.
731      * Otherwise if this Attribute has previously
732      * been saved, it will retrieve related Activitys from storage.
733      * If this Attribute is new, it will return
734      * an empty collection or the current collection, the criteria
735      * is ignored on a new object.
736      * This method takes in the Connection also as input so that
737      * referenced objects can also be obtained using a Connection
738      * that is taken as input
739      */

740     public List JavaDoc getActivitys(Criteria criteria,Connection JavaDoc con) throws TorqueException
741     {
742         if (collActivitys == null)
743         {
744             if (isNew())
745             {
746                collActivitys = new ArrayList JavaDoc();
747             }
748             else
749             {
750                        criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
751                        collActivitys = ActivityPeer.doSelect(criteria,con);
752              }
753          }
754          else
755          {
756              // criteria has no effect for a new object
757
if (!isNew())
758              {
759                  // the following code is to determine if a new query is
760
// called for. If the criteria is the same as the last
761
// one, just return the collection.
762
criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
763                      if (!lastActivitysCriteria.equals(criteria))
764                  {
765                      collActivitys = ActivityPeer.doSelect(criteria,con);
766                  }
767              }
768          }
769          lastActivitysCriteria = criteria;
770
771          return collActivitys;
772      }
773
774                                                                   
775               
776                     
777                     
778                                 
779                                                               
780                                         
781                     
782                     
783           
784     /**
785      * If this collection has already been initialized with
786      * an identical criteria, it returns the collection.
787      * Otherwise if this Attribute is new, it will return
788      * an empty collection; or if this Attribute has previously
789      * been saved, it will retrieve related Activitys from storage.
790      *
791      * This method is protected by default in order to keep the public
792      * api reasonable. You can provide public methods for those you
793      * actually need in Attribute.
794      */

795     protected List JavaDoc getActivitysJoinIssue(Criteria criteria)
796         throws TorqueException
797     {
798         if (collActivitys == null)
799         {
800             if (isNew())
801             {
802                collActivitys = new ArrayList JavaDoc();
803             }
804             else
805             {
806                             criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
807                             collActivitys = ActivityPeer.doSelectJoinIssue(criteria);
808             }
809         }
810         else
811         {
812             // the following code is to determine if a new query is
813
// called for. If the criteria is the same as the last
814
// one, just return the collection.
815

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

846     protected List JavaDoc getActivitysJoinAttribute(Criteria criteria)
847         throws TorqueException
848     {
849         if (collActivitys == null)
850         {
851             if (isNew())
852             {
853                collActivitys = new ArrayList JavaDoc();
854             }
855             else
856             {
857                             criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
858                             collActivitys = ActivityPeer.doSelectJoinAttribute(criteria);
859             }
860         }
861         else
862         {
863             // the following code is to determine if a new query is
864
// called for. If the criteria is the same as the last
865
// one, just return the collection.
866

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

897     protected List JavaDoc getActivitysJoinActivitySet(Criteria criteria)
898         throws TorqueException
899     {
900         if (collActivitys == null)
901         {
902             if (isNew())
903             {
904                collActivitys = new ArrayList JavaDoc();
905             }
906             else
907             {
908                             criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
909                             collActivitys = ActivityPeer.doSelectJoinActivitySet(criteria);
910             }
911         }
912         else
913         {
914             // the following code is to determine if a new query is
915
// called for. If the criteria is the same as the last
916
// one, just return the collection.
917

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

948     protected List JavaDoc getActivitysJoinScarabUserImplRelatedByOldUserId(Criteria criteria)
949         throws TorqueException
950     {
951         if (collActivitys == null)
952         {
953             if (isNew())
954             {
955                collActivitys = new ArrayList JavaDoc();
956             }
957             else
958             {
959                             criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
960                             collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
961             }
962         }
963         else
964         {
965             // the following code is to determine if a new query is
966
// called for. If the criteria is the same as the last
967
// one, just return the collection.
968

969                             criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
970                         if (!lastActivitysCriteria.equals(criteria))
971             {
972                 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
973             }
974         }
975         lastActivitysCriteria = criteria;
976
977         return collActivitys;
978     }
979                   
980                     
981                     
982                                             
983                                                                           
984                                         
985                     
986                     
987           
988     /**
989      * If this collection has already been initialized with
990      * an identical criteria, it returns the collection.
991      * Otherwise if this Attribute is new, it will return
992      * an empty collection; or if this Attribute has previously
993      * been saved, it will retrieve related Activitys from storage.
994      *
995      * This method is protected by default in order to keep the public
996      * api reasonable. You can provide public methods for those you
997      * actually need in Attribute.
998      */

999     protected List JavaDoc getActivitysJoinScarabUserImplRelatedByNewUserId(Criteria criteria)
1000        throws TorqueException
1001    {
1002        if (collActivitys == null)
1003        {
1004            if (isNew())
1005            {
1006               collActivitys = new ArrayList JavaDoc();
1007            }
1008            else
1009            {
1010                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1011                            collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
1012            }
1013        }
1014        else
1015        {
1016            // the following code is to determine if a new query is
1017
// called for. If the criteria is the same as the last
1018
// one, just return the collection.
1019

1020                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1021                        if (!lastActivitysCriteria.equals(criteria))
1022            {
1023                collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
1024            }
1025        }
1026        lastActivitysCriteria = criteria;
1027
1028        return collActivitys;
1029    }
1030                  
1031                    
1032                    
1033                                            
1034                                                                          
1035                                        
1036                    
1037                    
1038          
1039    /**
1040     * If this collection has already been initialized with
1041     * an identical criteria, it returns the collection.
1042     * Otherwise if this Attribute is new, it will return
1043     * an empty collection; or if this Attribute has previously
1044     * been saved, it will retrieve related Activitys from storage.
1045     *
1046     * This method is protected by default in order to keep the public
1047     * api reasonable. You can provide public methods for those you
1048     * actually need in Attribute.
1049     */

1050    protected List JavaDoc getActivitysJoinAttributeOptionRelatedByOldOptionId(Criteria criteria)
1051        throws TorqueException
1052    {
1053        if (collActivitys == null)
1054        {
1055            if (isNew())
1056            {
1057               collActivitys = new ArrayList JavaDoc();
1058            }
1059            else
1060            {
1061                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1062                            collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
1063            }
1064        }
1065        else
1066        {
1067            // the following code is to determine if a new query is
1068
// called for. If the criteria is the same as the last
1069
// one, just return the collection.
1070

1071                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1072                        if (!lastActivitysCriteria.equals(criteria))
1073            {
1074                collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
1075            }
1076        }
1077        lastActivitysCriteria = criteria;
1078
1079        return collActivitys;
1080    }
1081                  
1082                    
1083                    
1084                                            
1085                                                                          
1086                                        
1087                    
1088                    
1089          
1090    /**
1091     * If this collection has already been initialized with
1092     * an identical criteria, it returns the collection.
1093     * Otherwise if this Attribute is new, it will return
1094     * an empty collection; or if this Attribute has previously
1095     * been saved, it will retrieve related Activitys from storage.
1096     *
1097     * This method is protected by default in order to keep the public
1098     * api reasonable. You can provide public methods for those you
1099     * actually need in Attribute.
1100     */

1101    protected List JavaDoc getActivitysJoinAttributeOptionRelatedByNewOptionId(Criteria criteria)
1102        throws TorqueException
1103    {
1104        if (collActivitys == null)
1105        {
1106            if (isNew())
1107            {
1108               collActivitys = new ArrayList JavaDoc();
1109            }
1110            else
1111            {
1112                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1113                            collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1114            }
1115        }
1116        else
1117        {
1118            // the following code is to determine if a new query is
1119
// called for. If the criteria is the same as the last
1120
// one, just return the collection.
1121

1122                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1123                        if (!lastActivitysCriteria.equals(criteria))
1124            {
1125                collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1126            }
1127        }
1128        lastActivitysCriteria = criteria;
1129
1130        return collActivitys;
1131    }
1132                  
1133                    
1134                    
1135                                
1136                                                              
1137                                        
1138                    
1139                    
1140          
1141    /**
1142     * If this collection has already been initialized with
1143     * an identical criteria, it returns the collection.
1144     * Otherwise if this Attribute is new, it will return
1145     * an empty collection; or if this Attribute has previously
1146     * been saved, it will retrieve related Activitys from storage.
1147     *
1148     * This method is protected by default in order to keep the public
1149     * api reasonable. You can provide public methods for those you
1150     * actually need in Attribute.
1151     */

1152    protected List JavaDoc getActivitysJoinAttachment(Criteria criteria)
1153        throws TorqueException
1154    {
1155        if (collActivitys == null)
1156        {
1157            if (isNew())
1158            {
1159               collActivitys = new ArrayList JavaDoc();
1160            }
1161            else
1162            {
1163                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1164                            collActivitys = ActivityPeer.doSelectJoinAttachment(criteria);
1165            }
1166        }
1167        else
1168        {
1169            // the following code is to determine if a new query is
1170
// called for. If the criteria is the same as the last
1171
// one, just return the collection.
1172

1173                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1174                        if (!lastActivitysCriteria.equals(criteria))
1175            {
1176                collActivitys = ActivityPeer.doSelectJoinAttachment(criteria);
1177            }
1178        }
1179        lastActivitysCriteria = criteria;
1180
1181        return collActivitys;
1182    }
1183                  
1184                    
1185                    
1186                                
1187                                                              
1188                                        
1189                    
1190                    
1191          
1192    /**
1193     * If this collection has already been initialized with
1194     * an identical criteria, it returns the collection.
1195     * Otherwise if this Attribute is new, it will return
1196     * an empty collection; or if this Attribute has previously
1197     * been saved, it will retrieve related Activitys from storage.
1198     *
1199     * This method is protected by default in order to keep the public
1200     * api reasonable. You can provide public methods for those you
1201     * actually need in Attribute.
1202     */

1203    protected List JavaDoc getActivitysJoinDepend(Criteria criteria)
1204        throws TorqueException
1205    {
1206        if (collActivitys == null)
1207        {
1208            if (isNew())
1209            {
1210               collActivitys = new ArrayList JavaDoc();
1211            }
1212            else
1213            {
1214                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1215                            collActivitys = ActivityPeer.doSelectJoinDepend(criteria);
1216            }
1217        }
1218        else
1219        {
1220            // the following code is to determine if a new query is
1221
// called for. If the criteria is the same as the last
1222
// one, just return the collection.
1223

1224                            criteria.add(ActivityPeer.ATTRIBUTE_ID, getAttributeId() );
1225                        if (!lastActivitysCriteria.equals(criteria))
1226            {
1227                collActivitys = ActivityPeer.doSelectJoinDepend(criteria);
1228            }
1229        }
1230        lastActivitysCriteria = criteria;
1231
1232        return collActivitys;
1233    }
1234                            
1235
1236
1237                          
1238            
1239    /**
1240     * Collection to store aggregation of collConditions
1241     */

1242    protected List JavaDoc collConditions;
1243
1244    /**
1245     * Temporary storage of collConditions to save a possible db hit in
1246     * the event objects are add to the collection, but the
1247     * complete collection is never requested.
1248     */

1249    protected void initConditions()
1250    {
1251        if (collConditions == null)
1252        {
1253            collConditions = new ArrayList JavaDoc();
1254        }
1255    }
1256
1257            
1258    /**
1259     * Method called to associate a Condition object to this object
1260     * through the Condition foreign key attribute
1261     *
1262     * @param l Condition
1263     * @throws TorqueException
1264     */

1265    public void addCondition(Condition l) throws TorqueException
1266    {
1267        getConditions().add(l);
1268        l.setAttribute((Attribute)this);
1269    }
1270
1271    /**
1272     * The criteria used to select the current contents of collConditions
1273     */

1274    private Criteria lastConditionsCriteria = null;
1275
1276    /**
1277     * If this collection has already been initialized, returns
1278     * the collection. Otherwise returns the results of
1279     * getConditions(new Criteria())
1280     *
1281     * @throws TorqueException
1282     */

1283    public List JavaDoc getConditions() throws TorqueException
1284    {
1285        if (collConditions == null)
1286        {
1287            collConditions = getConditions(new Criteria(10));
1288        }
1289        return collConditions;
1290    }
1291
1292    /**
1293     * If this collection has already been initialized with
1294     * an identical criteria, it returns the collection.
1295     * Otherwise if this Attribute has previously
1296     * been saved, it will retrieve related Conditions from storage.
1297     * If this Attribute is new, it will return
1298     * an empty collection or the current collection, the criteria
1299     * is ignored on a new object.
1300     *
1301     * @throws TorqueException
1302     */

1303    public List JavaDoc getConditions(Criteria criteria) throws TorqueException
1304    {
1305        if (collConditions == null)
1306        {
1307            if (isNew())
1308            {
1309               collConditions = new ArrayList JavaDoc();
1310            }
1311            else
1312            {
1313                      criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1314                      collConditions = ConditionPeer.doSelect(criteria);
1315            }
1316        }
1317        else
1318        {
1319            // criteria has no effect for a new object
1320
if (!isNew())
1321            {
1322                // the following code is to determine if a new query is
1323
// called for. If the criteria is the same as the last
1324
// one, just return the collection.
1325
criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1326                      if (!lastConditionsCriteria.equals(criteria))
1327                {
1328                    collConditions = ConditionPeer.doSelect(criteria);
1329                }
1330            }
1331        }
1332        lastConditionsCriteria = criteria;
1333
1334        return collConditions;
1335    }
1336
1337    /**
1338     * If this collection has already been initialized, returns
1339     * the collection. Otherwise returns the results of
1340     * getConditions(new Criteria(),Connection)
1341     * This method takes in the Connection also as input so that
1342     * referenced objects can also be obtained using a Connection
1343     * that is taken as input
1344     */

1345    public List JavaDoc getConditions(Connection JavaDoc con) throws TorqueException
1346    {
1347        if (collConditions == null)
1348        {
1349            collConditions = getConditions(new Criteria(10),con);
1350        }
1351        return collConditions;
1352    }
1353
1354    /**
1355     * If this collection has already been initialized with
1356     * an identical criteria, it returns the collection.
1357     * Otherwise if this Attribute has previously
1358     * been saved, it will retrieve related Conditions from storage.
1359     * If this Attribute is new, it will return
1360     * an empty collection or the current collection, the criteria
1361     * is ignored on a new object.
1362     * This method takes in the Connection also as input so that
1363     * referenced objects can also be obtained using a Connection
1364     * that is taken as input
1365     */

1366    public List JavaDoc getConditions(Criteria criteria,Connection JavaDoc con) throws TorqueException
1367    {
1368        if (collConditions == null)
1369        {
1370            if (isNew())
1371            {
1372               collConditions = new ArrayList JavaDoc();
1373            }
1374            else
1375            {
1376                       criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1377                       collConditions = ConditionPeer.doSelect(criteria,con);
1378             }
1379         }
1380         else
1381         {
1382             // criteria has no effect for a new object
1383
if (!isNew())
1384             {
1385                 // the following code is to determine if a new query is
1386
// called for. If the criteria is the same as the last
1387
// one, just return the collection.
1388
criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1389                     if (!lastConditionsCriteria.equals(criteria))
1390                 {
1391                     collConditions = ConditionPeer.doSelect(criteria,con);
1392                 }
1393             }
1394         }
1395         lastConditionsCriteria = criteria;
1396
1397         return collConditions;
1398     }
1399
1400                                          
1401              
1402                    
1403                    
1404                                                                            
1405                                                                                                          
1406                                        
1407                    
1408                    
1409          
1410    /**
1411     * If this collection has already been initialized with
1412     * an identical criteria, it returns the collection.
1413     * Otherwise if this Attribute is new, it will return
1414     * an empty collection; or if this Attribute has previously
1415     * been saved, it will retrieve related Conditions from storage.
1416     *
1417     * This method is protected by default in order to keep the public
1418     * api reasonable. You can provide public methods for those you
1419     * actually need in Attribute.
1420     */

1421    protected List JavaDoc getConditionsJoinRModuleAttribute(Criteria criteria)
1422        throws TorqueException
1423    {
1424        if (collConditions == null)
1425        {
1426            if (isNew())
1427            {
1428               collConditions = new ArrayList JavaDoc();
1429            }
1430            else
1431            {
1432                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1433                            collConditions = ConditionPeer.doSelectJoinRModuleAttribute(criteria);
1434            }
1435        }
1436        else
1437        {
1438            // the following code is to determine if a new query is
1439
// called for. If the criteria is the same as the last
1440
// one, just return the collection.
1441

1442                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1443                        if (!lastConditionsCriteria.equals(criteria))
1444            {
1445                collConditions = ConditionPeer.doSelectJoinRModuleAttribute(criteria);
1446            }
1447        }
1448        lastConditionsCriteria = criteria;
1449
1450        return collConditions;
1451    }
1452                  
1453                    
1454                    
1455                                
1456                                                              
1457                                        
1458                    
1459                    
1460          
1461    /**
1462     * If this collection has already been initialized with
1463     * an identical criteria, it returns the collection.
1464     * Otherwise if this Attribute is new, it will return
1465     * an empty collection; or if this Attribute has previously
1466     * been saved, it will retrieve related Conditions from storage.
1467     *
1468     * This method is protected by default in order to keep the public
1469     * api reasonable. You can provide public methods for those you
1470     * actually need in Attribute.
1471     */

1472    protected List JavaDoc getConditionsJoinTransition(Criteria criteria)
1473        throws TorqueException
1474    {
1475        if (collConditions == null)
1476        {
1477            if (isNew())
1478            {
1479               collConditions = new ArrayList JavaDoc();
1480            }
1481            else
1482            {
1483                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1484                            collConditions = ConditionPeer.doSelectJoinTransition(criteria);
1485            }
1486        }
1487        else
1488        {
1489            // the following code is to determine if a new query is
1490
// called for. If the criteria is the same as the last
1491
// one, just return the collection.
1492

1493                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1494                        if (!lastConditionsCriteria.equals(criteria))
1495            {
1496                collConditions = ConditionPeer.doSelectJoinTransition(criteria);
1497            }
1498        }
1499        lastConditionsCriteria = criteria;
1500
1501        return collConditions;
1502    }
1503                  
1504                    
1505                              
1506                                
1507                                                              
1508                                        
1509                    
1510                    
1511          
1512    /**
1513     * If this collection has already been initialized with
1514     * an identical criteria, it returns the collection.
1515     * Otherwise if this Attribute is new, it will return
1516     * an empty collection; or if this Attribute has previously
1517     * been saved, it will retrieve related Conditions from storage.
1518     *
1519     * This method is protected by default in order to keep the public
1520     * api reasonable. You can provide public methods for those you
1521     * actually need in Attribute.
1522     */

1523    protected List JavaDoc getConditionsJoinAttribute(Criteria criteria)
1524        throws TorqueException
1525    {
1526        if (collConditions == null)
1527        {
1528            if (isNew())
1529            {
1530               collConditions = new ArrayList JavaDoc();
1531            }
1532            else
1533            {
1534                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1535                            collConditions = ConditionPeer.doSelectJoinAttribute(criteria);
1536            }
1537        }
1538        else
1539        {
1540            // the following code is to determine if a new query is
1541
// called for. If the criteria is the same as the last
1542
// one, just return the collection.
1543

1544                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1545                        if (!lastConditionsCriteria.equals(criteria))
1546            {
1547                collConditions = ConditionPeer.doSelectJoinAttribute(criteria);
1548            }
1549        }
1550        lastConditionsCriteria = criteria;
1551
1552        return collConditions;
1553    }
1554                  
1555                    
1556                    
1557                                
1558                                                              
1559                                        
1560                    
1561                    
1562          
1563    /**
1564     * If this collection has already been initialized with
1565     * an identical criteria, it returns the collection.
1566     * Otherwise if this Attribute is new, it will return
1567     * an empty collection; or if this Attribute has previously
1568     * been saved, it will retrieve related Conditions from storage.
1569     *
1570     * This method is protected by default in order to keep the public
1571     * api reasonable. You can provide public methods for those you
1572     * actually need in Attribute.
1573     */

1574    protected List JavaDoc getConditionsJoinAttributeOption(Criteria criteria)
1575        throws TorqueException
1576    {
1577        if (collConditions == null)
1578        {
1579            if (isNew())
1580            {
1581               collConditions = new ArrayList JavaDoc();
1582            }
1583            else
1584            {
1585                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1586                            collConditions = ConditionPeer.doSelectJoinAttributeOption(criteria);
1587            }
1588        }
1589        else
1590        {
1591            // the following code is to determine if a new query is
1592
// called for. If the criteria is the same as the last
1593
// one, just return the collection.
1594

1595                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1596                        if (!lastConditionsCriteria.equals(criteria))
1597            {
1598                collConditions = ConditionPeer.doSelectJoinAttributeOption(criteria);
1599            }
1600        }
1601        lastConditionsCriteria = criteria;
1602
1603        return collConditions;
1604    }
1605                  
1606                    
1607                    
1608                                                      
1609                                                                                    
1610                                        
1611                    
1612                    
1613          
1614    /**
1615     * If this collection has already been initialized with
1616     * an identical criteria, it returns the collection.
1617     * Otherwise if this Attribute is new, it will return
1618     * an empty collection; or if this Attribute has previously
1619     * been saved, it will retrieve related Conditions from storage.
1620     *
1621     * This method is protected by default in order to keep the public
1622     * api reasonable. You can provide public methods for those you
1623     * actually need in Attribute.
1624     */

1625    protected List JavaDoc getConditionsJoinRModuleIssueType(Criteria criteria)
1626        throws TorqueException
1627    {
1628        if (collConditions == null)
1629        {
1630            if (isNew())
1631            {
1632               collConditions = new ArrayList JavaDoc();
1633            }
1634            else
1635            {
1636                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1637                            collConditions = ConditionPeer.doSelectJoinRModuleIssueType(criteria);
1638            }
1639        }
1640        else
1641        {
1642            // the following code is to determine if a new query is
1643
// called for. If the criteria is the same as the last
1644
// one, just return the collection.
1645

1646                            criteria.add(ConditionPeer.ATTRIBUTE_ID, getAttributeId() );
1647                        if (!lastConditionsCriteria.equals(criteria))
1648            {
1649                collConditions = ConditionPeer.doSelectJoinRModuleIssueType(criteria);
1650            }
1651        }
1652        lastConditionsCriteria = criteria;
1653
1654        return collConditions;
1655    }
1656                            
1657
1658
1659                          
1660            
1661    /**
1662     * Collection to store aggregation of collRAttributeAttributeGroups
1663     */

1664    protected List JavaDoc collRAttributeAttributeGroups;
1665
1666    /**
1667     * Temporary storage of collRAttributeAttributeGroups to save a possible db hit in
1668     * the event objects are add to the collection, but the
1669     * complete collection is never requested.
1670     */

1671    protected void initRAttributeAttributeGroups()
1672    {
1673        if (collRAttributeAttributeGroups == null)
1674        {
1675            collRAttributeAttributeGroups = new ArrayList JavaDoc();
1676        }
1677    }
1678
1679            
1680    /**
1681     * Method called to associate a RAttributeAttributeGroup object to this object
1682     * through the RAttributeAttributeGroup foreign key attribute
1683     *
1684     * @param l RAttributeAttributeGroup
1685     * @throws TorqueException
1686     */

1687    public void addRAttributeAttributeGroup(RAttributeAttributeGroup l) throws TorqueException
1688    {
1689        getRAttributeAttributeGroups().add(l);
1690        l.setAttribute((Attribute)this);
1691    }
1692
1693    /**
1694     * The criteria used to select the current contents of collRAttributeAttributeGroups
1695     */

1696    private Criteria lastRAttributeAttributeGroupsCriteria = null;
1697
1698    /**
1699     * If this collection has already been initialized, returns
1700     * the collection. Otherwise returns the results of
1701     * getRAttributeAttributeGroups(new Criteria())
1702     *
1703     * @throws TorqueException
1704     */

1705    public List JavaDoc getRAttributeAttributeGroups() throws TorqueException
1706    {
1707        if (collRAttributeAttributeGroups == null)
1708        {
1709            collRAttributeAttributeGroups = getRAttributeAttributeGroups(new Criteria(10));
1710        }
1711        return collRAttributeAttributeGroups;
1712    }
1713
1714    /**
1715     * If this collection has already been initialized with
1716     * an identical criteria, it returns the collection.
1717     * Otherwise if this Attribute has previously
1718     * been saved, it will retrieve related RAttributeAttributeGroups from storage.
1719     * If this Attribute is new, it will return
1720     * an empty collection or the current collection, the criteria
1721     * is ignored on a new object.
1722     *
1723     * @throws TorqueException
1724     */

1725    public List JavaDoc getRAttributeAttributeGroups(Criteria criteria) throws TorqueException
1726    {
1727        if (collRAttributeAttributeGroups == null)
1728        {
1729            if (isNew())
1730            {
1731               collRAttributeAttributeGroups = new ArrayList JavaDoc();
1732            }
1733            else
1734            {
1735                      criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1736                      collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelect(criteria);
1737            }
1738        }
1739        else
1740        {
1741            // criteria has no effect for a new object
1742
if (!isNew())
1743            {
1744                // the following code is to determine if a new query is
1745
// called for. If the criteria is the same as the last
1746
// one, just return the collection.
1747
criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1748                      if (!lastRAttributeAttributeGroupsCriteria.equals(criteria))
1749                {
1750                    collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelect(criteria);
1751                }
1752            }
1753        }
1754        lastRAttributeAttributeGroupsCriteria = criteria;
1755
1756        return collRAttributeAttributeGroups;
1757    }
1758
1759    /**
1760     * If this collection has already been initialized, returns
1761     * the collection. Otherwise returns the results of
1762     * getRAttributeAttributeGroups(new Criteria(),Connection)
1763     * This method takes in the Connection also as input so that
1764     * referenced objects can also be obtained using a Connection
1765     * that is taken as input
1766     */

1767    public List JavaDoc getRAttributeAttributeGroups(Connection JavaDoc con) throws TorqueException
1768    {
1769        if (collRAttributeAttributeGroups == null)
1770        {
1771            collRAttributeAttributeGroups = getRAttributeAttributeGroups(new Criteria(10),con);
1772        }
1773        return collRAttributeAttributeGroups;
1774    }
1775
1776    /**
1777     * If this collection has already been initialized with
1778     * an identical criteria, it returns the collection.
1779     * Otherwise if this Attribute has previously
1780     * been saved, it will retrieve related RAttributeAttributeGroups from storage.
1781     * If this Attribute is new, it will return
1782     * an empty collection or the current collection, the criteria
1783     * is ignored on a new object.
1784     * This method takes in the Connection also as input so that
1785     * referenced objects can also be obtained using a Connection
1786     * that is taken as input
1787     */

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

1843    protected List JavaDoc getRAttributeAttributeGroupsJoinAttribute(Criteria criteria)
1844        throws TorqueException
1845    {
1846        if (collRAttributeAttributeGroups == null)
1847        {
1848            if (isNew())
1849            {
1850               collRAttributeAttributeGroups = new ArrayList JavaDoc();
1851            }
1852            else
1853            {
1854                            criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1855                            collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelectJoinAttribute(criteria);
1856            }
1857        }
1858        else
1859        {
1860            // the following code is to determine if a new query is
1861
// called for. If the criteria is the same as the last
1862
// one, just return the collection.
1863

1864                            criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1865                        if (!lastRAttributeAttributeGroupsCriteria.equals(criteria))
1866            {
1867                collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelectJoinAttribute(criteria);
1868            }
1869        }
1870        lastRAttributeAttributeGroupsCriteria = criteria;
1871
1872        return collRAttributeAttributeGroups;
1873    }
1874                  
1875                    
1876                    
1877                                
1878                                                              
1879                                        
1880                    
1881                    
1882          
1883    /**
1884     * If this collection has already been initialized with
1885     * an identical criteria, it returns the collection.
1886     * Otherwise if this Attribute is new, it will return
1887     * an empty collection; or if this Attribute has previously
1888     * been saved, it will retrieve related RAttributeAttributeGroups from storage.
1889     *
1890     * This method is protected by default in order to keep the public
1891     * api reasonable. You can provide public methods for those you
1892     * actually need in Attribute.
1893     */

1894    protected List JavaDoc getRAttributeAttributeGroupsJoinAttributeGroup(Criteria criteria)
1895        throws TorqueException
1896    {
1897        if (collRAttributeAttributeGroups == null)
1898        {
1899            if (isNew())
1900            {
1901               collRAttributeAttributeGroups = new ArrayList JavaDoc();
1902            }
1903            else
1904            {
1905                            criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1906                            collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelectJoinAttributeGroup(criteria);
1907            }
1908        }
1909        else
1910        {
1911            // the following code is to determine if a new query is
1912
// called for. If the criteria is the same as the last
1913
// one, just return the collection.
1914

1915                            criteria.add(RAttributeAttributeGroupPeer.ATTRIBUTE_ID, getAttributeId() );
1916                        if (!lastRAttributeAttributeGroupsCriteria.equals(criteria))
1917            {
1918                collRAttributeAttributeGroups = RAttributeAttributeGroupPeer.doSelectJoinAttributeGroup(criteria);
1919            }
1920        }
1921        lastRAttributeAttributeGroupsCriteria = criteria;
1922
1923        return collRAttributeAttributeGroups;
1924    }
1925                            
1926
1927
1928                          
1929            
1930    /**
1931     * Collection to store aggregation of collAttributeOptions
1932     */

1933    protected List JavaDoc collAttributeOptions;
1934
1935    /**
1936     * Temporary storage of collAttributeOptions to save a possible db hit in
1937     * the event objects are add to the collection, but the
1938     * complete collection is never requested.
1939     */

1940    protected void initAttributeOptions()
1941    {
1942        if (collAttributeOptions == null)
1943        {
1944            collAttributeOptions = new ArrayList JavaDoc();
1945        }
1946    }
1947
1948            
1949    /**
1950     * Method called to associate a AttributeOption object to this object
1951     * through the AttributeOption foreign key attribute
1952     *
1953     * @param l AttributeOption
1954     * @throws TorqueException
1955     */

1956    public void addAttributeOption(AttributeOption l) throws TorqueException
1957    {
1958        getAttributeOptions().add(l);
1959        l.setAttribute((Attribute)this);
1960    }
1961
1962    /**
1963     * The criteria used to select the current contents of collAttributeOptions
1964     */

1965    private Criteria lastAttributeOptionsCriteria = null;
1966
1967    /**
1968     * If this collection has already been initialized, returns
1969     * the collection. Otherwise returns the results of
1970     * getAttributeOptions(new Criteria())
1971     *
1972     * @throws TorqueException
1973     */

1974    public List JavaDoc getAttributeOptions() throws TorqueException
1975    {
1976        if (collAttributeOptions == null)
1977        {
1978            collAttributeOptions = getAttributeOptions(new Criteria(10));
1979        }
1980        return collAttributeOptions;
1981    }
1982
1983    /**
1984     * If this collection has already been initialized with
1985     * an identical criteria, it returns the collection.
1986     * Otherwise if this Attribute has previously
1987     * been saved, it will retrieve related AttributeOptions from storage.
1988     * If this Attribute is new, it will return
1989     * an empty collection or the current collection, the criteria
1990     * is ignored on a new object.
1991     *
1992     * @throws TorqueException
1993     */

1994    public List JavaDoc getAttributeOptions(Criteria criteria) throws TorqueException
1995    {
1996        if (collAttributeOptions == null)
1997        {
1998            if (isNew())
1999            {
2000               collAttributeOptions = new ArrayList JavaDoc();
2001            }
2002            else
2003            {
2004                      criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2005                      collAttributeOptions = AttributeOptionPeer.doSelect(criteria);
2006            }
2007        }
2008        else
2009        {
2010            // criteria has no effect for a new object
2011
if (!isNew())
2012            {
2013                // the following code is to determine if a new query is
2014
// called for. If the criteria is the same as the last
2015
// one, just return the collection.
2016
criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2017                      if (!lastAttributeOptionsCriteria.equals(criteria))
2018                {
2019                    collAttributeOptions = AttributeOptionPeer.doSelect(criteria);
2020                }
2021            }
2022        }
2023        lastAttributeOptionsCriteria = criteria;
2024
2025        return collAttributeOptions;
2026    }
2027
2028    /**
2029     * If this collection has already been initialized, returns
2030     * the collection. Otherwise returns the results of
2031     * getAttributeOptions(new Criteria(),Connection)
2032     * This method takes in the Connection also as input so that
2033     * referenced objects can also be obtained using a Connection
2034     * that is taken as input
2035     */

2036    public List JavaDoc getAttributeOptions(Connection JavaDoc con) throws TorqueException
2037    {
2038        if (collAttributeOptions == null)
2039        {
2040            collAttributeOptions = getAttributeOptions(new Criteria(10),con);
2041        }
2042        return collAttributeOptions;
2043    }
2044
2045    /**
2046     * If this collection has already been initialized with
2047     * an identical criteria, it returns the collection.
2048     * Otherwise if this Attribute has previously
2049     * been saved, it will retrieve related AttributeOptions from storage.
2050     * If this Attribute is new, it will return
2051     * an empty collection or the current collection, the criteria
2052     * is ignored on a new object.
2053     * This method takes in the Connection also as input so that
2054     * referenced objects can also be obtained using a Connection
2055     * that is taken as input
2056     */

2057    public List JavaDoc getAttributeOptions(Criteria criteria,Connection JavaDoc con) throws TorqueException
2058    {
2059        if (collAttributeOptions == null)
2060        {
2061            if (isNew())
2062            {
2063               collAttributeOptions = new ArrayList JavaDoc();
2064            }
2065            else
2066            {
2067                       criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2068                       collAttributeOptions = AttributeOptionPeer.doSelect(criteria,con);
2069             }
2070         }
2071         else
2072         {
2073             // criteria has no effect for a new object
2074
if (!isNew())
2075             {
2076                 // the following code is to determine if a new query is
2077
// called for. If the criteria is the same as the last
2078
// one, just return the collection.
2079
criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2080                     if (!lastAttributeOptionsCriteria.equals(criteria))
2081                 {
2082                     collAttributeOptions = AttributeOptionPeer.doSelect(criteria,con);
2083                 }
2084             }
2085         }
2086         lastAttributeOptionsCriteria = criteria;
2087
2088         return collAttributeOptions;
2089     }
2090
2091                  
2092              
2093                    
2094                              
2095                                
2096                                                              
2097                                        
2098                    
2099                    
2100          
2101    /**
2102     * If this collection has already been initialized with
2103     * an identical criteria, it returns the collection.
2104     * Otherwise if this Attribute is new, it will return
2105     * an empty collection; or if this Attribute has previously
2106     * been saved, it will retrieve related AttributeOptions from storage.
2107     *
2108     * This method is protected by default in order to keep the public
2109     * api reasonable. You can provide public methods for those you
2110     * actually need in Attribute.
2111     */

2112    protected List JavaDoc getAttributeOptionsJoinAttribute(Criteria criteria)
2113        throws TorqueException
2114    {
2115        if (collAttributeOptions == null)
2116        {
2117            if (isNew())
2118            {
2119               collAttributeOptions = new ArrayList JavaDoc();
2120            }
2121            else
2122            {
2123                            criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2124                            collAttributeOptions = AttributeOptionPeer.doSelectJoinAttribute(criteria);
2125            }
2126        }
2127        else
2128        {
2129            // the following code is to determine if a new query is
2130
// called for. If the criteria is the same as the last
2131
// one, just return the collection.
2132

2133                            criteria.add(AttributeOptionPeer.ATTRIBUTE_ID, getAttributeId() );
2134                        if (!lastAttributeOptionsCriteria.equals(criteria))
2135            {
2136                collAttributeOptions = AttributeOptionPeer.doSelectJoinAttribute(criteria);
2137            }
2138        }
2139        lastAttributeOptionsCriteria = criteria;
2140
2141        return collAttributeOptions;
2142    }
2143                            
2144
2145
2146                          
2147            
2148    /**
2149     * Collection to store aggregation of collAttributeValues
2150     */

2151    protected List JavaDoc collAttributeValues;
2152
2153    /**
2154     * Temporary storage of collAttributeValues to save a possible db hit in
2155     * the event objects are add to the collection, but the
2156     * complete collection is never requested.
2157     */

2158    protected void initAttributeValues()
2159    {
2160        if (collAttributeValues == null)
2161        {
2162            collAttributeValues = new ArrayList JavaDoc();
2163        }
2164    }
2165
2166            
2167    /**
2168     * Method called to associate a AttributeValue object to this object
2169     * through the AttributeValue foreign key attribute
2170     *
2171     * @param l AttributeValue
2172     * @throws TorqueException
2173     */

2174    public void addAttributeValue(AttributeValue l) throws TorqueException
2175    {
2176        getAttributeValues().add(l);
2177        l.setAttribute((Attribute)this);
2178    }
2179
2180    /**
2181     * The criteria used to select the current contents of collAttributeValues
2182     */

2183    private Criteria lastAttributeValuesCriteria = null;
2184
2185    /**
2186     * If this collection has already been initialized, returns
2187     * the collection. Otherwise returns the results of
2188     * getAttributeValues(new Criteria())
2189     *
2190     * @throws TorqueException
2191     */

2192    public List JavaDoc getAttributeValues() throws TorqueException
2193    {
2194        if (collAttributeValues == null)
2195        {
2196            collAttributeValues = getAttributeValues(new Criteria(10));
2197        }
2198        return collAttributeValues;
2199    }
2200
2201    /**
2202     * If this collection has already been initialized with
2203     * an identical criteria, it returns the collection.
2204     * Otherwise if this Attribute has previously
2205     * been saved, it will retrieve related AttributeValues from storage.
2206     * If this Attribute is new, it will return
2207     * an empty collection or the current collection, the criteria
2208     * is ignored on a new object.
2209     *
2210     * @throws TorqueException
2211     */

2212    public List JavaDoc getAttributeValues(Criteria criteria) throws TorqueException
2213    {
2214        if (collAttributeValues == null)
2215        {
2216            if (isNew())
2217            {
2218               collAttributeValues = new ArrayList JavaDoc();
2219            }
2220            else
2221            {
2222                      criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2223                      collAttributeValues = AttributeValuePeer.doSelect(criteria);
2224            }
2225        }
2226        else
2227        {
2228            // criteria has no effect for a new object
2229
if (!isNew())
2230            {
2231                // the following code is to determine if a new query is
2232
// called for. If the criteria is the same as the last
2233
// one, just return the collection.
2234
criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2235                      if (!lastAttributeValuesCriteria.equals(criteria))
2236                {
2237                    collAttributeValues = AttributeValuePeer.doSelect(criteria);
2238                }
2239            }
2240        }
2241        lastAttributeValuesCriteria = criteria;
2242
2243        return collAttributeValues;
2244    }
2245
2246    /**
2247     * If this collection has already been initialized, returns
2248     * the collection. Otherwise returns the results of
2249     * getAttributeValues(new Criteria(),Connection)
2250     * This method takes in the Connection also as input so that
2251     * referenced objects can also be obtained using a Connection
2252     * that is taken as input
2253     */

2254    public List JavaDoc getAttributeValues(Connection JavaDoc con) throws TorqueException
2255    {
2256        if (collAttributeValues == null)
2257        {
2258            collAttributeValues = getAttributeValues(new Criteria(10),con);
2259        }
2260        return collAttributeValues;
2261    }
2262
2263    /**
2264     * If this collection has already been initialized with
2265     * an identical criteria, it returns the collection.
2266     * Otherwise if this Attribute has previously
2267     * been saved, it will retrieve related AttributeValues from storage.
2268     * If this Attribute is new, it will return
2269     * an empty collection or the current collection, the criteria
2270     * is ignored on a new object.
2271     * This method takes in the Connection also as input so that
2272     * referenced objects can also be obtained using a Connection
2273     * that is taken as input
2274     */

2275    public List JavaDoc getAttributeValues(Criteria criteria,Connection JavaDoc con) throws TorqueException
2276    {
2277        if (collAttributeValues == null)
2278        {
2279            if (isNew())
2280            {
2281               collAttributeValues = new ArrayList JavaDoc();
2282            }
2283            else
2284            {
2285                       criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2286                       collAttributeValues = AttributeValuePeer.doSelect(criteria,con);
2287             }
2288         }
2289         else
2290         {
2291             // criteria has no effect for a new object
2292
if (!isNew())
2293             {
2294                 // the following code is to determine if a new query is
2295
// called for. If the criteria is the same as the last
2296
// one, just return the collection.
2297
criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2298                     if (!lastAttributeValuesCriteria.equals(criteria))
2299                 {
2300                     collAttributeValues = AttributeValuePeer.doSelect(criteria,con);
2301                 }
2302             }
2303         }
2304         lastAttributeValuesCriteria = criteria;
2305
2306         return collAttributeValues;
2307     }
2308
2309                                    
2310              
2311                    
2312                    
2313                                
2314                                                              
2315                                        
2316                    
2317                    
2318          
2319    /**
2320     * If this collection has already been initialized with
2321     * an identical criteria, it returns the collection.
2322     * Otherwise if this Attribute is new, it will return
2323     * an empty collection; or if this Attribute has previously
2324     * been saved, it will retrieve related AttributeValues from storage.
2325     *
2326     * This method is protected by default in order to keep the public
2327     * api reasonable. You can provide public methods for those you
2328     * actually need in Attribute.
2329     */

2330    protected List JavaDoc getAttributeValuesJoinIssue(Criteria criteria)
2331        throws TorqueException
2332    {
2333        if (collAttributeValues == null)
2334        {
2335            if (isNew())
2336            {
2337               collAttributeValues = new ArrayList JavaDoc();
2338            }
2339            else
2340            {
2341                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2342                            collAttributeValues = AttributeValuePeer.doSelectJoinIssue(criteria);
2343            }
2344        }
2345        else
2346        {
2347            // the following code is to determine if a new query is
2348
// called for. If the criteria is the same as the last
2349
// one, just return the collection.
2350

2351                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2352                        if (!lastAttributeValuesCriteria.equals(criteria))
2353            {
2354                collAttributeValues = AttributeValuePeer.doSelectJoinIssue(criteria);
2355            }
2356        }
2357        lastAttributeValuesCriteria = criteria;
2358
2359        return collAttributeValues;
2360    }
2361                  
2362                    
2363                              
2364                                
2365                                                              
2366                                        
2367                    
2368                    
2369          
2370    /**
2371     * If this collection has already been initialized with
2372     * an identical criteria, it returns the collection.
2373     * Otherwise if this Attribute is new, it will return
2374     * an empty collection; or if this Attribute has previously
2375     * been saved, it will retrieve related AttributeValues from storage.
2376     *
2377     * This method is protected by default in order to keep the public
2378     * api reasonable. You can provide public methods for those you
2379     * actually need in Attribute.
2380     */

2381    protected List JavaDoc getAttributeValuesJoinAttribute(Criteria criteria)
2382        throws TorqueException
2383    {
2384        if (collAttributeValues == null)
2385        {
2386            if (isNew())
2387            {
2388               collAttributeValues = new ArrayList JavaDoc();
2389            }
2390            else
2391            {
2392                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2393                            collAttributeValues = AttributeValuePeer.doSelectJoinAttribute(criteria);
2394            }
2395        }
2396        else
2397        {
2398            // the following code is to determine if a new query is
2399
// called for. If the criteria is the same as the last
2400
// one, just return the collection.
2401

2402                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2403                        if (!lastAttributeValuesCriteria.equals(criteria))
2404            {
2405                collAttributeValues = AttributeValuePeer.doSelectJoinAttribute(criteria);
2406            }
2407        }
2408        lastAttributeValuesCriteria = criteria;
2409
2410        return collAttributeValues;
2411    }
2412                  
2413                    
2414                    
2415                                
2416                                                              
2417                                        
2418                    
2419                    
2420          
2421    /**
2422     * If this collection has already been initialized with
2423     * an identical criteria, it returns the collection.
2424     * Otherwise if this Attribute is new, it will return
2425     * an empty collection; or if this Attribute has previously
2426     * been saved, it will retrieve related AttributeValues from storage.
2427     *
2428     * This method is protected by default in order to keep the public
2429     * api reasonable. You can provide public methods for those you
2430     * actually need in Attribute.
2431     */

2432    protected List JavaDoc getAttributeValuesJoinAttributeOption(Criteria criteria)
2433        throws TorqueException
2434    {
2435        if (collAttributeValues == null)
2436        {
2437            if (isNew())
2438            {
2439               collAttributeValues = new ArrayList JavaDoc();
2440            }
2441            else
2442            {
2443                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2444                            collAttributeValues = AttributeValuePeer.doSelectJoinAttributeOption(criteria);
2445            }
2446        }
2447        else
2448        {
2449            // the following code is to determine if a new query is
2450
// called for. If the criteria is the same as the last
2451
// one, just return the collection.
2452

2453                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2454                        if (!lastAttributeValuesCriteria.equals(criteria))
2455            {
2456                collAttributeValues = AttributeValuePeer.doSelectJoinAttributeOption(criteria);
2457            }
2458        }
2459        lastAttributeValuesCriteria = criteria;
2460
2461        return collAttributeValues;
2462    }
2463                  
2464                    
2465                    
2466                                
2467                                                              
2468                                        
2469                    
2470                    
2471          
2472    /**
2473     * If this collection has already been initialized with
2474     * an identical criteria, it returns the collection.
2475     * Otherwise if this Attribute is new, it will return
2476     * an empty collection; or if this Attribute has previously
2477     * been saved, it will retrieve related AttributeValues from storage.
2478     *
2479     * This method is protected by default in order to keep the public
2480     * api reasonable. You can provide public methods for those you
2481     * actually need in Attribute.
2482     */

2483    protected List JavaDoc getAttributeValuesJoinScarabUserImpl(Criteria criteria)
2484        throws TorqueException
2485    {
2486        if (collAttributeValues == null)
2487        {
2488            if (isNew())
2489            {
2490               collAttributeValues = new ArrayList JavaDoc();
2491            }
2492            else
2493            {
2494                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2495                            collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria);
2496            }
2497        }
2498        else
2499        {
2500            // the following code is to determine if a new query is
2501
// called for. If the criteria is the same as the last
2502
// one, just return the collection.
2503

2504                            criteria.add(AttributeValuePeer.ATTRIBUTE_ID, getAttributeId() );
2505                        if (!lastAttributeValuesCriteria.equals(criteria))
2506            {
2507                collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria);
2508            }
2509        }
2510        lastAttributeValuesCriteria = criteria;
2511
2512        return collAttributeValues;
2513    }
2514                            
2515
2516
2517                          
2518            
2519    /**
2520     * Collection to store aggregation of collRModuleAttributes
2521     */

2522    protected List JavaDoc collRModuleAttributes;
2523
2524    /**
2525     * Temporary storage of collRModuleAttributes to save a possible db hit in
2526     * the event objects are add to the collection, but the
2527     * complete collection is never requested.
2528     */

2529    protected void initRModuleAttributes()
2530    {
2531        if (collRModuleAttributes == null)
2532        {
2533            collRModuleAttributes = new ArrayList JavaDoc();
2534        }
2535    }
2536
2537            
2538    /**
2539     * Method called to associate a RModuleAttribute object to this object
2540     * through the RModuleAttribute foreign key attribute
2541     *
2542     * @param l RModuleAttribute
2543     * @throws TorqueException
2544     */

2545    public void addRModuleAttribute(RModuleAttribute l) throws TorqueException
2546    {
2547        getRModuleAttributes().add(l);
2548        l.setAttribute((Attribute)this);
2549    }
2550
2551    /**
2552     * The criteria used to select the current contents of collRModuleAttributes
2553     */

2554    private Criteria lastRModuleAttributesCriteria = null;
2555
2556    /**
2557     * If this collection has already been initialized, returns
2558     * the collection. Otherwise returns the results of
2559     * getRModuleAttributes(new Criteria())
2560     *
2561     * @throws TorqueException
2562     */

2563    public List JavaDoc getRModuleAttributes() throws TorqueException
2564    {
2565        if (collRModuleAttributes == null)
2566        {
2567            collRModuleAttributes = getRModuleAttributes(new Criteria(10));
2568        }
2569        return collRModuleAttributes;
2570    }
2571
2572    /**
2573     * If this collection has already been initialized with
2574     * an identical criteria, it returns the collection.
2575     * Otherwise if this Attribute has previously
2576     * been saved, it will retrieve related RModuleAttributes from storage.
2577     * If this Attribute is new, it will return
2578     * an empty collection or the current collection, the criteria
2579     * is ignored on a new object.
2580     *
2581     * @throws TorqueException
2582     */

2583    public List JavaDoc getRModuleAttributes(Criteria criteria) throws TorqueException
2584    {
2585        if (collRModuleAttributes == null)
2586        {
2587            if (isNew())
2588            {
2589               collRModuleAttributes = new ArrayList JavaDoc();
2590            }
2591            else
2592            {
2593                      criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2594                      collRModuleAttributes = RModuleAttributePeer.doSelect(criteria);
2595            }
2596        }
2597        else
2598        {
2599            // criteria has no effect for a new object
2600
if (!isNew())
2601            {
2602                // the following code is to determine if a new query is
2603
// called for. If the criteria is the same as the last
2604
// one, just return the collection.
2605
criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2606                      if (!lastRModuleAttributesCriteria.equals(criteria))
2607                {
2608                    collRModuleAttributes = RModuleAttributePeer.doSelect(criteria);
2609                }
2610            }
2611        }
2612        lastRModuleAttributesCriteria = criteria;
2613
2614        return collRModuleAttributes;
2615    }
2616
2617    /**
2618     * If this collection has already been initialized, returns
2619     * the collection. Otherwise returns the results of
2620     * getRModuleAttributes(new Criteria(),Connection)
2621     * This method takes in the Connection also as input so that
2622     * referenced objects can also be obtained using a Connection
2623     * that is taken as input
2624     */

2625    public List JavaDoc getRModuleAttributes(Connection JavaDoc con) throws TorqueException
2626    {
2627        if (collRModuleAttributes == null)
2628        {
2629            collRModuleAttributes = getRModuleAttributes(new Criteria(10),con);
2630        }
2631        return collRModuleAttributes;
2632    }
2633
2634    /**
2635     * If this collection has already been initialized with
2636     * an identical criteria, it returns the collection.
2637     * Otherwise if this Attribute has previously
2638     * been saved, it will retrieve related RModuleAttributes from storage.
2639     * If this Attribute is new, it will return
2640     * an empty collection or the current collection, the criteria
2641     * is ignored on a new object.
2642     * This method takes in the Connection also as input so that
2643     * referenced objects can also be obtained using a Connection
2644     * that is taken as input
2645     */

2646    public List JavaDoc getRModuleAttributes(Criteria criteria,Connection JavaDoc con) throws TorqueException
2647    {
2648        if (collRModuleAttributes == null)
2649        {
2650            if (isNew())
2651            {
2652               collRModuleAttributes = new ArrayList JavaDoc();
2653            }
2654            else
2655            {
2656                       criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2657                       collRModuleAttributes = RModuleAttributePeer.doSelect(criteria,con);
2658             }
2659         }
2660         else
2661         {
2662             // criteria has no effect for a new object
2663
if (!isNew())
2664             {
2665                 // the following code is to determine if a new query is
2666
// called for. If the criteria is the same as the last
2667
// one, just return the collection.
2668
criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2669                     if (!lastRModuleAttributesCriteria.equals(criteria))
2670                 {
2671                     collRModuleAttributes = RModuleAttributePeer.doSelect(criteria,con);
2672                 }
2673             }
2674         }
2675         lastRModuleAttributesCriteria = criteria;
2676
2677         return collRModuleAttributes;
2678     }
2679
2680                              
2681              
2682                    
2683                              
2684                                
2685                                                              
2686                                        
2687                    
2688                    
2689          
2690    /**
2691     * If this collection has already been initialized with
2692     * an identical criteria, it returns the collection.
2693     * Otherwise if this Attribute is new, it will return
2694     * an empty collection; or if this Attribute has previously
2695     * been saved, it will retrieve related RModuleAttributes from storage.
2696     *
2697     * This method is protected by default in order to keep the public
2698     * api reasonable. You can provide public methods for those you
2699     * actually need in Attribute.
2700     */

2701    protected List JavaDoc getRModuleAttributesJoinAttribute(Criteria criteria)
2702        throws TorqueException
2703    {
2704        if (collRModuleAttributes == null)
2705        {
2706            if (isNew())
2707            {
2708               collRModuleAttributes = new ArrayList JavaDoc();
2709            }
2710            else
2711            {
2712                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2713                            collRModuleAttributes = RModuleAttributePeer.doSelectJoinAttribute(criteria);
2714            }
2715        }
2716        else
2717        {
2718            // the following code is to determine if a new query is
2719
// called for. If the criteria is the same as the last
2720
// one, just return the collection.
2721

2722                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2723                        if (!lastRModuleAttributesCriteria.equals(criteria))
2724            {
2725                collRModuleAttributes = RModuleAttributePeer.doSelectJoinAttribute(criteria);
2726            }
2727        }
2728        lastRModuleAttributesCriteria = criteria;
2729
2730        return collRModuleAttributes;
2731    }
2732                  
2733                    
2734                    
2735                                
2736                                                              
2737                                        
2738                    
2739                    
2740          
2741    /**
2742     * If this collection has already been initialized with
2743     * an identical criteria, it returns the collection.
2744     * Otherwise if this Attribute is new, it will return
2745     * an empty collection; or if this Attribute has previously
2746     * been saved, it will retrieve related RModuleAttributes from storage.
2747     *
2748     * This method is protected by default in order to keep the public
2749     * api reasonable. You can provide public methods for those you
2750     * actually need in Attribute.
2751     */

2752    protected List JavaDoc getRModuleAttributesJoinScarabModule(Criteria criteria)
2753        throws TorqueException
2754    {
2755        if (collRModuleAttributes == null)
2756        {
2757            if (isNew())
2758            {
2759               collRModuleAttributes = new ArrayList JavaDoc();
2760            }
2761            else
2762            {
2763                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2764                            collRModuleAttributes = RModuleAttributePeer.doSelectJoinScarabModule(criteria);
2765            }
2766        }
2767        else
2768        {
2769            // the following code is to determine if a new query is
2770
// called for. If the criteria is the same as the last
2771
// one, just return the collection.
2772

2773                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2774                        if (!lastRModuleAttributesCriteria.equals(criteria))
2775            {
2776                collRModuleAttributes = RModuleAttributePeer.doSelectJoinScarabModule(criteria);
2777            }
2778        }
2779        lastRModuleAttributesCriteria = criteria;
2780
2781        return collRModuleAttributes;
2782    }
2783                  
2784                    
2785                    
2786                                
2787                                                              
2788                                        
2789                    
2790                    
2791          
2792    /**
2793     * If this collection has already been initialized with
2794     * an identical criteria, it returns the collection.
2795     * Otherwise if this Attribute is new, it will return
2796     * an empty collection; or if this Attribute has previously
2797     * been saved, it will retrieve related RModuleAttributes from storage.
2798     *
2799     * This method is protected by default in order to keep the public
2800     * api reasonable. You can provide public methods for those you
2801     * actually need in Attribute.
2802     */

2803    protected List JavaDoc getRModuleAttributesJoinIssueType(Criteria criteria)
2804        throws TorqueException
2805    {
2806        if (collRModuleAttributes == null)
2807        {
2808            if (isNew())
2809            {
2810               collRModuleAttributes = new ArrayList JavaDoc();
2811            }
2812            else
2813            {
2814                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2815                            collRModuleAttributes = RModuleAttributePeer.doSelectJoinIssueType(criteria);
2816            }
2817        }
2818        else
2819        {
2820            // the following code is to determine if a new query is
2821
// called for. If the criteria is the same as the last
2822
// one, just return the collection.
2823

2824                            criteria.add(RModuleAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2825                        if (!lastRModuleAttributesCriteria.equals(criteria))
2826            {
2827                collRModuleAttributes = RModuleAttributePeer.doSelectJoinIssueType(criteria);
2828            }
2829        }
2830        lastRModuleAttributesCriteria = criteria;
2831
2832        return collRModuleAttributes;
2833    }
2834                            
2835
2836
2837                          
2838            
2839    /**
2840     * Collection to store aggregation of collRIssueTypeAttributes
2841     */

2842    protected List JavaDoc collRIssueTypeAttributes;
2843
2844    /**
2845     * Temporary storage of collRIssueTypeAttributes to save a possible db hit in
2846     * the event objects are add to the collection, but the
2847     * complete collection is never requested.
2848     */

2849    protected void initRIssueTypeAttributes()
2850    {
2851        if (collRIssueTypeAttributes == null)
2852        {
2853            collRIssueTypeAttributes = new ArrayList JavaDoc();
2854        }
2855    }
2856
2857            
2858    /**
2859     * Method called to associate a RIssueTypeAttribute object to this object
2860     * through the RIssueTypeAttribute foreign key attribute
2861     *
2862     * @param l RIssueTypeAttribute
2863     * @throws TorqueException
2864     */

2865    public void addRIssueTypeAttribute(RIssueTypeAttribute l) throws TorqueException
2866    {
2867        getRIssueTypeAttributes().add(l);
2868        l.setAttribute((Attribute)this);
2869    }
2870
2871    /**
2872     * The criteria used to select the current contents of collRIssueTypeAttributes
2873     */

2874    private Criteria lastRIssueTypeAttributesCriteria = null;
2875
2876    /**
2877     * If this collection has already been initialized, returns
2878     * the collection. Otherwise returns the results of
2879     * getRIssueTypeAttributes(new Criteria())
2880     *
2881     * @throws TorqueException
2882     */

2883    public List JavaDoc getRIssueTypeAttributes() throws TorqueException
2884    {
2885        if (collRIssueTypeAttributes == null)
2886        {
2887            collRIssueTypeAttributes = getRIssueTypeAttributes(new Criteria(10));
2888        }
2889        return collRIssueTypeAttributes;
2890    }
2891
2892    /**
2893     * If this collection has already been initialized with
2894     * an identical criteria, it returns the collection.
2895     * Otherwise if this Attribute has previously
2896     * been saved, it will retrieve related RIssueTypeAttributes from storage.
2897     * If this Attribute is new, it will return
2898     * an empty collection or the current collection, the criteria
2899     * is ignored on a new object.
2900     *
2901     * @throws TorqueException
2902     */

2903    public List JavaDoc getRIssueTypeAttributes(Criteria criteria) throws TorqueException
2904    {
2905        if (collRIssueTypeAttributes == null)
2906        {
2907            if (isNew())
2908            {
2909               collRIssueTypeAttributes = new ArrayList JavaDoc();
2910            }
2911            else
2912            {
2913                      criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2914                      collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelect(criteria);
2915            }
2916        }
2917        else
2918        {
2919            // criteria has no effect for a new object
2920
if (!isNew())
2921            {
2922                // the following code is to determine if a new query is
2923
// called for. If the criteria is the same as the last
2924
// one, just return the collection.
2925
criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2926                      if (!lastRIssueTypeAttributesCriteria.equals(criteria))
2927                {
2928                    collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelect(criteria);
2929                }
2930            }
2931        }
2932        lastRIssueTypeAttributesCriteria = criteria;
2933
2934        return collRIssueTypeAttributes;
2935    }
2936
2937    /**
2938     * If this collection has already been initialized, returns
2939     * the collection. Otherwise returns the results of
2940     * getRIssueTypeAttributes(new Criteria(),Connection)
2941     * This method takes in the Connection also as input so that
2942     * referenced objects can also be obtained using a Connection
2943     * that is taken as input
2944     */

2945    public List JavaDoc getRIssueTypeAttributes(Connection JavaDoc con) throws TorqueException
2946    {
2947        if (collRIssueTypeAttributes == null)
2948        {
2949            collRIssueTypeAttributes = getRIssueTypeAttributes(new Criteria(10),con);
2950        }
2951        return collRIssueTypeAttributes;
2952    }
2953
2954    /**
2955     * If this collection has already been initialized with
2956     * an identical criteria, it returns the collection.
2957     * Otherwise if this Attribute has previously
2958     * been saved, it will retrieve related RIssueTypeAttributes from storage.
2959     * If this Attribute is new, it will return
2960     * an empty collection or the current collection, the criteria
2961     * is ignored on a new object.
2962     * This method takes in the Connection also as input so that
2963     * referenced objects can also be obtained using a Connection
2964     * that is taken as input
2965     */

2966    public List JavaDoc getRIssueTypeAttributes(Criteria criteria,Connection JavaDoc con) throws TorqueException
2967    {
2968        if (collRIssueTypeAttributes == null)
2969        {
2970            if (isNew())
2971            {
2972               collRIssueTypeAttributes = new ArrayList JavaDoc();
2973            }
2974            else
2975            {
2976                       criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2977                       collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelect(criteria,con);
2978             }
2979         }
2980         else
2981         {
2982             // criteria has no effect for a new object
2983
if (!isNew())
2984             {
2985                 // the following code is to determine if a new query is
2986
// called for. If the criteria is the same as the last
2987
// one, just return the collection.
2988
criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
2989                     if (!lastRIssueTypeAttributesCriteria.equals(criteria))
2990                 {
2991                     collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelect(criteria,con);
2992                 }
2993             }
2994         }
2995         lastRIssueTypeAttributesCriteria = criteria;
2996
2997         return collRIssueTypeAttributes;
2998     }
2999
3000                        
3001              
3002                    
3003                              
3004                                
3005                                                              
3006                                        
3007                    
3008                    
3009          
3010    /**
3011     * If this collection has already been initialized with
3012     * an identical criteria, it returns the collection.
3013     * Otherwise if this Attribute is new, it will return
3014     * an empty collection; or if this Attribute has previously
3015     * been saved, it will retrieve related RIssueTypeAttributes from storage.
3016     *
3017     * This method is protected by default in order to keep the public
3018     * api reasonable. You can provide public methods for those you
3019     * actually need in Attribute.
3020     */

3021    protected List JavaDoc getRIssueTypeAttributesJoinAttribute(Criteria criteria)
3022        throws TorqueException
3023    {
3024        if (collRIssueTypeAttributes == null)
3025        {
3026            if (isNew())
3027            {
3028               collRIssueTypeAttributes = new ArrayList JavaDoc();
3029            }
3030            else
3031            {
3032                            criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3033                            collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelectJoinAttribute(criteria);
3034            }
3035        }
3036        else
3037        {
3038            // the following code is to determine if a new query is
3039
// called for. If the criteria is the same as the last
3040
// one, just return the collection.
3041

3042                            criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3043                        if (!lastRIssueTypeAttributesCriteria.equals(criteria))
3044            {
3045                collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelectJoinAttribute(criteria);
3046            }
3047        }
3048        lastRIssueTypeAttributesCriteria = criteria;
3049
3050        return collRIssueTypeAttributes;
3051    }
3052                  
3053                    
3054                    
3055                                
3056                                                              
3057                                        
3058                    
3059                    
3060          
3061    /**
3062     * If this collection has already been initialized with
3063     * an identical criteria, it returns the collection.
3064     * Otherwise if this Attribute is new, it will return
3065     * an empty collection; or if this Attribute has previously
3066     * been saved, it will retrieve related RIssueTypeAttributes from storage.
3067     *
3068     * This method is protected by default in order to keep the public
3069     * api reasonable. You can provide public methods for those you
3070     * actually need in Attribute.
3071     */

3072    protected List JavaDoc getRIssueTypeAttributesJoinIssueType(Criteria criteria)
3073        throws TorqueException
3074    {
3075        if (collRIssueTypeAttributes == null)
3076        {
3077            if (isNew())
3078            {
3079               collRIssueTypeAttributes = new ArrayList JavaDoc();
3080            }
3081            else
3082            {
3083                            criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3084                            collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelectJoinIssueType(criteria);
3085            }
3086        }
3087        else
3088        {
3089            // the following code is to determine if a new query is
3090
// called for. If the criteria is the same as the last
3091
// one, just return the collection.
3092

3093                            criteria.add(RIssueTypeAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3094                        if (!lastRIssueTypeAttributesCriteria.equals(criteria))
3095            {
3096                collRIssueTypeAttributes = RIssueTypeAttributePeer.doSelectJoinIssueType(criteria);
3097            }
3098        }
3099        lastRIssueTypeAttributesCriteria = criteria;
3100
3101        return collRIssueTypeAttributes;
3102    }
3103                            
3104
3105
3106                          
3107            
3108    /**
3109     * Collection to store aggregation of collRModuleUserAttributes
3110     */

3111    protected List JavaDoc collRModuleUserAttributes;
3112
3113    /**
3114     * Temporary storage of collRModuleUserAttributes to save a possible db hit in
3115     * the event objects are add to the collection, but the
3116     * complete collection is never requested.
3117     */

3118    protected void initRModuleUserAttributes()
3119    {
3120        if (collRModuleUserAttributes == null)
3121        {
3122            collRModuleUserAttributes = new ArrayList JavaDoc();
3123        }
3124    }
3125
3126            
3127    /**
3128     * Method called to associate a RModuleUserAttribute object to this object
3129     * through the RModuleUserAttribute foreign key attribute
3130     *
3131     * @param l RModuleUserAttribute
3132     * @throws TorqueException
3133     */

3134    public void addRModuleUserAttribute(RModuleUserAttribute l) throws TorqueException
3135    {
3136        getRModuleUserAttributes().add(l);
3137        l.setAttribute((Attribute)this);
3138    }
3139
3140    /**
3141     * The criteria used to select the current contents of collRModuleUserAttributes
3142     */

3143    private Criteria lastRModuleUserAttributesCriteria = null;
3144
3145    /**
3146     * If this collection has already been initialized, returns
3147     * the collection. Otherwise returns the results of
3148     * getRModuleUserAttributes(new Criteria())
3149     *
3150     * @throws TorqueException
3151     */

3152    public List JavaDoc getRModuleUserAttributes() throws TorqueException
3153    {
3154        if (collRModuleUserAttributes == null)
3155        {
3156            collRModuleUserAttributes = getRModuleUserAttributes(new Criteria(10));
3157        }
3158        return collRModuleUserAttributes;
3159    }
3160
3161    /**
3162     * If this collection has already been initialized with
3163     * an identical criteria, it returns the collection.
3164     * Otherwise if this Attribute has previously
3165     * been saved, it will retrieve related RModuleUserAttributes from storage.
3166     * If this Attribute is new, it will return
3167     * an empty collection or the current collection, the criteria
3168     * is ignored on a new object.
3169     *
3170     * @throws TorqueException
3171     */

3172    public List JavaDoc getRModuleUserAttributes(Criteria criteria) throws TorqueException
3173    {
3174        if (collRModuleUserAttributes == null)
3175        {
3176            if (isNew())
3177            {
3178               collRModuleUserAttributes = new ArrayList JavaDoc();
3179            }
3180            else
3181            {
3182                      criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3183                      collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria);
3184            }
3185        }
3186        else
3187        {
3188            // criteria has no effect for a new object
3189
if (!isNew())
3190            {
3191                // the following code is to determine if a new query is
3192
// called for. If the criteria is the same as the last
3193
// one, just return the collection.
3194
criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3195                      if (!lastRModuleUserAttributesCriteria.equals(criteria))
3196                {
3197                    collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria);
3198                }
3199            }
3200        }
3201        lastRModuleUserAttributesCriteria = criteria;
3202
3203        return collRModuleUserAttributes;
3204    }
3205
3206    /**
3207     * If this collection has already been initialized, returns
3208     * the collection. Otherwise returns the results of
3209     * getRModuleUserAttributes(new Criteria(),Connection)
3210     * This method takes in the Connection also as input so that
3211     * referenced objects can also be obtained using a Connection
3212     * that is taken as input
3213     */

3214    public List JavaDoc getRModuleUserAttributes(Connection JavaDoc con) throws TorqueException
3215    {
3216        if (collRModuleUserAttributes == null)
3217        {
3218            collRModuleUserAttributes = getRModuleUserAttributes(new Criteria(10),con);
3219        }
3220        return collRModuleUserAttributes;
3221    }
3222
3223    /**
3224     * If this collection has already been initialized with
3225     * an identical criteria, it returns the collection.
3226     * Otherwise if this Attribute has previously
3227     * been saved, it will retrieve related RModuleUserAttributes from storage.
3228     * If this Attribute is new, it will return
3229     * an empty collection or the current collection, the criteria
3230     * is ignored on a new object.
3231     * This method takes in the Connection also as input so that
3232     * referenced objects can also be obtained using a Connection
3233     * that is taken as input
3234     */

3235    public List JavaDoc getRModuleUserAttributes(Criteria criteria,Connection JavaDoc con) throws TorqueException
3236    {
3237        if (collRModuleUserAttributes == null)
3238        {
3239            if (isNew())
3240            {
3241               collRModuleUserAttributes = new ArrayList JavaDoc();
3242            }
3243            else
3244            {
3245                       criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3246                       collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria,con);
3247             }
3248         }
3249         else
3250         {
3251             // criteria has no effect for a new object
3252
if (!isNew())
3253             {
3254                 // the following code is to determine if a new query is
3255
// called for. If the criteria is the same as the last
3256
// one, just return the collection.
3257
criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3258                     if (!lastRModuleUserAttributesCriteria.equals(criteria))
3259                 {
3260                     collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria,con);
3261                 }
3262             }
3263         }
3264         lastRModuleUserAttributesCriteria = criteria;
3265
3266         return collRModuleUserAttributes;
3267     }
3268
3269                                          
3270              
3271                    
3272                    
3273                                
3274                                                              
3275                                        
3276                    
3277                    
3278          
3279    /**
3280     * If this collection has already been initialized with
3281     * an identical criteria, it returns the collection.
3282     * Otherwise if this Attribute is new, it will return
3283     * an empty collection; or if this Attribute has previously
3284     * been saved, it will retrieve related RModuleUserAttributes from storage.
3285     *
3286     * This method is protected by default in order to keep the public
3287     * api reasonable. You can provide public methods for those you
3288     * actually need in Attribute.
3289     */

3290    protected List JavaDoc getRModuleUserAttributesJoinMITList(Criteria criteria)
3291        throws TorqueException
3292    {
3293        if (collRModuleUserAttributes == null)
3294        {
3295            if (isNew())
3296            {
3297               collRModuleUserAttributes = new ArrayList JavaDoc();
3298            }
3299            else
3300            {
3301                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3302                            collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinMITList(criteria);
3303            }
3304        }
3305        else
3306        {
3307            // the following code is to determine if a new query is
3308
// called for. If the criteria is the same as the last
3309
// one, just return the collection.
3310

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

3341    protected List JavaDoc getRModuleUserAttributesJoinScarabModule(Criteria criteria)
3342        throws TorqueException
3343    {
3344        if (collRModuleUserAttributes == null)
3345        {
3346            if (isNew())
3347            {
3348               collRModuleUserAttributes = new ArrayList JavaDoc();
3349            }
3350            else
3351            {
3352                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3353                            collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabModule(criteria);
3354            }
3355        }
3356        else
3357        {
3358            // the following code is to determine if a new query is
3359
// called for. If the criteria is the same as the last
3360
// one, just return the collection.
3361

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

3392    protected List JavaDoc getRModuleUserAttributesJoinScarabUserImpl(Criteria criteria)
3393        throws TorqueException
3394    {
3395        if (collRModuleUserAttributes == null)
3396        {
3397            if (isNew())
3398            {
3399               collRModuleUserAttributes = new ArrayList JavaDoc();
3400            }
3401            else
3402            {
3403                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3404                            collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabUserImpl(criteria);
3405            }
3406        }
3407        else
3408        {
3409            // the following code is to determine if a new query is
3410
// called for. If the criteria is the same as the last
3411
// one, just return the collection.
3412

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

3443    protected List JavaDoc getRModuleUserAttributesJoinIssueType(Criteria criteria)
3444        throws TorqueException
3445    {
3446        if (collRModuleUserAttributes == null)
3447        {
3448            if (isNew())
3449            {
3450               collRModuleUserAttributes = new ArrayList JavaDoc();
3451            }
3452            else
3453            {
3454                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3455                            collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinIssueType(criteria);
3456            }
3457        }
3458        else
3459        {
3460            // the following code is to determine if a new query is
3461
// called for. If the criteria is the same as the last
3462
// one, just return the collection.
3463

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

3494    protected List JavaDoc getRModuleUserAttributesJoinAttribute(Criteria criteria)
3495        throws TorqueException
3496    {
3497        if (collRModuleUserAttributes == null)
3498        {
3499            if (isNew())
3500            {
3501               collRModuleUserAttributes = new ArrayList JavaDoc();
3502            }
3503            else
3504            {
3505                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3506                            collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinAttribute(criteria);
3507            }
3508        }
3509        else
3510        {
3511            // the following code is to determine if a new query is
3512
// called for. If the criteria is the same as the last
3513
// one, just return the collection.
3514

3515                            criteria.add(RModuleUserAttributePeer.ATTRIBUTE_ID, getAttributeId() );
3516                        if (!lastRModuleUserAttributesCriteria.equals(criteria))
3517            {
3518                collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinAttribute(criteria);
3519            }
3520        }
3521        lastRModuleUserAttributesCriteria = criteria;
3522
3523        return collRModuleUserAttributes;
3524    }
3525                            
3526
3527
3528                          
3529            
3530    /**
3531     * Collection to store aggregation of collTransitions
3532     */

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

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

3556    public void addTransition(Transition l) throws TorqueException
3557    {
3558        getTransitions().add(l);
3559        l.setAttribute((Attribute)this);
3560    }
3561
3562    /**
3563     * The criteria used to select the current contents of collTransitions
3564     */

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

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

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

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

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

3712    protected List JavaDoc getTransitionsJoinAttribute(Criteria criteria)
3713        throws TorqueException
3714    {
3715        if (collTransitions == null)
3716        {
3717            if (isNew())
3718            {
3719               collTransitions = new ArrayList JavaDoc();
3720            }
3721            else
3722            {
3723                            criteria.add(TransitionPeer.ATTRIBUTE_ID, getAttributeId() );
3724                            collTransitions = TransitionPeer.doSelectJoinAttribute(criteria);
3725            }
3726        }
3727        else
3728        {
3729            // the following code is to determine if a new query is
3730
// called for. If the criteria is the same as the last
3731
// one, just return the collection.
3732

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

3763    protected List JavaDoc getTransitionsJoinAttributeOptionRelatedByFromOptionId(Criteria criteria)
3764        throws TorqueException
3765    {
3766        if (collTransitions == null)
3767        {
3768            if (isNew())
3769            {
3770               collTransitions = new ArrayList JavaDoc();
3771            }
3772            else
3773            {
3774                            criteria.add(TransitionPeer.ATTRIBUTE_ID, getAttributeId() );
3775                            collTransitions = TransitionPeer.doSelectJoinAttributeOptionRelatedByFromOptionId(criteria);
3776            }
3777        }
3778        else
3779        {
3780            // the following code is to determine if a new query is
3781
// called for. If the criteria is the same as the last
3782
// one, just return the collection.
3783

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

3814    protected List JavaDoc getTransitionsJoinAttributeOptionRelatedByToOptionId(Criteria criteria)
3815        throws TorqueException
3816    {
3817        if (collTransitions == null)
3818        {
3819            if (isNew())
3820            {
3821               collTransitions = new ArrayList JavaDoc();
3822            }
3823            else
3824            {
3825                            criteria.add(TransitionPeer.ATTRIBUTE_ID, getAttributeId() );
3826                            collTransitions = TransitionPeer.doSelectJoinAttributeOptionRelatedByToOptionId(criteria);
3827            }
3828        }
3829        else
3830        {
3831            // the following code is to determine if a new query is
3832
// called for. If the criteria is the same as the last
3833
// one, just return the collection.
3834

3835                            criteria.add(TransitionPeer.ATTRIBUTE_ID, getAttributeId() );
3836                        if (!lastTransitionsCriteria.equals(criteria))
3837            {
3838                collTransitions = TransitionPeer.doSelectJoinAttributeOptionRelatedByToOptionId(criteria);
3839            }
3840        }
3841        lastTransitionsCriteria = criteria;
3842
3843        return collTransitions;
3844    }
3845                            
3846
3847
3848          
3849    private static List JavaDoc fieldNames = null;
3850
3851    /**
3852     * Generate a list of field names.
3853     *
3854     * @return a list of field names
3855     */

3856    public static synchronized List JavaDoc getFieldNames()
3857    {
3858        if (fieldNames == null)
3859        {
3860            fieldNames = new ArrayList JavaDoc();
3861              fieldNames.add("AttributeId");
3862              fieldNames.add("Name");
3863              fieldNames.add("TypeId");
3864              fieldNames.add("Permission");
3865              fieldNames.add("RequiredOptionId");
3866              fieldNames.add("Description");
3867              fieldNames.add("Action");
3868              fieldNames.add("CreatedBy");
3869              fieldNames.add("CreatedDate");
3870              fieldNames.add("Deleted");
3871              fieldNames = Collections.unmodifiableList(fieldNames);
3872        }
3873        return fieldNames;
3874    }
3875
3876    /**
3877     * Retrieves a field from the object by name passed in as a String.
3878     *
3879     * @param name field name
3880     * @return value
3881     */

3882    public Object JavaDoc getByName(String JavaDoc name)
3883    {
3884          if (name.equals("AttributeId"))
3885        {
3886                return getAttributeId();
3887            }
3888          if (name.equals("Name"))
3889        {
3890                return getName();
3891            }
3892          if (name.equals("TypeId"))
3893        {
3894                return getTypeId();
3895            }
3896          if (name.equals("Permission"))
3897        {
3898                return getPermission();
3899            }
3900          if (name.equals("RequiredOptionId"))
3901        {
3902                return getRequiredOptionId();
3903            }
3904          if (name.equals("Description"))
3905        {
3906                return getDescription();
3907            }
3908          if (name.equals("Action"))
3909        {
3910                return getAction();
3911            }
3912          if (name.equals("CreatedBy"))
3913        {
3914                return getCreatedBy();
3915            }
3916          if (name.equals("CreatedDate"))
3917        {
3918                return getCreatedDate();
3919            }
3920          if (name.equals("Deleted"))
3921        {
3922                return Boolean.valueOf(getDeleted());
3923            }
3924          return null;
3925    }
3926    
3927    /**
3928     * Retrieves a field from the object by name passed in
3929     * as a String. The String must be one of the static
3930     * Strings defined in this Class' Peer.
3931     *
3932     * @param name peer name
3933     * @return value
3934     */

3935    public Object JavaDoc getByPeerName(String JavaDoc name)
3936    {
3937          if (name.equals(AttributePeer.ATTRIBUTE_ID))
3938        {
3939                return getAttributeId();
3940            }
3941          if (name.equals(AttributePeer.ATTRIBUTE_NAME))
3942        {
3943                return getName();
3944            }
3945          if (name.equals(AttributePeer.ATTRIBUTE_TYPE_ID))
3946        {
3947                return getTypeId();
3948            }
3949          if (name.equals(AttributePeer.PERMISSION))
3950        {
3951                return getPermission();
3952            }
3953          if (name.equals(AttributePeer.REQUIRED_OPTION_ID))
3954        {
3955                return getRequiredOptionId();
3956            }
3957          if (name.equals(AttributePeer.DESCRIPTION))
3958        {
3959                return getDescription();
3960            }
3961          if (name.equals(AttributePeer.ACTION))
3962        {
3963                return getAction();
3964            }
3965          if (name.equals(AttributePeer.CREATED_BY))
3966        {
3967                return getCreatedBy();
3968            }
3969          if (name.equals(AttributePeer.CREATED_DATE))
3970        {
3971                return getCreatedDate();
3972            }
3973          if (name.equals(AttributePeer.DELETED))
3974        {
3975                return Boolean.valueOf(getDeleted());
3976            }
3977          return null;
3978    }
3979
3980    /**
3981     * Retrieves a field from the object by Position as specified
3982     * in the xml schema. Zero-based.
3983     *
3984     * @param pos position in xml schema
3985     * @return value
3986     */

3987    public Object JavaDoc getByPosition(int pos)
3988    {
3989            if (pos == 0)
3990        {
3991                return getAttributeId();
3992            }
3993              if (pos == 1)
3994        {
3995                return getName();
3996            }
3997              if (pos == 2)
3998        {
3999                return getTypeId();
4000            }
4001              if (pos == 3)
4002        {
4003                return getPermission();
4004            }
4005              if (pos == 4)
4006        {
4007                return getRequiredOptionId();
4008            }
4009              if (pos == 5)
4010        {
4011                return getDescription();
4012            }
4013              if (pos == 6)
4014        {
4015                return getAction();
4016            }
4017              if (pos == 7)
4018        {
4019                return getCreatedBy();
4020            }
4021              if (pos == 8)
4022        {
4023                return getCreatedDate();
4024            }
4025              if (pos == 9)
4026        {
4027                return Boolean.valueOf(getDeleted());
4028            }
4029              return null;
4030    }
4031     
4032    /**
4033     * Stores the object in the database. If the object is new,
4034     * it inserts it; otherwise an update is performed.
4035     *
4036     * @throws Exception
4037     */

4038    public void save() throws Exception JavaDoc
4039    {
4040          save(AttributePeer.getMapBuilder()
4041                .getDatabaseMap().getName());
4042      }
4043
4044    /**
4045     * Stores the object in the database. If the object is new,
4046     * it inserts it; otherwise an update is performed.
4047       * Note: this code is here because the method body is
4048     * auto-generated conditionally and therefore needs to be
4049     * in this file instead of in the super class, BaseObject.
4050       *
4051     * @param dbName
4052     * @throws TorqueException
4053     */

4054    public void save(String JavaDoc dbName) throws TorqueException
4055    {
4056        Connection JavaDoc con = null;
4057          try
4058        {
4059            con = Transaction.begin(dbName);
4060            save(con);
4061            Transaction.commit(con);
4062        }
4063        catch(TorqueException e)
4064        {
4065            Transaction.safeRollback(con);
4066            throw e;
4067        }
4068      }
4069
4070      /** flag to prevent endless save loop, if this object is referenced
4071        by another object which falls in this transaction. */

4072    private boolean alreadyInSave = false;
4073      /**
4074     * Stores the object in the database. If the object is new,
4075     * it inserts it; otherwise an update is performed. This method
4076     * is meant to be used as part of a transaction, otherwise use
4077     * the save() method and the connection details will be handled
4078     * internally
4079     *
4080     * @param con
4081     * @throws TorqueException
4082     */

4083    public void save(Connection JavaDoc con) throws TorqueException
4084    {
4085          if (!alreadyInSave)
4086        {
4087            alreadyInSave = true;
4088
4089
4090  
4091            // If this object has been modified, then save it to the database.
4092
if (isModified())
4093            {
4094                if (isNew())
4095                {
4096                    AttributePeer.doInsert((Attribute)this, con);
4097                    setNew(false);
4098                }
4099                else
4100                {
4101                    AttributePeer.doUpdate((Attribute)this, con);
4102                }
4103
4104                      if (isCacheOnSave())
4105                {
4106                    AttributeManager.putInstance(this);
4107                }
4108              }
4109
4110                                      
4111                            if (collActivitys != null)
4112            {
4113                for (int i = 0; i < collActivitys.size(); i++)
4114                {
4115                    ((Activity)collActivitys.get(i)).save(con);
4116                }
4117            }
4118                                          
4119                            if (collConditions != null)
4120            {
4121                for (int i = 0; i < collConditions.size(); i++)
4122                {
4123                    ((Condition)collConditions.get(i)).save(con);
4124                }
4125            }
4126                                          
4127                            if (collRAttributeAttributeGroups != null)
4128            {
4129                for (int i = 0; i < collRAttributeAttributeGroups.size(); i++)
4130                {
4131                    ((RAttributeAttributeGroup)collRAttributeAttributeGroups.get(i)).save(con);
4132                }
4133            }
4134                                          
4135                            if (collAttributeOptions != null)
4136            {
4137                for (int i = 0; i < collAttributeOptions.size(); i++)
4138                {
4139                    ((AttributeOption)collAttributeOptions.get(i)).save(con);
4140                }
4141            }
4142                                          
4143                            if (collAttributeValues != null)
4144            {
4145                for (int i = 0; i < collAttributeValues.size(); i++)
4146                {
4147                    ((AttributeValue)collAttributeValues.get(i)).save(con);
4148                }
4149            }
4150                                          
4151                            if (collRModuleAttributes != null)
4152            {
4153                for (int i = 0; i < collRModuleAttributes.size(); i++)
4154                {
4155                    ((RModuleAttribute)collRModuleAttributes.get(i)).save(con);
4156                }
4157            }
4158                                          
4159                            if (collRIssueTypeAttributes != null)
4160            {
4161                for (int i = 0; i < collRIssueTypeAttributes.size(); i++)
4162                {
4163                    ((RIssueTypeAttribute)collRIssueTypeAttributes.get(i)).save(con);
4164                }
4165            }
4166                                          
4167                            if (collRModuleUserAttributes != null)
4168            {
4169                for (int i = 0; i < collRModuleUserAttributes.size(); i++)
4170                {
4171                    ((RModuleUserAttribute)collRModuleUserAttributes.get(i)).save(con);
4172                }
4173            }
4174                                          
4175                            if (collTransitions != null)
4176            {
4177                for (int i = 0; i < collTransitions.size(); i++)
4178                {
4179                    ((Transition)collTransitions.get(i)).save(con);
4180                }
4181            }
4182                          alreadyInSave = false;
4183        }
4184      }
4185
4186    /**
4187     * Specify whether to cache the object after saving to the db.
4188     * This method returns false
4189     */

4190    protected boolean isCacheOnSave()
4191    {
4192        return true;
4193    }
4194
4195                        
4196      /**
4197     * Set the PrimaryKey using ObjectKey.
4198     *
4199     * @param attributeId ObjectKey
4200     */

4201    public void setPrimaryKey(ObjectKey attributeId)
4202        throws TorqueException {
4203            setAttributeId(new Integer JavaDoc(((NumberKey)attributeId).intValue()));
4204        }
4205
4206    /**
4207     * Set the PrimaryKey using a String.
4208     *
4209     * @param key
4210     */

4211    public void setPrimaryKey(String JavaDoc key) throws TorqueException
4212    {
4213            setAttributeId(new Integer JavaDoc(key));
4214        }
4215
4216  
4217    /**
4218     * returns an id that differentiates this object from others
4219     * of its class.
4220     */

4221    public ObjectKey getPrimaryKey()
4222    {
4223          return SimpleKey.keyFor(getAttributeId());
4224      }
4225 
4226    /**
4227     * get an id that differentiates this object from others
4228     * of its class.
4229     */

4230    public String JavaDoc getQueryKey()
4231    {
4232        if (getPrimaryKey() == null)
4233        {
4234            return "";
4235        }
4236        else
4237        {
4238            return getPrimaryKey().toString();
4239        }
4240    }
4241
4242    /**
4243     * set an id that differentiates this object from others
4244     * of its class.
4245     */

4246    public void setQueryKey(String JavaDoc key)
4247        throws TorqueException
4248    {
4249        setPrimaryKey(key);
4250    }
4251
4252    /**
4253     * Makes a copy of this object.
4254     * It creates a new object filling in the simple attributes.
4255       * It then fills all the association collections and sets the
4256     * related objects to isNew=true.
4257       */

4258      public Attribute copy() throws TorqueException
4259    {
4260        Attribute copyObj = new Attribute();
4261            copyObj.setAttributeId(attributeId);
4262          copyObj.setName(name);
4263          copyObj.setTypeId(typeId);
4264          copyObj.setPermission(permission);
4265          copyObj.setRequiredOptionId(requiredOptionId);
4266          copyObj.setDescription(description);
4267          copyObj.setAction(action);
4268          copyObj.setCreatedBy(createdBy);
4269          copyObj.setCreatedDate(createdDate);
4270          copyObj.setDeleted(deleted);
4271  
4272                      copyObj.setAttributeId((Integer JavaDoc)null);
4273                                                                  
4274                                      
4275                
4276        List JavaDoc v = getActivitys();
4277        for (int i = 0; i < v.size(); i++)
4278        {
4279            Activity obj = (Activity) v.get(i);
4280            copyObj.addActivity(obj.copy());
4281        }
4282                                                  
4283                
4284        v = getConditions();
4285        for (int i = 0; i < v.size(); i++)
4286        {
4287            Condition obj = (Condition) v.get(i);
4288            copyObj.addCondition(obj.copy());
4289        }
4290                                                  
4291                
4292        v = getRAttributeAttributeGroups();
4293        for (int i = 0; i < v.size(); i++)
4294        {
4295            RAttributeAttributeGroup obj = (RAttributeAttributeGroup) v.get(i);
4296            copyObj.addRAttributeAttributeGroup(obj.copy());
4297        }
4298                                                  
4299                
4300        v = getAttributeOptions();
4301        for (int i = 0; i < v.size(); i++)
4302        {
4303            AttributeOption obj = (AttributeOption) v.get(i);
4304            copyObj.addAttributeOption(obj.copy());
4305        }
4306                                                  
4307                
4308        v = getAttributeValues();
4309        for (int i = 0; i < v.size(); i++)
4310        {
4311            AttributeValue obj = (AttributeValue) v.get(i);
4312            copyObj.addAttributeValue(obj.copy());
4313        }
4314                                                  
4315                
4316        v = getRModuleAttributes();
4317        for (int i = 0; i < v.size(); i++)
4318        {
4319            RModuleAttribute obj = (RModuleAttribute) v.get(i);
4320            copyObj.addRModuleAttribute(obj.copy());
4321        }
4322                                                  
4323                
4324        v = getRIssueTypeAttributes();
4325        for (int i = 0; i < v.size(); i++)
4326        {
4327            RIssueTypeAttribute obj = (RIssueTypeAttribute) v.get(i);
4328            copyObj.addRIssueTypeAttribute(obj.copy());
4329        }
4330                                                  
4331                
4332        v = getRModuleUserAttributes();
4333        for (int i = 0; i < v.size(); i++)
4334        {
4335            RModuleUserAttribute obj = (RModuleUserAttribute) v.get(i);
4336            copyObj.addRModuleUserAttribute(obj.copy());
4337        }
4338                                                  
4339                
4340        v = getTransitions();
4341        for (int i = 0; i < v.size(); i++)
4342        {
4343            Transition obj = (Transition) v.get(i);
4344            copyObj.addTransition(obj.copy());
4345        }
4346                            return copyObj;
4347    }
4348
4349    /**
4350     * returns a peer instance associated with this om. Since Peer classes
4351     * are not to have any instance attributes, this method returns the
4352     * same instance for all member of this class. The method could therefore
4353     * be static, but this would prevent one from overriding the behavior.
4354     */

4355    public AttributePeer getPeer()
4356    {
4357        return peer;
4358    }
4359
4360    public String JavaDoc toString()
4361    {
4362        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
4363        str.append("Attribute:\n");
4364        str.append("AttributeId = ")
4365               .append(getAttributeId())
4366             .append("\n");
4367        str.append("Name = ")
4368               .append(getName())
4369             .append("\n");
4370        str.append("TypeId = ")
4371               .append(getTypeId())
4372             .append("\n");
4373        str.append("Permission = ")
4374               .append(getPermission())
4375             .append("\n");
4376        str.append("RequiredOptionId = ")
4377               .append(getRequiredOptionId())
4378             .append("\n");
4379        str.append("Description = ")
4380               .append(getDescription())
4381             .append("\n");
4382        str.append("Action = ")
4383               .append(getAction())
4384             .append("\n");
4385        str.append("CreatedBy = ")
4386               .append(getCreatedBy())
4387             .append("\n");
4388        str.append("CreatedDate = ")
4389               .append(getCreatedDate())
4390             .append("\n");
4391        str.append("Deleted = ")
4392               .append(getDeleted())
4393             .append("\n");
4394        return(str.toString());
4395    }
4396}
4397
Popular Tags