Source Code Cross Referenced for BaseIssue.java in  » Issue-Tracking » scarab-0.21 » org » tigris » scarab » om » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Issue Tracking » scarab 0.21 » org.tigris.scarab.om 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        package org.tigris.scarab.om;
0002:
0003:        import java.math.BigDecimal;
0004:        import java.sql.Connection;
0005:        import java.util.ArrayList;
0006:        import java.util.Collections;
0007:        import java.util.Date;
0008:        import java.util.List;
0009:
0010:        import org.apache.commons.lang.ObjectUtils;
0011:        import org.apache.fulcrum.intake.Retrievable;
0012:        import org.apache.torque.TorqueException;
0013:        import org.apache.torque.om.BaseObject;
0014:        import org.apache.torque.om.ComboKey;
0015:        import org.apache.torque.om.DateKey;
0016:        import org.apache.torque.om.NumberKey;
0017:        import org.apache.torque.om.ObjectKey;
0018:        import org.apache.torque.om.SimpleKey;
0019:        import org.apache.torque.om.StringKey;
0020:        import org.apache.torque.om.Persistent;
0021:        import org.apache.torque.util.Criteria;
0022:        import org.apache.torque.util.Transaction;
0023:
0024:        /**
0025:         * You should not use this class directly.  It should not even be
0026:         * extended all references should be to Issue
0027:         */
0028:        public abstract class BaseIssue extends BaseObject implements 
0029:                org.apache.fulcrum.intake.Retrievable {
0030:            /** The Peer class */
0031:            private static final IssuePeer peer = new IssuePeer();
0032:
0033:            /** The value for the issueId field */
0034:            private Long issueId;
0035:
0036:            /** The value for the idPrefix field */
0037:            private String idPrefix;
0038:
0039:            /** The value for the idCount field */
0040:            private int idCount;
0041:
0042:            /** The value for the idDomain field */
0043:            private String idDomain;
0044:
0045:            /** The value for the typeId field */
0046:            private Integer typeId;
0047:
0048:            /** The value for the moduleId field */
0049:            private Integer moduleId;
0050:
0051:            /** The value for the createdTransId field */
0052:            private Long createdTransId;
0053:
0054:            /** The value for the lastTransId field */
0055:            private Long lastTransId;
0056:
0057:            /** The value for the deleted field */
0058:            private boolean deleted = false;
0059:
0060:            /** The value for the moved field */
0061:            private boolean moved = false;
0062:
0063:            /**
0064:             * Get the IssueId
0065:             *
0066:             * @return Long
0067:             */
0068:            public Long getIssueId() {
0069:                return issueId;
0070:            }
0071:
0072:            /**
0073:             * Set the value of IssueId
0074:             *
0075:             * @param v new value
0076:             */
0077:            public void setIssueId(Long v) throws TorqueException {
0078:
0079:                if (!ObjectUtils.equals(this .issueId, v)) {
0080:                    this .issueId = v;
0081:                    setModified(true);
0082:                }
0083:
0084:                // update associated Activity
0085:                if (collActivitys != null) {
0086:                    for (int i = 0; i < collActivitys.size(); i++) {
0087:                        ((Activity) collActivitys.get(i)).setIssueId(v);
0088:                    }
0089:                }
0090:
0091:                // update associated Attachment
0092:                if (collAttachments != null) {
0093:                    for (int i = 0; i < collAttachments.size(); i++) {
0094:                        ((Attachment) collAttachments.get(i)).setIssueId(v);
0095:                    }
0096:                }
0097:
0098:                // update associated Depend
0099:                if (collDependsRelatedByObservedId != null) {
0100:                    for (int i = 0; i < collDependsRelatedByObservedId.size(); i++) {
0101:                        ((Depend) collDependsRelatedByObservedId.get(i))
0102:                                .setObservedId(v);
0103:                    }
0104:                }
0105:
0106:                // update associated Depend
0107:                if (collDependsRelatedByObserverId != null) {
0108:                    for (int i = 0; i < collDependsRelatedByObserverId.size(); i++) {
0109:                        ((Depend) collDependsRelatedByObserverId.get(i))
0110:                                .setObserverId(v);
0111:                    }
0112:                }
0113:
0114:                // update associated AttributeValue
0115:                if (collAttributeValues != null) {
0116:                    for (int i = 0; i < collAttributeValues.size(); i++) {
0117:                        ((AttributeValue) collAttributeValues.get(i))
0118:                                .setIssueId(v);
0119:                    }
0120:                }
0121:
0122:                // update associated IssueVote
0123:                if (collIssueVotes != null) {
0124:                    for (int i = 0; i < collIssueVotes.size(); i++) {
0125:                        ((IssueVote) collIssueVotes.get(i)).setIssueId(v);
0126:                    }
0127:                }
0128:
0129:                // update associated IssueTemplateInfo
0130:                if (collIssueTemplateInfos != null) {
0131:                    for (int i = 0; i < collIssueTemplateInfos.size(); i++) {
0132:                        ((IssueTemplateInfo) collIssueTemplateInfos.get(i))
0133:                                .setIssueId(v);
0134:                    }
0135:                }
0136:            }
0137:
0138:            /**
0139:             * Get the IdPrefix
0140:             *
0141:             * @return String
0142:             */
0143:            public String getIdPrefix() {
0144:                return idPrefix;
0145:            }
0146:
0147:            /**
0148:             * Set the value of IdPrefix
0149:             *
0150:             * @param v new value
0151:             */
0152:            public void setIdPrefix(String v) {
0153:
0154:                if (!ObjectUtils.equals(this .idPrefix, v)) {
0155:                    this .idPrefix = v;
0156:                    setModified(true);
0157:                }
0158:
0159:            }
0160:
0161:            /**
0162:             * Get the IdCount
0163:             *
0164:             * @return int
0165:             */
0166:            public int getIdCount() {
0167:                return idCount;
0168:            }
0169:
0170:            /**
0171:             * Set the value of IdCount
0172:             *
0173:             * @param v new value
0174:             */
0175:            public void setIdCount(int v) {
0176:
0177:                if (this .idCount != v) {
0178:                    this .idCount = v;
0179:                    setModified(true);
0180:                }
0181:
0182:            }
0183:
0184:            /**
0185:             * Get the IdDomain
0186:             *
0187:             * @return String
0188:             */
0189:            public String getIdDomain() {
0190:                return idDomain;
0191:            }
0192:
0193:            /**
0194:             * Set the value of IdDomain
0195:             *
0196:             * @param v new value
0197:             */
0198:            public void setIdDomain(String v) {
0199:
0200:                if (!ObjectUtils.equals(this .idDomain, v)) {
0201:                    this .idDomain = v;
0202:                    setModified(true);
0203:                }
0204:
0205:            }
0206:
0207:            /**
0208:             * Get the TypeId
0209:             *
0210:             * @return Integer
0211:             */
0212:            public Integer getTypeId() {
0213:                return typeId;
0214:            }
0215:
0216:            /**
0217:             * Set the value of TypeId
0218:             *
0219:             * @param v new value
0220:             */
0221:            public void setTypeId(Integer v) throws TorqueException {
0222:
0223:                if (!ObjectUtils.equals(this .typeId, v)) {
0224:                    this .typeId = v;
0225:                    setModified(true);
0226:                }
0227:
0228:                if (aIssueType != null
0229:                        && !ObjectUtils.equals(aIssueType.getIssueTypeId(), v)) {
0230:                    aIssueType = null;
0231:                }
0232:
0233:            }
0234:
0235:            /**
0236:             * Get the ModuleId
0237:             *
0238:             * @return Integer
0239:             */
0240:            public Integer getModuleId() {
0241:                return moduleId;
0242:            }
0243:
0244:            /**
0245:             * Set the value of ModuleId
0246:             *
0247:             * @param v new value
0248:             */
0249:            public void setModuleId(Integer v) throws TorqueException {
0250:
0251:                if (!ObjectUtils.equals(this .moduleId, v)) {
0252:                    this .moduleId = v;
0253:                    setModified(true);
0254:                }
0255:
0256:                if (aModule != null
0257:                        && !ObjectUtils.equals(aModule.getModuleId(), v)) {
0258:                    aModule = null;
0259:                }
0260:
0261:            }
0262:
0263:            /**
0264:             * Get the CreatedTransId
0265:             *
0266:             * @return Long
0267:             */
0268:            public Long getCreatedTransId() {
0269:                return createdTransId;
0270:            }
0271:
0272:            /**
0273:             * Set the value of CreatedTransId
0274:             *
0275:             * @param v new value
0276:             */
0277:            public void setCreatedTransId(Long v) throws TorqueException {
0278:
0279:                if (!ObjectUtils.equals(this .createdTransId, v)) {
0280:                    this .createdTransId = v;
0281:                    setModified(true);
0282:                }
0283:
0284:                if (aActivitySetRelatedByCreatedTransId != null
0285:                        && !ObjectUtils.equals(
0286:                                aActivitySetRelatedByCreatedTransId
0287:                                        .getActivitySetId(), v)) {
0288:                    aActivitySetRelatedByCreatedTransId = null;
0289:                }
0290:
0291:            }
0292:
0293:            /**
0294:             * Get the LastTransId
0295:             *
0296:             * @return Long
0297:             */
0298:            public Long getLastTransId() {
0299:                return lastTransId;
0300:            }
0301:
0302:            /**
0303:             * Set the value of LastTransId
0304:             *
0305:             * @param v new value
0306:             */
0307:            public void setLastTransId(Long v) throws TorqueException {
0308:
0309:                if (!ObjectUtils.equals(this .lastTransId, v)) {
0310:                    this .lastTransId = v;
0311:                    setModified(true);
0312:                }
0313:
0314:                if (aActivitySetRelatedByLastTransId != null
0315:                        && !ObjectUtils.equals(aActivitySetRelatedByLastTransId
0316:                                .getActivitySetId(), v)) {
0317:                    aActivitySetRelatedByLastTransId = null;
0318:                }
0319:
0320:            }
0321:
0322:            /**
0323:             * Get the Deleted
0324:             *
0325:             * @return boolean
0326:             */
0327:            public boolean getDeleted() {
0328:                return deleted;
0329:            }
0330:
0331:            /**
0332:             * Set the value of Deleted
0333:             *
0334:             * @param v new value
0335:             */
0336:            public void setDeleted(boolean v) {
0337:
0338:                if (this .deleted != v) {
0339:                    this .deleted = v;
0340:                    setModified(true);
0341:                }
0342:
0343:            }
0344:
0345:            /**
0346:             * Get the Moved
0347:             *
0348:             * @return boolean
0349:             */
0350:            public boolean getMoved() {
0351:                return moved;
0352:            }
0353:
0354:            /**
0355:             * Set the value of Moved
0356:             *
0357:             * @param v new value
0358:             */
0359:            public void setMoved(boolean v) {
0360:
0361:                if (this .moved != v) {
0362:                    this .moved = v;
0363:                    setModified(true);
0364:                }
0365:
0366:            }
0367:
0368:            private Module aModule;
0369:
0370:            /**
0371:             * Declares an association between this object and a Module object
0372:             *
0373:             * @param v Module
0374:             * @throws TorqueException
0375:             */
0376:            public void setModule(Module v) throws TorqueException {
0377:                if (v == null) {
0378:                    setModuleId((Integer) null);
0379:                } else {
0380:                    setModuleId(v.getModuleId());
0381:                }
0382:                aModule = v;
0383:            }
0384:
0385:            /**
0386:             * Returns the associated Module object.
0387:             * If it was not retrieved before, the object is retrieved from
0388:             * the database
0389:             *
0390:             * @return the associated Module object
0391:             * @throws TorqueException
0392:             */
0393:            public Module getModule() throws TorqueException {
0394:                if (aModule == null
0395:                        && (!ObjectUtils.equals(this .moduleId, null))) {
0396:                    aModule = ModuleManager.getInstance(SimpleKey
0397:                            .keyFor(this .moduleId));
0398:                }
0399:                return aModule;
0400:            }
0401:
0402:            /**
0403:             * Return the associated Module object
0404:             * If it was not retrieved before, the object is retrieved from
0405:             * the database using the passed connection
0406:             *
0407:             * @param connection the connection used to retrieve the associated object
0408:             *        from the database, if it was not retrieved before
0409:             * @return the associated Module object
0410:             * @throws TorqueException
0411:             */
0412:            public Module getModule(Connection connection)
0413:                    throws TorqueException {
0414:                if (aModule == null
0415:                        && (!ObjectUtils.equals(this .moduleId, null))) {
0416:                    aModule = ModuleManager.getCachedInstance(SimpleKey
0417:                            .keyFor(this .moduleId));
0418:                    if (aModule == null) {
0419:                        aModule = ScarabModulePeer.retrieveByPK(SimpleKey
0420:                                .keyFor(this .moduleId), connection);
0421:                        ModuleManager.putInstance(aModule);
0422:                    }
0423:                }
0424:                return aModule;
0425:            }
0426:
0427:            /**
0428:             * Provides convenient way to set a relationship based on a
0429:             * ObjectKey, for example
0430:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
0431:             *
0432:             */
0433:            public void setModuleKey(ObjectKey key) throws TorqueException {
0434:
0435:                setModuleId(new Integer(((NumberKey) key).intValue()));
0436:            }
0437:
0438:            private IssueType aIssueType;
0439:
0440:            /**
0441:             * Declares an association between this object and a IssueType object
0442:             *
0443:             * @param v IssueType
0444:             * @throws TorqueException
0445:             */
0446:            public void setIssueType(IssueType v) throws TorqueException {
0447:                if (v == null) {
0448:                    setTypeId((Integer) null);
0449:                } else {
0450:                    setTypeId(v.getIssueTypeId());
0451:                }
0452:                aIssueType = v;
0453:            }
0454:
0455:            /**
0456:             * Returns the associated IssueType object.
0457:             * If it was not retrieved before, the object is retrieved from
0458:             * the database
0459:             *
0460:             * @return the associated IssueType object
0461:             * @throws TorqueException
0462:             */
0463:            public IssueType getIssueType() throws TorqueException {
0464:                if (aIssueType == null
0465:                        && (!ObjectUtils.equals(this .typeId, null))) {
0466:                    aIssueType = IssueTypeManager.getInstance(SimpleKey
0467:                            .keyFor(this .typeId));
0468:                }
0469:                return aIssueType;
0470:            }
0471:
0472:            /**
0473:             * Return the associated IssueType object
0474:             * If it was not retrieved before, the object is retrieved from
0475:             * the database using the passed connection
0476:             *
0477:             * @param connection the connection used to retrieve the associated object
0478:             *        from the database, if it was not retrieved before
0479:             * @return the associated IssueType object
0480:             * @throws TorqueException
0481:             */
0482:            public IssueType getIssueType(Connection connection)
0483:                    throws TorqueException {
0484:                if (aIssueType == null
0485:                        && (!ObjectUtils.equals(this .typeId, null))) {
0486:                    aIssueType = IssueTypeManager.getCachedInstance(SimpleKey
0487:                            .keyFor(this .typeId));
0488:                    if (aIssueType == null) {
0489:                        aIssueType = IssueTypePeer.retrieveByPK(SimpleKey
0490:                                .keyFor(this .typeId), connection);
0491:                        IssueTypeManager.putInstance(aIssueType);
0492:                    }
0493:                }
0494:                return aIssueType;
0495:            }
0496:
0497:            /**
0498:             * Provides convenient way to set a relationship based on a
0499:             * ObjectKey, for example
0500:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
0501:             *
0502:             */
0503:            public void setIssueTypeKey(ObjectKey key) throws TorqueException {
0504:
0505:                setTypeId(new Integer(((NumberKey) key).intValue()));
0506:            }
0507:
0508:            private ActivitySet aActivitySetRelatedByCreatedTransId;
0509:
0510:            /**
0511:             * Declares an association between this object and a ActivitySet object
0512:             *
0513:             * @param v ActivitySet
0514:             * @throws TorqueException
0515:             */
0516:            public void setActivitySetRelatedByCreatedTransId(ActivitySet v)
0517:                    throws TorqueException {
0518:                if (v == null) {
0519:                    setCreatedTransId((Long) null);
0520:                } else {
0521:                    setCreatedTransId(v.getActivitySetId());
0522:                }
0523:                aActivitySetRelatedByCreatedTransId = v;
0524:            }
0525:
0526:            /**
0527:             * Returns the associated ActivitySet object.
0528:             * If it was not retrieved before, the object is retrieved from
0529:             * the database
0530:             *
0531:             * @return the associated ActivitySet object
0532:             * @throws TorqueException
0533:             */
0534:            public ActivitySet getActivitySetRelatedByCreatedTransId()
0535:                    throws TorqueException {
0536:                if (aActivitySetRelatedByCreatedTransId == null
0537:                        && (!ObjectUtils.equals(this .createdTransId, null))) {
0538:                    aActivitySetRelatedByCreatedTransId = ActivitySetManager
0539:                            .getInstance(SimpleKey.keyFor(this .createdTransId));
0540:                }
0541:                return aActivitySetRelatedByCreatedTransId;
0542:            }
0543:
0544:            /**
0545:             * Return the associated ActivitySet object
0546:             * If it was not retrieved before, the object is retrieved from
0547:             * the database using the passed connection
0548:             *
0549:             * @param connection the connection used to retrieve the associated object
0550:             *        from the database, if it was not retrieved before
0551:             * @return the associated ActivitySet object
0552:             * @throws TorqueException
0553:             */
0554:            public ActivitySet getActivitySetRelatedByCreatedTransId(
0555:                    Connection connection) throws TorqueException {
0556:                if (aActivitySetRelatedByCreatedTransId == null
0557:                        && (!ObjectUtils.equals(this .createdTransId, null))) {
0558:                    aActivitySetRelatedByCreatedTransId = ActivitySetManager
0559:                            .getCachedInstance(SimpleKey
0560:                                    .keyFor(this .createdTransId));
0561:                    if (aActivitySetRelatedByCreatedTransId == null) {
0562:                        aActivitySetRelatedByCreatedTransId = ActivitySetPeer
0563:                                .retrieveByPK(SimpleKey
0564:                                        .keyFor(this .createdTransId),
0565:                                        connection);
0566:                        ActivitySetManager
0567:                                .putInstance(aActivitySetRelatedByCreatedTransId);
0568:                    }
0569:                }
0570:                return aActivitySetRelatedByCreatedTransId;
0571:            }
0572:
0573:            /**
0574:             * Provides convenient way to set a relationship based on a
0575:             * ObjectKey, for example
0576:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
0577:             *
0578:             */
0579:            public void setActivitySetRelatedByCreatedTransIdKey(ObjectKey key)
0580:                    throws TorqueException {
0581:
0582:                setCreatedTransId(new Long(((NumberKey) key).longValue()));
0583:            }
0584:
0585:            private ActivitySet aActivitySetRelatedByLastTransId;
0586:
0587:            /**
0588:             * Declares an association between this object and a ActivitySet object
0589:             *
0590:             * @param v ActivitySet
0591:             * @throws TorqueException
0592:             */
0593:            public void setActivitySetRelatedByLastTransId(ActivitySet v)
0594:                    throws TorqueException {
0595:                if (v == null) {
0596:                    setLastTransId((Long) null);
0597:                } else {
0598:                    setLastTransId(v.getActivitySetId());
0599:                }
0600:                aActivitySetRelatedByLastTransId = v;
0601:            }
0602:
0603:            /**
0604:             * Returns the associated ActivitySet object.
0605:             * If it was not retrieved before, the object is retrieved from
0606:             * the database
0607:             *
0608:             * @return the associated ActivitySet object
0609:             * @throws TorqueException
0610:             */
0611:            public ActivitySet getActivitySetRelatedByLastTransId()
0612:                    throws TorqueException {
0613:                if (aActivitySetRelatedByLastTransId == null
0614:                        && (!ObjectUtils.equals(this .lastTransId, null))) {
0615:                    aActivitySetRelatedByLastTransId = ActivitySetManager
0616:                            .getInstance(SimpleKey.keyFor(this .lastTransId));
0617:                }
0618:                return aActivitySetRelatedByLastTransId;
0619:            }
0620:
0621:            /**
0622:             * Return the associated ActivitySet object
0623:             * If it was not retrieved before, the object is retrieved from
0624:             * the database using the passed connection
0625:             *
0626:             * @param connection the connection used to retrieve the associated object
0627:             *        from the database, if it was not retrieved before
0628:             * @return the associated ActivitySet object
0629:             * @throws TorqueException
0630:             */
0631:            public ActivitySet getActivitySetRelatedByLastTransId(
0632:                    Connection connection) throws TorqueException {
0633:                if (aActivitySetRelatedByLastTransId == null
0634:                        && (!ObjectUtils.equals(this .lastTransId, null))) {
0635:                    aActivitySetRelatedByLastTransId = ActivitySetManager
0636:                            .getCachedInstance(SimpleKey
0637:                                    .keyFor(this .lastTransId));
0638:                    if (aActivitySetRelatedByLastTransId == null) {
0639:                        aActivitySetRelatedByLastTransId = ActivitySetPeer
0640:                                .retrieveByPK(SimpleKey
0641:                                        .keyFor(this .lastTransId), connection);
0642:                        ActivitySetManager
0643:                                .putInstance(aActivitySetRelatedByLastTransId);
0644:                    }
0645:                }
0646:                return aActivitySetRelatedByLastTransId;
0647:            }
0648:
0649:            /**
0650:             * Provides convenient way to set a relationship based on a
0651:             * ObjectKey, for example
0652:             * <code>bar.setFooKey(foo.getPrimaryKey())</code>
0653:             *
0654:             */
0655:            public void setActivitySetRelatedByLastTransIdKey(ObjectKey key)
0656:                    throws TorqueException {
0657:
0658:                setLastTransId(new Long(((NumberKey) key).longValue()));
0659:            }
0660:
0661:            /**
0662:             * Collection to store aggregation of collActivitys
0663:             */
0664:            protected List collActivitys;
0665:
0666:            /**
0667:             * Temporary storage of collActivitys to save a possible db hit in
0668:             * the event objects are add to the collection, but the
0669:             * complete collection is never requested.
0670:             */
0671:            protected void initActivitys() {
0672:                if (collActivitys == null) {
0673:                    collActivitys = new ArrayList();
0674:                }
0675:            }
0676:
0677:            /**
0678:             * Method called to associate a Activity object to this object
0679:             * through the Activity foreign key attribute
0680:             *
0681:             * @param l Activity
0682:             * @throws TorqueException
0683:             */
0684:            public void addActivity(Activity l) throws TorqueException {
0685:                getActivitys().add(l);
0686:                l.setIssue((Issue) this );
0687:            }
0688:
0689:            /**
0690:             * The criteria used to select the current contents of collActivitys
0691:             */
0692:            private Criteria lastActivitysCriteria = null;
0693:
0694:            /**
0695:             * If this collection has already been initialized, returns
0696:             * the collection. Otherwise returns the results of
0697:             * getActivitys(new Criteria())
0698:             *
0699:             * @return the collection of associated objects
0700:             * @throws TorqueException
0701:             */
0702:            public List getActivitys() throws TorqueException {
0703:                if (collActivitys == null) {
0704:                    collActivitys = getActivitys(new Criteria(10));
0705:                }
0706:                return collActivitys;
0707:            }
0708:
0709:            /**
0710:             * If this collection has already been initialized with
0711:             * an identical criteria, it returns the collection.
0712:             * Otherwise if this Issue has previously
0713:             * been saved, it will retrieve related Activitys from storage.
0714:             * If this Issue is new, it will return
0715:             * an empty collection or the current collection, the criteria
0716:             * is ignored on a new object.
0717:             *
0718:             * @throws TorqueException
0719:             */
0720:            public List getActivitys(Criteria criteria) throws TorqueException {
0721:                if (collActivitys == null) {
0722:                    if (isNew()) {
0723:                        collActivitys = new ArrayList();
0724:                    } else {
0725:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0726:                        collActivitys = ActivityPeer.doSelect(criteria);
0727:                    }
0728:                } else {
0729:                    // criteria has no effect for a new object
0730:                    if (!isNew()) {
0731:                        // the following code is to determine if a new query is
0732:                        // called for.  If the criteria is the same as the last
0733:                        // one, just return the collection.
0734:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0735:                        if (!lastActivitysCriteria.equals(criteria)) {
0736:                            collActivitys = ActivityPeer.doSelect(criteria);
0737:                        }
0738:                    }
0739:                }
0740:                lastActivitysCriteria = criteria;
0741:
0742:                return collActivitys;
0743:            }
0744:
0745:            /**
0746:             * If this collection has already been initialized, returns
0747:             * the collection. Otherwise returns the results of
0748:             * getActivitys(new Criteria(),Connection)
0749:             * This method takes in the Connection also as input so that
0750:             * referenced objects can also be obtained using a Connection
0751:             * that is taken as input
0752:             */
0753:            public List getActivitys(Connection con) throws TorqueException {
0754:                if (collActivitys == null) {
0755:                    collActivitys = getActivitys(new Criteria(10), con);
0756:                }
0757:                return collActivitys;
0758:            }
0759:
0760:            /**
0761:             * If this collection has already been initialized with
0762:             * an identical criteria, it returns the collection.
0763:             * Otherwise if this Issue has previously
0764:             * been saved, it will retrieve related Activitys from storage.
0765:             * If this Issue is new, it will return
0766:             * an empty collection or the current collection, the criteria
0767:             * is ignored on a new object.
0768:             * This method takes in the Connection also as input so that
0769:             * referenced objects can also be obtained using a Connection
0770:             * that is taken as input
0771:             */
0772:            public List getActivitys(Criteria criteria, Connection con)
0773:                    throws TorqueException {
0774:                if (collActivitys == null) {
0775:                    if (isNew()) {
0776:                        collActivitys = new ArrayList();
0777:                    } else {
0778:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0779:                        collActivitys = ActivityPeer.doSelect(criteria, con);
0780:                    }
0781:                } else {
0782:                    // criteria has no effect for a new object
0783:                    if (!isNew()) {
0784:                        // the following code is to determine if a new query is
0785:                        // called for.  If the criteria is the same as the last
0786:                        // one, just return the collection.
0787:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0788:                        if (!lastActivitysCriteria.equals(criteria)) {
0789:                            collActivitys = ActivityPeer
0790:                                    .doSelect(criteria, con);
0791:                        }
0792:                    }
0793:                }
0794:                lastActivitysCriteria = criteria;
0795:
0796:                return collActivitys;
0797:            }
0798:
0799:            /**
0800:             * If this collection has already been initialized with
0801:             * an identical criteria, it returns the collection.
0802:             * Otherwise if this Issue is new, it will return
0803:             * an empty collection; or if this Issue has previously
0804:             * been saved, it will retrieve related Activitys from storage.
0805:             *
0806:             * This method is protected by default in order to keep the public
0807:             * api reasonable.  You can provide public methods for those you
0808:             * actually need in Issue.
0809:             */
0810:            protected List getActivitysJoinIssue(Criteria criteria)
0811:                    throws TorqueException {
0812:                if (collActivitys == null) {
0813:                    if (isNew()) {
0814:                        collActivitys = new ArrayList();
0815:                    } else {
0816:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0817:                        collActivitys = ActivityPeer
0818:                                .doSelectJoinIssue(criteria);
0819:                    }
0820:                } else {
0821:                    // the following code is to determine if a new query is
0822:                    // called for.  If the criteria is the same as the last
0823:                    // one, just return the collection.
0824:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0825:                    if (!lastActivitysCriteria.equals(criteria)) {
0826:                        collActivitys = ActivityPeer
0827:                                .doSelectJoinIssue(criteria);
0828:                    }
0829:                }
0830:                lastActivitysCriteria = criteria;
0831:
0832:                return collActivitys;
0833:            }
0834:
0835:            /**
0836:             * If this collection has already been initialized with
0837:             * an identical criteria, it returns the collection.
0838:             * Otherwise if this Issue is new, it will return
0839:             * an empty collection; or if this Issue has previously
0840:             * been saved, it will retrieve related Activitys from storage.
0841:             *
0842:             * This method is protected by default in order to keep the public
0843:             * api reasonable.  You can provide public methods for those you
0844:             * actually need in Issue.
0845:             */
0846:            protected List getActivitysJoinAttribute(Criteria criteria)
0847:                    throws TorqueException {
0848:                if (collActivitys == null) {
0849:                    if (isNew()) {
0850:                        collActivitys = new ArrayList();
0851:                    } else {
0852:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0853:                        collActivitys = ActivityPeer
0854:                                .doSelectJoinAttribute(criteria);
0855:                    }
0856:                } else {
0857:                    // the following code is to determine if a new query is
0858:                    // called for.  If the criteria is the same as the last
0859:                    // one, just return the collection.
0860:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0861:                    if (!lastActivitysCriteria.equals(criteria)) {
0862:                        collActivitys = ActivityPeer
0863:                                .doSelectJoinAttribute(criteria);
0864:                    }
0865:                }
0866:                lastActivitysCriteria = criteria;
0867:
0868:                return collActivitys;
0869:            }
0870:
0871:            /**
0872:             * If this collection has already been initialized with
0873:             * an identical criteria, it returns the collection.
0874:             * Otherwise if this Issue is new, it will return
0875:             * an empty collection; or if this Issue has previously
0876:             * been saved, it will retrieve related Activitys from storage.
0877:             *
0878:             * This method is protected by default in order to keep the public
0879:             * api reasonable.  You can provide public methods for those you
0880:             * actually need in Issue.
0881:             */
0882:            protected List getActivitysJoinActivitySet(Criteria criteria)
0883:                    throws TorqueException {
0884:                if (collActivitys == null) {
0885:                    if (isNew()) {
0886:                        collActivitys = new ArrayList();
0887:                    } else {
0888:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0889:                        collActivitys = ActivityPeer
0890:                                .doSelectJoinActivitySet(criteria);
0891:                    }
0892:                } else {
0893:                    // the following code is to determine if a new query is
0894:                    // called for.  If the criteria is the same as the last
0895:                    // one, just return the collection.
0896:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0897:                    if (!lastActivitysCriteria.equals(criteria)) {
0898:                        collActivitys = ActivityPeer
0899:                                .doSelectJoinActivitySet(criteria);
0900:                    }
0901:                }
0902:                lastActivitysCriteria = criteria;
0903:
0904:                return collActivitys;
0905:            }
0906:
0907:            /**
0908:             * If this collection has already been initialized with
0909:             * an identical criteria, it returns the collection.
0910:             * Otherwise if this Issue is new, it will return
0911:             * an empty collection; or if this Issue has previously
0912:             * been saved, it will retrieve related Activitys from storage.
0913:             *
0914:             * This method is protected by default in order to keep the public
0915:             * api reasonable.  You can provide public methods for those you
0916:             * actually need in Issue.
0917:             */
0918:            protected List getActivitysJoinScarabUserImplRelatedByOldUserId(
0919:                    Criteria criteria) throws TorqueException {
0920:                if (collActivitys == null) {
0921:                    if (isNew()) {
0922:                        collActivitys = new ArrayList();
0923:                    } else {
0924:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0925:                        collActivitys = ActivityPeer
0926:                                .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
0927:                    }
0928:                } else {
0929:                    // the following code is to determine if a new query is
0930:                    // called for.  If the criteria is the same as the last
0931:                    // one, just return the collection.
0932:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0933:                    if (!lastActivitysCriteria.equals(criteria)) {
0934:                        collActivitys = ActivityPeer
0935:                                .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
0936:                    }
0937:                }
0938:                lastActivitysCriteria = criteria;
0939:
0940:                return collActivitys;
0941:            }
0942:
0943:            /**
0944:             * If this collection has already been initialized with
0945:             * an identical criteria, it returns the collection.
0946:             * Otherwise if this Issue is new, it will return
0947:             * an empty collection; or if this Issue has previously
0948:             * been saved, it will retrieve related Activitys from storage.
0949:             *
0950:             * This method is protected by default in order to keep the public
0951:             * api reasonable.  You can provide public methods for those you
0952:             * actually need in Issue.
0953:             */
0954:            protected List getActivitysJoinScarabUserImplRelatedByNewUserId(
0955:                    Criteria criteria) throws TorqueException {
0956:                if (collActivitys == null) {
0957:                    if (isNew()) {
0958:                        collActivitys = new ArrayList();
0959:                    } else {
0960:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0961:                        collActivitys = ActivityPeer
0962:                                .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
0963:                    }
0964:                } else {
0965:                    // the following code is to determine if a new query is
0966:                    // called for.  If the criteria is the same as the last
0967:                    // one, just return the collection.
0968:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0969:                    if (!lastActivitysCriteria.equals(criteria)) {
0970:                        collActivitys = ActivityPeer
0971:                                .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
0972:                    }
0973:                }
0974:                lastActivitysCriteria = criteria;
0975:
0976:                return collActivitys;
0977:            }
0978:
0979:            /**
0980:             * If this collection has already been initialized with
0981:             * an identical criteria, it returns the collection.
0982:             * Otherwise if this Issue is new, it will return
0983:             * an empty collection; or if this Issue has previously
0984:             * been saved, it will retrieve related Activitys from storage.
0985:             *
0986:             * This method is protected by default in order to keep the public
0987:             * api reasonable.  You can provide public methods for those you
0988:             * actually need in Issue.
0989:             */
0990:            protected List getActivitysJoinAttributeOptionRelatedByOldOptionId(
0991:                    Criteria criteria) throws TorqueException {
0992:                if (collActivitys == null) {
0993:                    if (isNew()) {
0994:                        collActivitys = new ArrayList();
0995:                    } else {
0996:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
0997:                        collActivitys = ActivityPeer
0998:                                .doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
0999:                    }
1000:                } else {
1001:                    // the following code is to determine if a new query is
1002:                    // called for.  If the criteria is the same as the last
1003:                    // one, just return the collection.
1004:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1005:                    if (!lastActivitysCriteria.equals(criteria)) {
1006:                        collActivitys = ActivityPeer
1007:                                .doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
1008:                    }
1009:                }
1010:                lastActivitysCriteria = criteria;
1011:
1012:                return collActivitys;
1013:            }
1014:
1015:            /**
1016:             * If this collection has already been initialized with
1017:             * an identical criteria, it returns the collection.
1018:             * Otherwise if this Issue is new, it will return
1019:             * an empty collection; or if this Issue has previously
1020:             * been saved, it will retrieve related Activitys from storage.
1021:             *
1022:             * This method is protected by default in order to keep the public
1023:             * api reasonable.  You can provide public methods for those you
1024:             * actually need in Issue.
1025:             */
1026:            protected List getActivitysJoinAttributeOptionRelatedByNewOptionId(
1027:                    Criteria criteria) throws TorqueException {
1028:                if (collActivitys == null) {
1029:                    if (isNew()) {
1030:                        collActivitys = new ArrayList();
1031:                    } else {
1032:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1033:                        collActivitys = ActivityPeer
1034:                                .doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1035:                    }
1036:                } else {
1037:                    // the following code is to determine if a new query is
1038:                    // called for.  If the criteria is the same as the last
1039:                    // one, just return the collection.
1040:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1041:                    if (!lastActivitysCriteria.equals(criteria)) {
1042:                        collActivitys = ActivityPeer
1043:                                .doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
1044:                    }
1045:                }
1046:                lastActivitysCriteria = criteria;
1047:
1048:                return collActivitys;
1049:            }
1050:
1051:            /**
1052:             * If this collection has already been initialized with
1053:             * an identical criteria, it returns the collection.
1054:             * Otherwise if this Issue is new, it will return
1055:             * an empty collection; or if this Issue has previously
1056:             * been saved, it will retrieve related Activitys from storage.
1057:             *
1058:             * This method is protected by default in order to keep the public
1059:             * api reasonable.  You can provide public methods for those you
1060:             * actually need in Issue.
1061:             */
1062:            protected List getActivitysJoinAttachment(Criteria criteria)
1063:                    throws TorqueException {
1064:                if (collActivitys == null) {
1065:                    if (isNew()) {
1066:                        collActivitys = new ArrayList();
1067:                    } else {
1068:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1069:                        collActivitys = ActivityPeer
1070:                                .doSelectJoinAttachment(criteria);
1071:                    }
1072:                } else {
1073:                    // the following code is to determine if a new query is
1074:                    // called for.  If the criteria is the same as the last
1075:                    // one, just return the collection.
1076:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1077:                    if (!lastActivitysCriteria.equals(criteria)) {
1078:                        collActivitys = ActivityPeer
1079:                                .doSelectJoinAttachment(criteria);
1080:                    }
1081:                }
1082:                lastActivitysCriteria = criteria;
1083:
1084:                return collActivitys;
1085:            }
1086:
1087:            /**
1088:             * If this collection has already been initialized with
1089:             * an identical criteria, it returns the collection.
1090:             * Otherwise if this Issue is new, it will return
1091:             * an empty collection; or if this Issue has previously
1092:             * been saved, it will retrieve related Activitys from storage.
1093:             *
1094:             * This method is protected by default in order to keep the public
1095:             * api reasonable.  You can provide public methods for those you
1096:             * actually need in Issue.
1097:             */
1098:            protected List getActivitysJoinDepend(Criteria criteria)
1099:                    throws TorqueException {
1100:                if (collActivitys == null) {
1101:                    if (isNew()) {
1102:                        collActivitys = new ArrayList();
1103:                    } else {
1104:                        criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1105:                        collActivitys = ActivityPeer
1106:                                .doSelectJoinDepend(criteria);
1107:                    }
1108:                } else {
1109:                    // the following code is to determine if a new query is
1110:                    // called for.  If the criteria is the same as the last
1111:                    // one, just return the collection.
1112:                    criteria.add(ActivityPeer.ISSUE_ID, getIssueId());
1113:                    if (!lastActivitysCriteria.equals(criteria)) {
1114:                        collActivitys = ActivityPeer
1115:                                .doSelectJoinDepend(criteria);
1116:                    }
1117:                }
1118:                lastActivitysCriteria = criteria;
1119:
1120:                return collActivitys;
1121:            }
1122:
1123:            /**
1124:             * Collection to store aggregation of collAttachments
1125:             */
1126:            protected List collAttachments;
1127:
1128:            /**
1129:             * Temporary storage of collAttachments to save a possible db hit in
1130:             * the event objects are add to the collection, but the
1131:             * complete collection is never requested.
1132:             */
1133:            protected void initAttachments() {
1134:                if (collAttachments == null) {
1135:                    collAttachments = new ArrayList();
1136:                }
1137:            }
1138:
1139:            /**
1140:             * Method called to associate a Attachment object to this object
1141:             * through the Attachment foreign key attribute
1142:             *
1143:             * @param l Attachment
1144:             * @throws TorqueException
1145:             */
1146:            public void addAttachment(Attachment l) throws TorqueException {
1147:                getAttachments().add(l);
1148:                l.setIssue((Issue) this );
1149:            }
1150:
1151:            /**
1152:             * The criteria used to select the current contents of collAttachments
1153:             */
1154:            private Criteria lastAttachmentsCriteria = null;
1155:
1156:            /**
1157:             * If this collection has already been initialized, returns
1158:             * the collection. Otherwise returns the results of
1159:             * getAttachments(new Criteria())
1160:             *
1161:             * @return the collection of associated objects
1162:             * @throws TorqueException
1163:             */
1164:            public List getAttachments() throws TorqueException {
1165:                if (collAttachments == null) {
1166:                    collAttachments = getAttachments(new Criteria(10));
1167:                }
1168:                return collAttachments;
1169:            }
1170:
1171:            /**
1172:             * If this collection has already been initialized with
1173:             * an identical criteria, it returns the collection.
1174:             * Otherwise if this Issue has previously
1175:             * been saved, it will retrieve related Attachments from storage.
1176:             * If this Issue is new, it will return
1177:             * an empty collection or the current collection, the criteria
1178:             * is ignored on a new object.
1179:             *
1180:             * @throws TorqueException
1181:             */
1182:            public List getAttachments(Criteria criteria)
1183:                    throws TorqueException {
1184:                if (collAttachments == null) {
1185:                    if (isNew()) {
1186:                        collAttachments = new ArrayList();
1187:                    } else {
1188:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1189:                        collAttachments = AttachmentPeer.doSelect(criteria);
1190:                    }
1191:                } else {
1192:                    // criteria has no effect for a new object
1193:                    if (!isNew()) {
1194:                        // the following code is to determine if a new query is
1195:                        // called for.  If the criteria is the same as the last
1196:                        // one, just return the collection.
1197:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1198:                        if (!lastAttachmentsCriteria.equals(criteria)) {
1199:                            collAttachments = AttachmentPeer.doSelect(criteria);
1200:                        }
1201:                    }
1202:                }
1203:                lastAttachmentsCriteria = criteria;
1204:
1205:                return collAttachments;
1206:            }
1207:
1208:            /**
1209:             * If this collection has already been initialized, returns
1210:             * the collection. Otherwise returns the results of
1211:             * getAttachments(new Criteria(),Connection)
1212:             * This method takes in the Connection also as input so that
1213:             * referenced objects can also be obtained using a Connection
1214:             * that is taken as input
1215:             */
1216:            public List getAttachments(Connection con) throws TorqueException {
1217:                if (collAttachments == null) {
1218:                    collAttachments = getAttachments(new Criteria(10), con);
1219:                }
1220:                return collAttachments;
1221:            }
1222:
1223:            /**
1224:             * If this collection has already been initialized with
1225:             * an identical criteria, it returns the collection.
1226:             * Otherwise if this Issue has previously
1227:             * been saved, it will retrieve related Attachments from storage.
1228:             * If this Issue is new, it will return
1229:             * an empty collection or the current collection, the criteria
1230:             * is ignored on a new object.
1231:             * This method takes in the Connection also as input so that
1232:             * referenced objects can also be obtained using a Connection
1233:             * that is taken as input
1234:             */
1235:            public List getAttachments(Criteria criteria, Connection con)
1236:                    throws TorqueException {
1237:                if (collAttachments == null) {
1238:                    if (isNew()) {
1239:                        collAttachments = new ArrayList();
1240:                    } else {
1241:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1242:                        collAttachments = AttachmentPeer
1243:                                .doSelect(criteria, con);
1244:                    }
1245:                } else {
1246:                    // criteria has no effect for a new object
1247:                    if (!isNew()) {
1248:                        // the following code is to determine if a new query is
1249:                        // called for.  If the criteria is the same as the last
1250:                        // one, just return the collection.
1251:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1252:                        if (!lastAttachmentsCriteria.equals(criteria)) {
1253:                            collAttachments = AttachmentPeer.doSelect(criteria,
1254:                                    con);
1255:                        }
1256:                    }
1257:                }
1258:                lastAttachmentsCriteria = criteria;
1259:
1260:                return collAttachments;
1261:            }
1262:
1263:            /**
1264:             * If this collection has already been initialized with
1265:             * an identical criteria, it returns the collection.
1266:             * Otherwise if this Issue is new, it will return
1267:             * an empty collection; or if this Issue has previously
1268:             * been saved, it will retrieve related Attachments from storage.
1269:             *
1270:             * This method is protected by default in order to keep the public
1271:             * api reasonable.  You can provide public methods for those you
1272:             * actually need in Issue.
1273:             */
1274:            protected List getAttachmentsJoinIssue(Criteria criteria)
1275:                    throws TorqueException {
1276:                if (collAttachments == null) {
1277:                    if (isNew()) {
1278:                        collAttachments = new ArrayList();
1279:                    } else {
1280:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1281:                        collAttachments = AttachmentPeer
1282:                                .doSelectJoinIssue(criteria);
1283:                    }
1284:                } else {
1285:                    // the following code is to determine if a new query is
1286:                    // called for.  If the criteria is the same as the last
1287:                    // one, just return the collection.
1288:                    criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1289:                    if (!lastAttachmentsCriteria.equals(criteria)) {
1290:                        collAttachments = AttachmentPeer
1291:                                .doSelectJoinIssue(criteria);
1292:                    }
1293:                }
1294:                lastAttachmentsCriteria = criteria;
1295:
1296:                return collAttachments;
1297:            }
1298:
1299:            /**
1300:             * If this collection has already been initialized with
1301:             * an identical criteria, it returns the collection.
1302:             * Otherwise if this Issue is new, it will return
1303:             * an empty collection; or if this Issue has previously
1304:             * been saved, it will retrieve related Attachments from storage.
1305:             *
1306:             * This method is protected by default in order to keep the public
1307:             * api reasonable.  You can provide public methods for those you
1308:             * actually need in Issue.
1309:             */
1310:            protected List getAttachmentsJoinAttachmentType(Criteria criteria)
1311:                    throws TorqueException {
1312:                if (collAttachments == null) {
1313:                    if (isNew()) {
1314:                        collAttachments = new ArrayList();
1315:                    } else {
1316:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1317:                        collAttachments = AttachmentPeer
1318:                                .doSelectJoinAttachmentType(criteria);
1319:                    }
1320:                } else {
1321:                    // the following code is to determine if a new query is
1322:                    // called for.  If the criteria is the same as the last
1323:                    // one, just return the collection.
1324:                    criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1325:                    if (!lastAttachmentsCriteria.equals(criteria)) {
1326:                        collAttachments = AttachmentPeer
1327:                                .doSelectJoinAttachmentType(criteria);
1328:                    }
1329:                }
1330:                lastAttachmentsCriteria = criteria;
1331:
1332:                return collAttachments;
1333:            }
1334:
1335:            /**
1336:             * If this collection has already been initialized with
1337:             * an identical criteria, it returns the collection.
1338:             * Otherwise if this Issue is new, it will return
1339:             * an empty collection; or if this Issue has previously
1340:             * been saved, it will retrieve related Attachments from storage.
1341:             *
1342:             * This method is protected by default in order to keep the public
1343:             * api reasonable.  You can provide public methods for those you
1344:             * actually need in Issue.
1345:             */
1346:            protected List getAttachmentsJoinScarabUserImplRelatedByCreatedBy(
1347:                    Criteria criteria) throws TorqueException {
1348:                if (collAttachments == null) {
1349:                    if (isNew()) {
1350:                        collAttachments = new ArrayList();
1351:                    } else {
1352:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1353:                        collAttachments = AttachmentPeer
1354:                                .doSelectJoinScarabUserImplRelatedByCreatedBy(criteria);
1355:                    }
1356:                } else {
1357:                    // the following code is to determine if a new query is
1358:                    // called for.  If the criteria is the same as the last
1359:                    // one, just return the collection.
1360:                    criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1361:                    if (!lastAttachmentsCriteria.equals(criteria)) {
1362:                        collAttachments = AttachmentPeer
1363:                                .doSelectJoinScarabUserImplRelatedByCreatedBy(criteria);
1364:                    }
1365:                }
1366:                lastAttachmentsCriteria = criteria;
1367:
1368:                return collAttachments;
1369:            }
1370:
1371:            /**
1372:             * If this collection has already been initialized with
1373:             * an identical criteria, it returns the collection.
1374:             * Otherwise if this Issue is new, it will return
1375:             * an empty collection; or if this Issue has previously
1376:             * been saved, it will retrieve related Attachments from storage.
1377:             *
1378:             * This method is protected by default in order to keep the public
1379:             * api reasonable.  You can provide public methods for those you
1380:             * actually need in Issue.
1381:             */
1382:            protected List getAttachmentsJoinScarabUserImplRelatedByModifiedBy(
1383:                    Criteria criteria) throws TorqueException {
1384:                if (collAttachments == null) {
1385:                    if (isNew()) {
1386:                        collAttachments = new ArrayList();
1387:                    } else {
1388:                        criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1389:                        collAttachments = AttachmentPeer
1390:                                .doSelectJoinScarabUserImplRelatedByModifiedBy(criteria);
1391:                    }
1392:                } else {
1393:                    // the following code is to determine if a new query is
1394:                    // called for.  If the criteria is the same as the last
1395:                    // one, just return the collection.
1396:                    criteria.add(AttachmentPeer.ISSUE_ID, getIssueId());
1397:                    if (!lastAttachmentsCriteria.equals(criteria)) {
1398:                        collAttachments = AttachmentPeer
1399:                                .doSelectJoinScarabUserImplRelatedByModifiedBy(criteria);
1400:                    }
1401:                }
1402:                lastAttachmentsCriteria = criteria;
1403:
1404:                return collAttachments;
1405:            }
1406:
1407:            /**
1408:             * Collection to store aggregation of collDependsRelatedByObservedId
1409:             */
1410:            protected List collDependsRelatedByObservedId;
1411:
1412:            /**
1413:             * Temporary storage of collDependsRelatedByObservedId to save a possible db hit in
1414:             * the event objects are add to the collection, but the
1415:             * complete collection is never requested.
1416:             */
1417:            protected void initDependsRelatedByObservedId() {
1418:                if (collDependsRelatedByObservedId == null) {
1419:                    collDependsRelatedByObservedId = new ArrayList();
1420:                }
1421:            }
1422:
1423:            /**
1424:             * Method called to associate a Depend object to this object
1425:             * through the Depend foreign key attribute
1426:             *
1427:             * @param l Depend
1428:             * @throws TorqueException
1429:             */
1430:            public void addDependRelatedByObservedId(Depend l)
1431:                    throws TorqueException {
1432:                getDependsRelatedByObservedId().add(l);
1433:                l.setIssueRelatedByObservedId((Issue) this );
1434:            }
1435:
1436:            /**
1437:             * The criteria used to select the current contents of collDependsRelatedByObservedId
1438:             */
1439:            private Criteria lastDependsRelatedByObservedIdCriteria = null;
1440:
1441:            /**
1442:             * If this collection has already been initialized, returns
1443:             * the collection. Otherwise returns the results of
1444:             * getDependsRelatedByObservedId(new Criteria())
1445:             *
1446:             * @return the collection of associated objects
1447:             * @throws TorqueException
1448:             */
1449:            public List getDependsRelatedByObservedId() throws TorqueException {
1450:                if (collDependsRelatedByObservedId == null) {
1451:                    collDependsRelatedByObservedId = getDependsRelatedByObservedId(new Criteria(
1452:                            10));
1453:                }
1454:                return collDependsRelatedByObservedId;
1455:            }
1456:
1457:            /**
1458:             * If this collection has already been initialized with
1459:             * an identical criteria, it returns the collection.
1460:             * Otherwise if this Issue has previously
1461:             * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1462:             * If this Issue is new, it will return
1463:             * an empty collection or the current collection, the criteria
1464:             * is ignored on a new object.
1465:             *
1466:             * @throws TorqueException
1467:             */
1468:            public List getDependsRelatedByObservedId(Criteria criteria)
1469:                    throws TorqueException {
1470:                if (collDependsRelatedByObservedId == null) {
1471:                    if (isNew()) {
1472:                        collDependsRelatedByObservedId = new ArrayList();
1473:                    } else {
1474:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1475:                        collDependsRelatedByObservedId = DependPeer
1476:                                .doSelect(criteria);
1477:                    }
1478:                } else {
1479:                    // criteria has no effect for a new object
1480:                    if (!isNew()) {
1481:                        // the following code is to determine if a new query is
1482:                        // called for.  If the criteria is the same as the last
1483:                        // one, just return the collection.
1484:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1485:                        if (!lastDependsRelatedByObservedIdCriteria
1486:                                .equals(criteria)) {
1487:                            collDependsRelatedByObservedId = DependPeer
1488:                                    .doSelect(criteria);
1489:                        }
1490:                    }
1491:                }
1492:                lastDependsRelatedByObservedIdCriteria = criteria;
1493:
1494:                return collDependsRelatedByObservedId;
1495:            }
1496:
1497:            /**
1498:             * If this collection has already been initialized, returns
1499:             * the collection. Otherwise returns the results of
1500:             * getDependsRelatedByObservedId(new Criteria(),Connection)
1501:             * This method takes in the Connection also as input so that
1502:             * referenced objects can also be obtained using a Connection
1503:             * that is taken as input
1504:             */
1505:            public List getDependsRelatedByObservedId(Connection con)
1506:                    throws TorqueException {
1507:                if (collDependsRelatedByObservedId == null) {
1508:                    collDependsRelatedByObservedId = getDependsRelatedByObservedId(
1509:                            new Criteria(10), con);
1510:                }
1511:                return collDependsRelatedByObservedId;
1512:            }
1513:
1514:            /**
1515:             * If this collection has already been initialized with
1516:             * an identical criteria, it returns the collection.
1517:             * Otherwise if this Issue has previously
1518:             * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1519:             * If this Issue is new, it will return
1520:             * an empty collection or the current collection, the criteria
1521:             * is ignored on a new object.
1522:             * This method takes in the Connection also as input so that
1523:             * referenced objects can also be obtained using a Connection
1524:             * that is taken as input
1525:             */
1526:            public List getDependsRelatedByObservedId(Criteria criteria,
1527:                    Connection con) throws TorqueException {
1528:                if (collDependsRelatedByObservedId == null) {
1529:                    if (isNew()) {
1530:                        collDependsRelatedByObservedId = new ArrayList();
1531:                    } else {
1532:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1533:                        collDependsRelatedByObservedId = DependPeer.doSelect(
1534:                                criteria, con);
1535:                    }
1536:                } else {
1537:                    // criteria has no effect for a new object
1538:                    if (!isNew()) {
1539:                        // the following code is to determine if a new query is
1540:                        // called for.  If the criteria is the same as the last
1541:                        // one, just return the collection.
1542:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1543:                        if (!lastDependsRelatedByObservedIdCriteria
1544:                                .equals(criteria)) {
1545:                            collDependsRelatedByObservedId = DependPeer
1546:                                    .doSelect(criteria, con);
1547:                        }
1548:                    }
1549:                }
1550:                lastDependsRelatedByObservedIdCriteria = criteria;
1551:
1552:                return collDependsRelatedByObservedId;
1553:            }
1554:
1555:            /**
1556:             * If this collection has already been initialized with
1557:             * an identical criteria, it returns the collection.
1558:             * Otherwise if this Issue is new, it will return
1559:             * an empty collection; or if this Issue has previously
1560:             * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1561:             *
1562:             * This method is protected by default in order to keep the public
1563:             * api reasonable.  You can provide public methods for those you
1564:             * actually need in Issue.
1565:             */
1566:            protected List getDependsRelatedByObservedIdJoinIssueRelatedByObserverId(
1567:                    Criteria criteria) throws TorqueException {
1568:                if (collDependsRelatedByObservedId == null) {
1569:                    if (isNew()) {
1570:                        collDependsRelatedByObservedId = new ArrayList();
1571:                    } else {
1572:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1573:                        collDependsRelatedByObservedId = DependPeer
1574:                                .doSelectJoinIssueRelatedByObserverId(criteria);
1575:                    }
1576:                } else {
1577:                    // the following code is to determine if a new query is
1578:                    // called for.  If the criteria is the same as the last
1579:                    // one, just return the collection.
1580:                    criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1581:                    if (!lastDependsRelatedByObservedIdCriteria
1582:                            .equals(criteria)) {
1583:                        collDependsRelatedByObservedId = DependPeer
1584:                                .doSelectJoinIssueRelatedByObserverId(criteria);
1585:                    }
1586:                }
1587:                lastDependsRelatedByObservedIdCriteria = criteria;
1588:
1589:                return collDependsRelatedByObservedId;
1590:            }
1591:
1592:            /**
1593:             * If this collection has already been initialized with
1594:             * an identical criteria, it returns the collection.
1595:             * Otherwise if this Issue is new, it will return
1596:             * an empty collection; or if this Issue has previously
1597:             * been saved, it will retrieve related DependsRelatedByObservedId from storage.
1598:             *
1599:             * This method is protected by default in order to keep the public
1600:             * api reasonable.  You can provide public methods for those you
1601:             * actually need in Issue.
1602:             */
1603:            protected List getDependsRelatedByObservedIdJoinDependType(
1604:                    Criteria criteria) throws TorqueException {
1605:                if (collDependsRelatedByObservedId == null) {
1606:                    if (isNew()) {
1607:                        collDependsRelatedByObservedId = new ArrayList();
1608:                    } else {
1609:                        criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1610:                        collDependsRelatedByObservedId = DependPeer
1611:                                .doSelectJoinDependType(criteria);
1612:                    }
1613:                } else {
1614:                    // the following code is to determine if a new query is
1615:                    // called for.  If the criteria is the same as the last
1616:                    // one, just return the collection.
1617:                    criteria.add(DependPeer.OBSERVED_ID, getIssueId());
1618:                    if (!lastDependsRelatedByObservedIdCriteria
1619:                            .equals(criteria)) {
1620:                        collDependsRelatedByObservedId = DependPeer
1621:                                .doSelectJoinDependType(criteria);
1622:                    }
1623:                }
1624:                lastDependsRelatedByObservedIdCriteria = criteria;
1625:
1626:                return collDependsRelatedByObservedId;
1627:            }
1628:
1629:            /**
1630:             * Collection to store aggregation of collDependsRelatedByObserverId
1631:             */
1632:            protected List collDependsRelatedByObserverId;
1633:
1634:            /**
1635:             * Temporary storage of collDependsRelatedByObserverId to save a possible db hit in
1636:             * the event objects are add to the collection, but the
1637:             * complete collection is never requested.
1638:             */
1639:            protected void initDependsRelatedByObserverId() {
1640:                if (collDependsRelatedByObserverId == null) {
1641:                    collDependsRelatedByObserverId = new ArrayList();
1642:                }
1643:            }
1644:
1645:            /**
1646:             * Method called to associate a Depend object to this object
1647:             * through the Depend foreign key attribute
1648:             *
1649:             * @param l Depend
1650:             * @throws TorqueException
1651:             */
1652:            public void addDependRelatedByObserverId(Depend l)
1653:                    throws TorqueException {
1654:                getDependsRelatedByObserverId().add(l);
1655:                l.setIssueRelatedByObserverId((Issue) this );
1656:            }
1657:
1658:            /**
1659:             * The criteria used to select the current contents of collDependsRelatedByObserverId
1660:             */
1661:            private Criteria lastDependsRelatedByObserverIdCriteria = null;
1662:
1663:            /**
1664:             * If this collection has already been initialized, returns
1665:             * the collection. Otherwise returns the results of
1666:             * getDependsRelatedByObserverId(new Criteria())
1667:             *
1668:             * @return the collection of associated objects
1669:             * @throws TorqueException
1670:             */
1671:            public List getDependsRelatedByObserverId() throws TorqueException {
1672:                if (collDependsRelatedByObserverId == null) {
1673:                    collDependsRelatedByObserverId = getDependsRelatedByObserverId(new Criteria(
1674:                            10));
1675:                }
1676:                return collDependsRelatedByObserverId;
1677:            }
1678:
1679:            /**
1680:             * If this collection has already been initialized with
1681:             * an identical criteria, it returns the collection.
1682:             * Otherwise if this Issue has previously
1683:             * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1684:             * If this Issue is new, it will return
1685:             * an empty collection or the current collection, the criteria
1686:             * is ignored on a new object.
1687:             *
1688:             * @throws TorqueException
1689:             */
1690:            public List getDependsRelatedByObserverId(Criteria criteria)
1691:                    throws TorqueException {
1692:                if (collDependsRelatedByObserverId == null) {
1693:                    if (isNew()) {
1694:                        collDependsRelatedByObserverId = new ArrayList();
1695:                    } else {
1696:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1697:                        collDependsRelatedByObserverId = DependPeer
1698:                                .doSelect(criteria);
1699:                    }
1700:                } else {
1701:                    // criteria has no effect for a new object
1702:                    if (!isNew()) {
1703:                        // the following code is to determine if a new query is
1704:                        // called for.  If the criteria is the same as the last
1705:                        // one, just return the collection.
1706:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1707:                        if (!lastDependsRelatedByObserverIdCriteria
1708:                                .equals(criteria)) {
1709:                            collDependsRelatedByObserverId = DependPeer
1710:                                    .doSelect(criteria);
1711:                        }
1712:                    }
1713:                }
1714:                lastDependsRelatedByObserverIdCriteria = criteria;
1715:
1716:                return collDependsRelatedByObserverId;
1717:            }
1718:
1719:            /**
1720:             * If this collection has already been initialized, returns
1721:             * the collection. Otherwise returns the results of
1722:             * getDependsRelatedByObserverId(new Criteria(),Connection)
1723:             * This method takes in the Connection also as input so that
1724:             * referenced objects can also be obtained using a Connection
1725:             * that is taken as input
1726:             */
1727:            public List getDependsRelatedByObserverId(Connection con)
1728:                    throws TorqueException {
1729:                if (collDependsRelatedByObserverId == null) {
1730:                    collDependsRelatedByObserverId = getDependsRelatedByObserverId(
1731:                            new Criteria(10), con);
1732:                }
1733:                return collDependsRelatedByObserverId;
1734:            }
1735:
1736:            /**
1737:             * If this collection has already been initialized with
1738:             * an identical criteria, it returns the collection.
1739:             * Otherwise if this Issue has previously
1740:             * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1741:             * If this Issue is new, it will return
1742:             * an empty collection or the current collection, the criteria
1743:             * is ignored on a new object.
1744:             * This method takes in the Connection also as input so that
1745:             * referenced objects can also be obtained using a Connection
1746:             * that is taken as input
1747:             */
1748:            public List getDependsRelatedByObserverId(Criteria criteria,
1749:                    Connection con) throws TorqueException {
1750:                if (collDependsRelatedByObserverId == null) {
1751:                    if (isNew()) {
1752:                        collDependsRelatedByObserverId = new ArrayList();
1753:                    } else {
1754:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1755:                        collDependsRelatedByObserverId = DependPeer.doSelect(
1756:                                criteria, con);
1757:                    }
1758:                } else {
1759:                    // criteria has no effect for a new object
1760:                    if (!isNew()) {
1761:                        // the following code is to determine if a new query is
1762:                        // called for.  If the criteria is the same as the last
1763:                        // one, just return the collection.
1764:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1765:                        if (!lastDependsRelatedByObserverIdCriteria
1766:                                .equals(criteria)) {
1767:                            collDependsRelatedByObserverId = DependPeer
1768:                                    .doSelect(criteria, con);
1769:                        }
1770:                    }
1771:                }
1772:                lastDependsRelatedByObserverIdCriteria = criteria;
1773:
1774:                return collDependsRelatedByObserverId;
1775:            }
1776:
1777:            /**
1778:             * If this collection has already been initialized with
1779:             * an identical criteria, it returns the collection.
1780:             * Otherwise if this Issue is new, it will return
1781:             * an empty collection; or if this Issue has previously
1782:             * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1783:             *
1784:             * This method is protected by default in order to keep the public
1785:             * api reasonable.  You can provide public methods for those you
1786:             * actually need in Issue.
1787:             */
1788:            protected List getDependsRelatedByObserverIdJoinIssueRelatedByObservedId(
1789:                    Criteria criteria) throws TorqueException {
1790:                if (collDependsRelatedByObserverId == null) {
1791:                    if (isNew()) {
1792:                        collDependsRelatedByObserverId = new ArrayList();
1793:                    } else {
1794:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1795:                        collDependsRelatedByObserverId = DependPeer
1796:                                .doSelectJoinIssueRelatedByObservedId(criteria);
1797:                    }
1798:                } else {
1799:                    // the following code is to determine if a new query is
1800:                    // called for.  If the criteria is the same as the last
1801:                    // one, just return the collection.
1802:                    criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1803:                    if (!lastDependsRelatedByObserverIdCriteria
1804:                            .equals(criteria)) {
1805:                        collDependsRelatedByObserverId = DependPeer
1806:                                .doSelectJoinIssueRelatedByObservedId(criteria);
1807:                    }
1808:                }
1809:                lastDependsRelatedByObserverIdCriteria = criteria;
1810:
1811:                return collDependsRelatedByObserverId;
1812:            }
1813:
1814:            /**
1815:             * If this collection has already been initialized with
1816:             * an identical criteria, it returns the collection.
1817:             * Otherwise if this Issue is new, it will return
1818:             * an empty collection; or if this Issue has previously
1819:             * been saved, it will retrieve related DependsRelatedByObserverId from storage.
1820:             *
1821:             * This method is protected by default in order to keep the public
1822:             * api reasonable.  You can provide public methods for those you
1823:             * actually need in Issue.
1824:             */
1825:            protected List getDependsRelatedByObserverIdJoinDependType(
1826:                    Criteria criteria) throws TorqueException {
1827:                if (collDependsRelatedByObserverId == null) {
1828:                    if (isNew()) {
1829:                        collDependsRelatedByObserverId = new ArrayList();
1830:                    } else {
1831:                        criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1832:                        collDependsRelatedByObserverId = DependPeer
1833:                                .doSelectJoinDependType(criteria);
1834:                    }
1835:                } else {
1836:                    // the following code is to determine if a new query is
1837:                    // called for.  If the criteria is the same as the last
1838:                    // one, just return the collection.
1839:                    criteria.add(DependPeer.OBSERVER_ID, getIssueId());
1840:                    if (!lastDependsRelatedByObserverIdCriteria
1841:                            .equals(criteria)) {
1842:                        collDependsRelatedByObserverId = DependPeer
1843:                                .doSelectJoinDependType(criteria);
1844:                    }
1845:                }
1846:                lastDependsRelatedByObserverIdCriteria = criteria;
1847:
1848:                return collDependsRelatedByObserverId;
1849:            }
1850:
1851:            /**
1852:             * Collection to store aggregation of collAttributeValues
1853:             */
1854:            protected List collAttributeValues;
1855:
1856:            /**
1857:             * Temporary storage of collAttributeValues to save a possible db hit in
1858:             * the event objects are add to the collection, but the
1859:             * complete collection is never requested.
1860:             */
1861:            protected void initAttributeValues() {
1862:                if (collAttributeValues == null) {
1863:                    collAttributeValues = new ArrayList();
1864:                }
1865:            }
1866:
1867:            /**
1868:             * Method called to associate a AttributeValue object to this object
1869:             * through the AttributeValue foreign key attribute
1870:             *
1871:             * @param l AttributeValue
1872:             * @throws TorqueException
1873:             */
1874:            public void addAttributeValue(AttributeValue l)
1875:                    throws TorqueException {
1876:                getAttributeValues().add(l);
1877:                l.setIssue((Issue) this );
1878:            }
1879:
1880:            /**
1881:             * The criteria used to select the current contents of collAttributeValues
1882:             */
1883:            private Criteria lastAttributeValuesCriteria = null;
1884:
1885:            /**
1886:             * If this collection has already been initialized, returns
1887:             * the collection. Otherwise returns the results of
1888:             * getAttributeValues(new Criteria())
1889:             *
1890:             * @return the collection of associated objects
1891:             * @throws TorqueException
1892:             */
1893:            public List getAttributeValues() throws TorqueException {
1894:                if (collAttributeValues == null) {
1895:                    collAttributeValues = getAttributeValues(new Criteria(10));
1896:                }
1897:                return collAttributeValues;
1898:            }
1899:
1900:            /**
1901:             * If this collection has already been initialized with
1902:             * an identical criteria, it returns the collection.
1903:             * Otherwise if this Issue has previously
1904:             * been saved, it will retrieve related AttributeValues from storage.
1905:             * If this Issue is new, it will return
1906:             * an empty collection or the current collection, the criteria
1907:             * is ignored on a new object.
1908:             *
1909:             * @throws TorqueException
1910:             */
1911:            public List getAttributeValues(Criteria criteria)
1912:                    throws TorqueException {
1913:                if (collAttributeValues == null) {
1914:                    if (isNew()) {
1915:                        collAttributeValues = new ArrayList();
1916:                    } else {
1917:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
1918:                        collAttributeValues = AttributeValuePeer
1919:                                .doSelect(criteria);
1920:                    }
1921:                } else {
1922:                    // criteria has no effect for a new object
1923:                    if (!isNew()) {
1924:                        // the following code is to determine if a new query is
1925:                        // called for.  If the criteria is the same as the last
1926:                        // one, just return the collection.
1927:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
1928:                        if (!lastAttributeValuesCriteria.equals(criteria)) {
1929:                            collAttributeValues = AttributeValuePeer
1930:                                    .doSelect(criteria);
1931:                        }
1932:                    }
1933:                }
1934:                lastAttributeValuesCriteria = criteria;
1935:
1936:                return collAttributeValues;
1937:            }
1938:
1939:            /**
1940:             * If this collection has already been initialized, returns
1941:             * the collection. Otherwise returns the results of
1942:             * getAttributeValues(new Criteria(),Connection)
1943:             * This method takes in the Connection also as input so that
1944:             * referenced objects can also be obtained using a Connection
1945:             * that is taken as input
1946:             */
1947:            public List getAttributeValues(Connection con)
1948:                    throws TorqueException {
1949:                if (collAttributeValues == null) {
1950:                    collAttributeValues = getAttributeValues(new Criteria(10),
1951:                            con);
1952:                }
1953:                return collAttributeValues;
1954:            }
1955:
1956:            /**
1957:             * If this collection has already been initialized with
1958:             * an identical criteria, it returns the collection.
1959:             * Otherwise if this Issue has previously
1960:             * been saved, it will retrieve related AttributeValues from storage.
1961:             * If this Issue is new, it will return
1962:             * an empty collection or the current collection, the criteria
1963:             * is ignored on a new object.
1964:             * This method takes in the Connection also as input so that
1965:             * referenced objects can also be obtained using a Connection
1966:             * that is taken as input
1967:             */
1968:            public List getAttributeValues(Criteria criteria, Connection con)
1969:                    throws TorqueException {
1970:                if (collAttributeValues == null) {
1971:                    if (isNew()) {
1972:                        collAttributeValues = new ArrayList();
1973:                    } else {
1974:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
1975:                        collAttributeValues = AttributeValuePeer.doSelect(
1976:                                criteria, con);
1977:                    }
1978:                } else {
1979:                    // criteria has no effect for a new object
1980:                    if (!isNew()) {
1981:                        // the following code is to determine if a new query is
1982:                        // called for.  If the criteria is the same as the last
1983:                        // one, just return the collection.
1984:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
1985:                        if (!lastAttributeValuesCriteria.equals(criteria)) {
1986:                            collAttributeValues = AttributeValuePeer.doSelect(
1987:                                    criteria, con);
1988:                        }
1989:                    }
1990:                }
1991:                lastAttributeValuesCriteria = criteria;
1992:
1993:                return collAttributeValues;
1994:            }
1995:
1996:            /**
1997:             * If this collection has already been initialized with
1998:             * an identical criteria, it returns the collection.
1999:             * Otherwise if this Issue is new, it will return
2000:             * an empty collection; or if this Issue has previously
2001:             * been saved, it will retrieve related AttributeValues from storage.
2002:             *
2003:             * This method is protected by default in order to keep the public
2004:             * api reasonable.  You can provide public methods for those you
2005:             * actually need in Issue.
2006:             */
2007:            protected List getAttributeValuesJoinIssue(Criteria criteria)
2008:                    throws TorqueException {
2009:                if (collAttributeValues == null) {
2010:                    if (isNew()) {
2011:                        collAttributeValues = new ArrayList();
2012:                    } else {
2013:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2014:                        collAttributeValues = AttributeValuePeer
2015:                                .doSelectJoinIssue(criteria);
2016:                    }
2017:                } else {
2018:                    // the following code is to determine if a new query is
2019:                    // called for.  If the criteria is the same as the last
2020:                    // one, just return the collection.
2021:                    criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2022:                    if (!lastAttributeValuesCriteria.equals(criteria)) {
2023:                        collAttributeValues = AttributeValuePeer
2024:                                .doSelectJoinIssue(criteria);
2025:                    }
2026:                }
2027:                lastAttributeValuesCriteria = criteria;
2028:
2029:                return collAttributeValues;
2030:            }
2031:
2032:            /**
2033:             * If this collection has already been initialized with
2034:             * an identical criteria, it returns the collection.
2035:             * Otherwise if this Issue is new, it will return
2036:             * an empty collection; or if this Issue has previously
2037:             * been saved, it will retrieve related AttributeValues from storage.
2038:             *
2039:             * This method is protected by default in order to keep the public
2040:             * api reasonable.  You can provide public methods for those you
2041:             * actually need in Issue.
2042:             */
2043:            protected List getAttributeValuesJoinAttribute(Criteria criteria)
2044:                    throws TorqueException {
2045:                if (collAttributeValues == null) {
2046:                    if (isNew()) {
2047:                        collAttributeValues = new ArrayList();
2048:                    } else {
2049:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2050:                        collAttributeValues = AttributeValuePeer
2051:                                .doSelectJoinAttribute(criteria);
2052:                    }
2053:                } else {
2054:                    // the following code is to determine if a new query is
2055:                    // called for.  If the criteria is the same as the last
2056:                    // one, just return the collection.
2057:                    criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2058:                    if (!lastAttributeValuesCriteria.equals(criteria)) {
2059:                        collAttributeValues = AttributeValuePeer
2060:                                .doSelectJoinAttribute(criteria);
2061:                    }
2062:                }
2063:                lastAttributeValuesCriteria = criteria;
2064:
2065:                return collAttributeValues;
2066:            }
2067:
2068:            /**
2069:             * If this collection has already been initialized with
2070:             * an identical criteria, it returns the collection.
2071:             * Otherwise if this Issue is new, it will return
2072:             * an empty collection; or if this Issue has previously
2073:             * been saved, it will retrieve related AttributeValues from storage.
2074:             *
2075:             * This method is protected by default in order to keep the public
2076:             * api reasonable.  You can provide public methods for those you
2077:             * actually need in Issue.
2078:             */
2079:            protected List getAttributeValuesJoinAttributeOption(
2080:                    Criteria criteria) throws TorqueException {
2081:                if (collAttributeValues == null) {
2082:                    if (isNew()) {
2083:                        collAttributeValues = new ArrayList();
2084:                    } else {
2085:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2086:                        collAttributeValues = AttributeValuePeer
2087:                                .doSelectJoinAttributeOption(criteria);
2088:                    }
2089:                } else {
2090:                    // the following code is to determine if a new query is
2091:                    // called for.  If the criteria is the same as the last
2092:                    // one, just return the collection.
2093:                    criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2094:                    if (!lastAttributeValuesCriteria.equals(criteria)) {
2095:                        collAttributeValues = AttributeValuePeer
2096:                                .doSelectJoinAttributeOption(criteria);
2097:                    }
2098:                }
2099:                lastAttributeValuesCriteria = criteria;
2100:
2101:                return collAttributeValues;
2102:            }
2103:
2104:            /**
2105:             * If this collection has already been initialized with
2106:             * an identical criteria, it returns the collection.
2107:             * Otherwise if this Issue is new, it will return
2108:             * an empty collection; or if this Issue has previously
2109:             * been saved, it will retrieve related AttributeValues from storage.
2110:             *
2111:             * This method is protected by default in order to keep the public
2112:             * api reasonable.  You can provide public methods for those you
2113:             * actually need in Issue.
2114:             */
2115:            protected List getAttributeValuesJoinScarabUserImpl(
2116:                    Criteria criteria) throws TorqueException {
2117:                if (collAttributeValues == null) {
2118:                    if (isNew()) {
2119:                        collAttributeValues = new ArrayList();
2120:                    } else {
2121:                        criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2122:                        collAttributeValues = AttributeValuePeer
2123:                                .doSelectJoinScarabUserImpl(criteria);
2124:                    }
2125:                } else {
2126:                    // the following code is to determine if a new query is
2127:                    // called for.  If the criteria is the same as the last
2128:                    // one, just return the collection.
2129:                    criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId());
2130:                    if (!lastAttributeValuesCriteria.equals(criteria)) {
2131:                        collAttributeValues = AttributeValuePeer
2132:                                .doSelectJoinScarabUserImpl(criteria);
2133:                    }
2134:                }
2135:                lastAttributeValuesCriteria = criteria;
2136:
2137:                return collAttributeValues;
2138:            }
2139:
2140:            /**
2141:             * Collection to store aggregation of collIssueVotes
2142:             */
2143:            protected List collIssueVotes;
2144:
2145:            /**
2146:             * Temporary storage of collIssueVotes to save a possible db hit in
2147:             * the event objects are add to the collection, but the
2148:             * complete collection is never requested.
2149:             */
2150:            protected void initIssueVotes() {
2151:                if (collIssueVotes == null) {
2152:                    collIssueVotes = new ArrayList();
2153:                }
2154:            }
2155:
2156:            /**
2157:             * Method called to associate a IssueVote object to this object
2158:             * through the IssueVote foreign key attribute
2159:             *
2160:             * @param l IssueVote
2161:             * @throws TorqueException
2162:             */
2163:            public void addIssueVote(IssueVote l) throws TorqueException {
2164:                getIssueVotes().add(l);
2165:                l.setIssue((Issue) this );
2166:            }
2167:
2168:            /**
2169:             * The criteria used to select the current contents of collIssueVotes
2170:             */
2171:            private Criteria lastIssueVotesCriteria = null;
2172:
2173:            /**
2174:             * If this collection has already been initialized, returns
2175:             * the collection. Otherwise returns the results of
2176:             * getIssueVotes(new Criteria())
2177:             *
2178:             * @return the collection of associated objects
2179:             * @throws TorqueException
2180:             */
2181:            public List getIssueVotes() throws TorqueException {
2182:                if (collIssueVotes == null) {
2183:                    collIssueVotes = getIssueVotes(new Criteria(10));
2184:                }
2185:                return collIssueVotes;
2186:            }
2187:
2188:            /**
2189:             * If this collection has already been initialized with
2190:             * an identical criteria, it returns the collection.
2191:             * Otherwise if this Issue has previously
2192:             * been saved, it will retrieve related IssueVotes from storage.
2193:             * If this Issue is new, it will return
2194:             * an empty collection or the current collection, the criteria
2195:             * is ignored on a new object.
2196:             *
2197:             * @throws TorqueException
2198:             */
2199:            public List getIssueVotes(Criteria criteria) throws TorqueException {
2200:                if (collIssueVotes == null) {
2201:                    if (isNew()) {
2202:                        collIssueVotes = new ArrayList();
2203:                    } else {
2204:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2205:                        collIssueVotes = IssueVotePeer.doSelect(criteria);
2206:                    }
2207:                } else {
2208:                    // criteria has no effect for a new object
2209:                    if (!isNew()) {
2210:                        // the following code is to determine if a new query is
2211:                        // called for.  If the criteria is the same as the last
2212:                        // one, just return the collection.
2213:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2214:                        if (!lastIssueVotesCriteria.equals(criteria)) {
2215:                            collIssueVotes = IssueVotePeer.doSelect(criteria);
2216:                        }
2217:                    }
2218:                }
2219:                lastIssueVotesCriteria = criteria;
2220:
2221:                return collIssueVotes;
2222:            }
2223:
2224:            /**
2225:             * If this collection has already been initialized, returns
2226:             * the collection. Otherwise returns the results of
2227:             * getIssueVotes(new Criteria(),Connection)
2228:             * This method takes in the Connection also as input so that
2229:             * referenced objects can also be obtained using a Connection
2230:             * that is taken as input
2231:             */
2232:            public List getIssueVotes(Connection con) throws TorqueException {
2233:                if (collIssueVotes == null) {
2234:                    collIssueVotes = getIssueVotes(new Criteria(10), con);
2235:                }
2236:                return collIssueVotes;
2237:            }
2238:
2239:            /**
2240:             * If this collection has already been initialized with
2241:             * an identical criteria, it returns the collection.
2242:             * Otherwise if this Issue has previously
2243:             * been saved, it will retrieve related IssueVotes from storage.
2244:             * If this Issue is new, it will return
2245:             * an empty collection or the current collection, the criteria
2246:             * is ignored on a new object.
2247:             * This method takes in the Connection also as input so that
2248:             * referenced objects can also be obtained using a Connection
2249:             * that is taken as input
2250:             */
2251:            public List getIssueVotes(Criteria criteria, Connection con)
2252:                    throws TorqueException {
2253:                if (collIssueVotes == null) {
2254:                    if (isNew()) {
2255:                        collIssueVotes = new ArrayList();
2256:                    } else {
2257:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2258:                        collIssueVotes = IssueVotePeer.doSelect(criteria, con);
2259:                    }
2260:                } else {
2261:                    // criteria has no effect for a new object
2262:                    if (!isNew()) {
2263:                        // the following code is to determine if a new query is
2264:                        // called for.  If the criteria is the same as the last
2265:                        // one, just return the collection.
2266:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2267:                        if (!lastIssueVotesCriteria.equals(criteria)) {
2268:                            collIssueVotes = IssueVotePeer.doSelect(criteria,
2269:                                    con);
2270:                        }
2271:                    }
2272:                }
2273:                lastIssueVotesCriteria = criteria;
2274:
2275:                return collIssueVotes;
2276:            }
2277:
2278:            /**
2279:             * If this collection has already been initialized with
2280:             * an identical criteria, it returns the collection.
2281:             * Otherwise if this Issue is new, it will return
2282:             * an empty collection; or if this Issue has previously
2283:             * been saved, it will retrieve related IssueVotes from storage.
2284:             *
2285:             * This method is protected by default in order to keep the public
2286:             * api reasonable.  You can provide public methods for those you
2287:             * actually need in Issue.
2288:             */
2289:            protected List getIssueVotesJoinIssue(Criteria criteria)
2290:                    throws TorqueException {
2291:                if (collIssueVotes == null) {
2292:                    if (isNew()) {
2293:                        collIssueVotes = new ArrayList();
2294:                    } else {
2295:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2296:                        collIssueVotes = IssueVotePeer
2297:                                .doSelectJoinIssue(criteria);
2298:                    }
2299:                } else {
2300:                    // the following code is to determine if a new query is
2301:                    // called for.  If the criteria is the same as the last
2302:                    // one, just return the collection.
2303:                    criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2304:                    if (!lastIssueVotesCriteria.equals(criteria)) {
2305:                        collIssueVotes = IssueVotePeer
2306:                                .doSelectJoinIssue(criteria);
2307:                    }
2308:                }
2309:                lastIssueVotesCriteria = criteria;
2310:
2311:                return collIssueVotes;
2312:            }
2313:
2314:            /**
2315:             * If this collection has already been initialized with
2316:             * an identical criteria, it returns the collection.
2317:             * Otherwise if this Issue is new, it will return
2318:             * an empty collection; or if this Issue has previously
2319:             * been saved, it will retrieve related IssueVotes from storage.
2320:             *
2321:             * This method is protected by default in order to keep the public
2322:             * api reasonable.  You can provide public methods for those you
2323:             * actually need in Issue.
2324:             */
2325:            protected List getIssueVotesJoinScarabUserImpl(Criteria criteria)
2326:                    throws TorqueException {
2327:                if (collIssueVotes == null) {
2328:                    if (isNew()) {
2329:                        collIssueVotes = new ArrayList();
2330:                    } else {
2331:                        criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2332:                        collIssueVotes = IssueVotePeer
2333:                                .doSelectJoinScarabUserImpl(criteria);
2334:                    }
2335:                } else {
2336:                    // the following code is to determine if a new query is
2337:                    // called for.  If the criteria is the same as the last
2338:                    // one, just return the collection.
2339:                    criteria.add(IssueVotePeer.ISSUE_ID, getIssueId());
2340:                    if (!lastIssueVotesCriteria.equals(criteria)) {
2341:                        collIssueVotes = IssueVotePeer
2342:                                .doSelectJoinScarabUserImpl(criteria);
2343:                    }
2344:                }
2345:                lastIssueVotesCriteria = criteria;
2346:
2347:                return collIssueVotes;
2348:            }
2349:
2350:            /**
2351:             * Collection to store aggregation of collIssueTemplateInfos
2352:             */
2353:            protected List collIssueTemplateInfos;
2354:
2355:            /**
2356:             * Temporary storage of collIssueTemplateInfos to save a possible db hit in
2357:             * the event objects are add to the collection, but the
2358:             * complete collection is never requested.
2359:             */
2360:            protected void initIssueTemplateInfos() {
2361:                if (collIssueTemplateInfos == null) {
2362:                    collIssueTemplateInfos = new ArrayList();
2363:                }
2364:            }
2365:
2366:            /**
2367:             * Method called to associate a IssueTemplateInfo object to this object
2368:             * through the IssueTemplateInfo foreign key attribute
2369:             *
2370:             * @param l IssueTemplateInfo
2371:             * @throws TorqueException
2372:             */
2373:            public void addIssueTemplateInfo(IssueTemplateInfo l)
2374:                    throws TorqueException {
2375:                getIssueTemplateInfos().add(l);
2376:                l.setIssue((Issue) this );
2377:            }
2378:
2379:            /**
2380:             * The criteria used to select the current contents of collIssueTemplateInfos
2381:             */
2382:            private Criteria lastIssueTemplateInfosCriteria = null;
2383:
2384:            /**
2385:             * If this collection has already been initialized, returns
2386:             * the collection. Otherwise returns the results of
2387:             * getIssueTemplateInfos(new Criteria())
2388:             *
2389:             * @return the collection of associated objects
2390:             * @throws TorqueException
2391:             */
2392:            public List getIssueTemplateInfos() throws TorqueException {
2393:                if (collIssueTemplateInfos == null) {
2394:                    collIssueTemplateInfos = getIssueTemplateInfos(new Criteria(
2395:                            10));
2396:                }
2397:                return collIssueTemplateInfos;
2398:            }
2399:
2400:            /**
2401:             * If this collection has already been initialized with
2402:             * an identical criteria, it returns the collection.
2403:             * Otherwise if this Issue has previously
2404:             * been saved, it will retrieve related IssueTemplateInfos from storage.
2405:             * If this Issue is new, it will return
2406:             * an empty collection or the current collection, the criteria
2407:             * is ignored on a new object.
2408:             *
2409:             * @throws TorqueException
2410:             */
2411:            public List getIssueTemplateInfos(Criteria criteria)
2412:                    throws TorqueException {
2413:                if (collIssueTemplateInfos == null) {
2414:                    if (isNew()) {
2415:                        collIssueTemplateInfos = new ArrayList();
2416:                    } else {
2417:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2418:                                getIssueId());
2419:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2420:                                .doSelect(criteria);
2421:                    }
2422:                } else {
2423:                    // criteria has no effect for a new object
2424:                    if (!isNew()) {
2425:                        // the following code is to determine if a new query is
2426:                        // called for.  If the criteria is the same as the last
2427:                        // one, just return the collection.
2428:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2429:                                getIssueId());
2430:                        if (!lastIssueTemplateInfosCriteria.equals(criteria)) {
2431:                            collIssueTemplateInfos = IssueTemplateInfoPeer
2432:                                    .doSelect(criteria);
2433:                        }
2434:                    }
2435:                }
2436:                lastIssueTemplateInfosCriteria = criteria;
2437:
2438:                return collIssueTemplateInfos;
2439:            }
2440:
2441:            /**
2442:             * If this collection has already been initialized, returns
2443:             * the collection. Otherwise returns the results of
2444:             * getIssueTemplateInfos(new Criteria(),Connection)
2445:             * This method takes in the Connection also as input so that
2446:             * referenced objects can also be obtained using a Connection
2447:             * that is taken as input
2448:             */
2449:            public List getIssueTemplateInfos(Connection con)
2450:                    throws TorqueException {
2451:                if (collIssueTemplateInfos == null) {
2452:                    collIssueTemplateInfos = getIssueTemplateInfos(
2453:                            new Criteria(10), con);
2454:                }
2455:                return collIssueTemplateInfos;
2456:            }
2457:
2458:            /**
2459:             * If this collection has already been initialized with
2460:             * an identical criteria, it returns the collection.
2461:             * Otherwise if this Issue has previously
2462:             * been saved, it will retrieve related IssueTemplateInfos from storage.
2463:             * If this Issue is new, it will return
2464:             * an empty collection or the current collection, the criteria
2465:             * is ignored on a new object.
2466:             * This method takes in the Connection also as input so that
2467:             * referenced objects can also be obtained using a Connection
2468:             * that is taken as input
2469:             */
2470:            public List getIssueTemplateInfos(Criteria criteria, Connection con)
2471:                    throws TorqueException {
2472:                if (collIssueTemplateInfos == null) {
2473:                    if (isNew()) {
2474:                        collIssueTemplateInfos = new ArrayList();
2475:                    } else {
2476:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2477:                                getIssueId());
2478:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2479:                                .doSelect(criteria, con);
2480:                    }
2481:                } else {
2482:                    // criteria has no effect for a new object
2483:                    if (!isNew()) {
2484:                        // the following code is to determine if a new query is
2485:                        // called for.  If the criteria is the same as the last
2486:                        // one, just return the collection.
2487:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2488:                                getIssueId());
2489:                        if (!lastIssueTemplateInfosCriteria.equals(criteria)) {
2490:                            collIssueTemplateInfos = IssueTemplateInfoPeer
2491:                                    .doSelect(criteria, con);
2492:                        }
2493:                    }
2494:                }
2495:                lastIssueTemplateInfosCriteria = criteria;
2496:
2497:                return collIssueTemplateInfos;
2498:            }
2499:
2500:            /**
2501:             * If this collection has already been initialized with
2502:             * an identical criteria, it returns the collection.
2503:             * Otherwise if this Issue is new, it will return
2504:             * an empty collection; or if this Issue has previously
2505:             * been saved, it will retrieve related IssueTemplateInfos from storage.
2506:             *
2507:             * This method is protected by default in order to keep the public
2508:             * api reasonable.  You can provide public methods for those you
2509:             * actually need in Issue.
2510:             */
2511:            protected List getIssueTemplateInfosJoinIssue(Criteria criteria)
2512:                    throws TorqueException {
2513:                if (collIssueTemplateInfos == null) {
2514:                    if (isNew()) {
2515:                        collIssueTemplateInfos = new ArrayList();
2516:                    } else {
2517:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2518:                                getIssueId());
2519:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2520:                                .doSelectJoinIssue(criteria);
2521:                    }
2522:                } else {
2523:                    // the following code is to determine if a new query is
2524:                    // called for.  If the criteria is the same as the last
2525:                    // one, just return the collection.
2526:                    criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId());
2527:                    if (!lastIssueTemplateInfosCriteria.equals(criteria)) {
2528:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2529:                                .doSelectJoinIssue(criteria);
2530:                    }
2531:                }
2532:                lastIssueTemplateInfosCriteria = criteria;
2533:
2534:                return collIssueTemplateInfos;
2535:            }
2536:
2537:            /**
2538:             * If this collection has already been initialized with
2539:             * an identical criteria, it returns the collection.
2540:             * Otherwise if this Issue is new, it will return
2541:             * an empty collection; or if this Issue has previously
2542:             * been saved, it will retrieve related IssueTemplateInfos from storage.
2543:             *
2544:             * This method is protected by default in order to keep the public
2545:             * api reasonable.  You can provide public methods for those you
2546:             * actually need in Issue.
2547:             */
2548:            protected List getIssueTemplateInfosJoinScope(Criteria criteria)
2549:                    throws TorqueException {
2550:                if (collIssueTemplateInfos == null) {
2551:                    if (isNew()) {
2552:                        collIssueTemplateInfos = new ArrayList();
2553:                    } else {
2554:                        criteria.add(IssueTemplateInfoPeer.ISSUE_ID,
2555:                                getIssueId());
2556:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2557:                                .doSelectJoinScope(criteria);
2558:                    }
2559:                } else {
2560:                    // the following code is to determine if a new query is
2561:                    // called for.  If the criteria is the same as the last
2562:                    // one, just return the collection.
2563:                    criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId());
2564:                    if (!lastIssueTemplateInfosCriteria.equals(criteria)) {
2565:                        collIssueTemplateInfos = IssueTemplateInfoPeer
2566:                                .doSelectJoinScope(criteria);
2567:                    }
2568:                }
2569:                lastIssueTemplateInfosCriteria = criteria;
2570:
2571:                return collIssueTemplateInfos;
2572:            }
2573:
2574:            private static List fieldNames = null;
2575:
2576:            /**
2577:             * Generate a list of field names.
2578:             *
2579:             * @return a list of field names
2580:             */
2581:            public static synchronized List getFieldNames() {
2582:                if (fieldNames == null) {
2583:                    fieldNames = new ArrayList();
2584:                    fieldNames.add("IssueId");
2585:                    fieldNames.add("IdPrefix");
2586:                    fieldNames.add("IdCount");
2587:                    fieldNames.add("IdDomain");
2588:                    fieldNames.add("TypeId");
2589:                    fieldNames.add("ModuleId");
2590:                    fieldNames.add("CreatedTransId");
2591:                    fieldNames.add("LastTransId");
2592:                    fieldNames.add("Deleted");
2593:                    fieldNames.add("Moved");
2594:                    fieldNames = Collections.unmodifiableList(fieldNames);
2595:                }
2596:                return fieldNames;
2597:            }
2598:
2599:            /**
2600:             * Retrieves a field from the object by name passed in as a String.
2601:             *
2602:             * @param name field name
2603:             * @return value
2604:             */
2605:            public Object getByName(String name) {
2606:                if (name.equals("IssueId")) {
2607:                    return getIssueId();
2608:                }
2609:                if (name.equals("IdPrefix")) {
2610:                    return getIdPrefix();
2611:                }
2612:                if (name.equals("IdCount")) {
2613:                    return new Integer(getIdCount());
2614:                }
2615:                if (name.equals("IdDomain")) {
2616:                    return getIdDomain();
2617:                }
2618:                if (name.equals("TypeId")) {
2619:                    return getTypeId();
2620:                }
2621:                if (name.equals("ModuleId")) {
2622:                    return getModuleId();
2623:                }
2624:                if (name.equals("CreatedTransId")) {
2625:                    return getCreatedTransId();
2626:                }
2627:                if (name.equals("LastTransId")) {
2628:                    return getLastTransId();
2629:                }
2630:                if (name.equals("Deleted")) {
2631:                    return Boolean.valueOf(getDeleted());
2632:                }
2633:                if (name.equals("Moved")) {
2634:                    return Boolean.valueOf(getMoved());
2635:                }
2636:                return null;
2637:            }
2638:
2639:            /**
2640:             * Retrieves a field from the object by name passed in
2641:             * as a String.  The String must be one of the static
2642:             * Strings defined in this Class' Peer.
2643:             *
2644:             * @param name peer name
2645:             * @return value
2646:             */
2647:            public Object getByPeerName(String name) {
2648:                if (name.equals(IssuePeer.ISSUE_ID)) {
2649:                    return getIssueId();
2650:                }
2651:                if (name.equals(IssuePeer.ID_PREFIX)) {
2652:                    return getIdPrefix();
2653:                }
2654:                if (name.equals(IssuePeer.ID_COUNT)) {
2655:                    return new Integer(getIdCount());
2656:                }
2657:                if (name.equals(IssuePeer.ID_DOMAIN)) {
2658:                    return getIdDomain();
2659:                }
2660:                if (name.equals(IssuePeer.TYPE_ID)) {
2661:                    return getTypeId();
2662:                }
2663:                if (name.equals(IssuePeer.MODULE_ID)) {
2664:                    return getModuleId();
2665:                }
2666:                if (name.equals(IssuePeer.CREATED_TRANS_ID)) {
2667:                    return getCreatedTransId();
2668:                }
2669:                if (name.equals(IssuePeer.LAST_TRANS_ID)) {
2670:                    return getLastTransId();
2671:                }
2672:                if (name.equals(IssuePeer.DELETED)) {
2673:                    return Boolean.valueOf(getDeleted());
2674:                }
2675:                if (name.equals(IssuePeer.MOVED)) {
2676:                    return Boolean.valueOf(getMoved());
2677:                }
2678:                return null;
2679:            }
2680:
2681:            /**
2682:             * Retrieves a field from the object by Position as specified
2683:             * in the xml schema.  Zero-based.
2684:             *
2685:             * @param pos position in xml schema
2686:             * @return value
2687:             */
2688:            public Object getByPosition(int pos) {
2689:                if (pos == 0) {
2690:                    return getIssueId();
2691:                }
2692:                if (pos == 1) {
2693:                    return getIdPrefix();
2694:                }
2695:                if (pos == 2) {
2696:                    return new Integer(getIdCount());
2697:                }
2698:                if (pos == 3) {
2699:                    return getIdDomain();
2700:                }
2701:                if (pos == 4) {
2702:                    return getTypeId();
2703:                }
2704:                if (pos == 5) {
2705:                    return getModuleId();
2706:                }
2707:                if (pos == 6) {
2708:                    return getCreatedTransId();
2709:                }
2710:                if (pos == 7) {
2711:                    return getLastTransId();
2712:                }
2713:                if (pos == 8) {
2714:                    return Boolean.valueOf(getDeleted());
2715:                }
2716:                if (pos == 9) {
2717:                    return Boolean.valueOf(getMoved());
2718:                }
2719:                return null;
2720:            }
2721:
2722:            /**
2723:             * Stores the object in the database.  If the object is new,
2724:             * it inserts it; otherwise an update is performed.
2725:             *
2726:             * @throws TorqueException
2727:             */
2728:            public void save() throws TorqueException {
2729:                save(IssuePeer.getMapBuilder().getDatabaseMap().getName());
2730:            }
2731:
2732:            /**
2733:             * Stores the object in the database.  If the object is new,
2734:             * it inserts it; otherwise an update is performed.
2735:             * Note: this code is here because the method body is
2736:             * auto-generated conditionally and therefore needs to be
2737:             * in this file instead of in the super class, BaseObject.
2738:             *
2739:             * @param dbName
2740:             * @throws TorqueException
2741:             */
2742:            public void save(String dbName) throws TorqueException {
2743:                Connection con = null;
2744:                try {
2745:                    con = Transaction.begin(dbName);
2746:                    save(con);
2747:                    Transaction.commit(con);
2748:                } catch (TorqueException e) {
2749:                    Transaction.safeRollback(con);
2750:                    throw e;
2751:                }
2752:            }
2753:
2754:            /** flag to prevent endless save loop, if this object is referenced
2755:              by another object which falls in this transaction. */
2756:            private boolean alreadyInSave = false;
2757:
2758:            /**
2759:             * Stores the object in the database.  If the object is new,
2760:             * it inserts it; otherwise an update is performed.  This method
2761:             * is meant to be used as part of a transaction, otherwise use
2762:             * the save() method and the connection details will be handled
2763:             * internally
2764:             *
2765:             * @param con
2766:             * @throws TorqueException
2767:             */
2768:            public void save(Connection con) throws TorqueException {
2769:                if (!alreadyInSave) {
2770:                    alreadyInSave = true;
2771:
2772:                    // If this object has been modified, then save it to the database.
2773:                    if (isModified()) {
2774:                        if (isNew()) {
2775:                            IssuePeer.doInsert((Issue) this , con);
2776:                            setNew(false);
2777:                        } else {
2778:                            IssuePeer.doUpdate((Issue) this , con);
2779:                        }
2780:
2781:                        if (isCacheOnSave()) {
2782:                            IssueManager.putInstance(this );
2783:                        }
2784:                    }
2785:
2786:                    if (collActivitys != null) {
2787:                        for (int i = 0; i < collActivitys.size(); i++) {
2788:                            ((Activity) collActivitys.get(i)).save(con);
2789:                        }
2790:                    }
2791:
2792:                    if (collAttachments != null) {
2793:                        for (int i = 0; i < collAttachments.size(); i++) {
2794:                            ((Attachment) collAttachments.get(i)).save(con);
2795:                        }
2796:                    }
2797:
2798:                    if (collDependsRelatedByObservedId != null) {
2799:                        for (int i = 0; i < collDependsRelatedByObservedId
2800:                                .size(); i++) {
2801:                            ((Depend) collDependsRelatedByObservedId.get(i))
2802:                                    .save(con);
2803:                        }
2804:                    }
2805:
2806:                    if (collDependsRelatedByObserverId != null) {
2807:                        for (int i = 0; i < collDependsRelatedByObserverId
2808:                                .size(); i++) {
2809:                            ((Depend) collDependsRelatedByObserverId.get(i))
2810:                                    .save(con);
2811:                        }
2812:                    }
2813:
2814:                    if (collAttributeValues != null) {
2815:                        for (int i = 0; i < collAttributeValues.size(); i++) {
2816:                            ((AttributeValue) collAttributeValues.get(i))
2817:                                    .save(con);
2818:                        }
2819:                    }
2820:
2821:                    if (collIssueVotes != null) {
2822:                        for (int i = 0; i < collIssueVotes.size(); i++) {
2823:                            ((IssueVote) collIssueVotes.get(i)).save(con);
2824:                        }
2825:                    }
2826:
2827:                    if (collIssueTemplateInfos != null) {
2828:                        for (int i = 0; i < collIssueTemplateInfos.size(); i++) {
2829:                            ((IssueTemplateInfo) collIssueTemplateInfos.get(i))
2830:                                    .save(con);
2831:                        }
2832:                    }
2833:                    alreadyInSave = false;
2834:                }
2835:            }
2836:
2837:            /**
2838:             * Specify whether to cache the object after saving to the db.
2839:             * This method returns true
2840:             */
2841:            protected boolean isCacheOnSave() {
2842:                return true;
2843:            }
2844:
2845:            /**
2846:             * Set the PrimaryKey using ObjectKey.
2847:             *
2848:             * @param key issueId ObjectKey
2849:             */
2850:            public void setPrimaryKey(ObjectKey key) throws TorqueException {
2851:                setIssueId(new Long(((NumberKey) key).longValue()));
2852:            }
2853:
2854:            /**
2855:             * Set the PrimaryKey using a String.
2856:             *
2857:             * @param key
2858:             */
2859:            public void setPrimaryKey(String key) throws TorqueException {
2860:                setIssueId(new Long(key));
2861:            }
2862:
2863:            /**
2864:             * returns an id that differentiates this object from others
2865:             * of its class.
2866:             */
2867:            public ObjectKey getPrimaryKey() {
2868:                return SimpleKey.keyFor(getIssueId());
2869:            }
2870:
2871:            /**
2872:             * get an id that differentiates this object from others
2873:             * of its class.
2874:             */
2875:            public String getQueryKey() {
2876:                if (getPrimaryKey() == null) {
2877:                    return "";
2878:                } else {
2879:                    return getPrimaryKey().toString();
2880:                }
2881:            }
2882:
2883:            /**
2884:             * set an id that differentiates this object from others
2885:             * of its class.
2886:             */
2887:            public void setQueryKey(String key) throws TorqueException {
2888:                setPrimaryKey(key);
2889:            }
2890:
2891:            /**
2892:             * Makes a copy of this object.
2893:             * It creates a new object filling in the simple attributes.
2894:             * It then fills all the association collections and sets the
2895:             * related objects to isNew=true.
2896:             */
2897:            public Issue copy() throws TorqueException {
2898:                return copyInto(new Issue());
2899:            }
2900:
2901:            protected Issue copyInto(Issue copyObj) throws TorqueException {
2902:                copyObj.setIssueId(issueId);
2903:                copyObj.setIdPrefix(idPrefix);
2904:                copyObj.setIdCount(idCount);
2905:                copyObj.setIdDomain(idDomain);
2906:                copyObj.setTypeId(typeId);
2907:                copyObj.setModuleId(moduleId);
2908:                copyObj.setCreatedTransId(createdTransId);
2909:                copyObj.setLastTransId(lastTransId);
2910:                copyObj.setDeleted(deleted);
2911:                copyObj.setMoved(moved);
2912:
2913:                copyObj.setIssueId((Long) null);
2914:
2915:                List v = getActivitys();
2916:                if (v != null) {
2917:                    for (int i = 0; i < v.size(); i++) {
2918:                        Activity obj = (Activity) v.get(i);
2919:                        copyObj.addActivity(obj.copy());
2920:                    }
2921:                } else {
2922:                    copyObj.collActivitys = null;
2923:                }
2924:
2925:                v = getAttachments();
2926:                if (v != null) {
2927:                    for (int i = 0; i < v.size(); i++) {
2928:                        Attachment obj = (Attachment) v.get(i);
2929:                        copyObj.addAttachment(obj.copy());
2930:                    }
2931:                } else {
2932:                    copyObj.collAttachments = null;
2933:                }
2934:
2935:                v = getDependsRelatedByObservedId();
2936:                if (v != null) {
2937:                    for (int i = 0; i < v.size(); i++) {
2938:                        Depend obj = (Depend) v.get(i);
2939:                        copyObj.addDependRelatedByObservedId(obj.copy());
2940:                    }
2941:                } else {
2942:                    copyObj.collDependsRelatedByObservedId = null;
2943:                }
2944:
2945:                v = getDependsRelatedByObserverId();
2946:                if (v != null) {
2947:                    for (int i = 0; i < v.size(); i++) {
2948:                        Depend obj = (Depend) v.get(i);
2949:                        copyObj.addDependRelatedByObserverId(obj.copy());
2950:                    }
2951:                } else {
2952:                    copyObj.collDependsRelatedByObserverId = null;
2953:                }
2954:
2955:                v = getAttributeValues();
2956:                if (v != null) {
2957:                    for (int i = 0; i < v.size(); i++) {
2958:                        AttributeValue obj = (AttributeValue) v.get(i);
2959:                        copyObj.addAttributeValue(obj.copy());
2960:                    }
2961:                } else {
2962:                    copyObj.collAttributeValues = null;
2963:                }
2964:
2965:                v = getIssueVotes();
2966:                if (v != null) {
2967:                    for (int i = 0; i < v.size(); i++) {
2968:                        IssueVote obj = (IssueVote) v.get(i);
2969:                        copyObj.addIssueVote(obj.copy());
2970:                    }
2971:                } else {
2972:                    copyObj.collIssueVotes = null;
2973:                }
2974:
2975:                v = getIssueTemplateInfos();
2976:                if (v != null) {
2977:                    for (int i = 0; i < v.size(); i++) {
2978:                        IssueTemplateInfo obj = (IssueTemplateInfo) v.get(i);
2979:                        copyObj.addIssueTemplateInfo(obj.copy());
2980:                    }
2981:                } else {
2982:                    copyObj.collIssueTemplateInfos = null;
2983:                }
2984:                return copyObj;
2985:            }
2986:
2987:            /**
2988:             * returns a peer instance associated with this om.  Since Peer classes
2989:             * are not to have any instance attributes, this method returns the
2990:             * same instance for all member of this class. The method could therefore
2991:             * be static, but this would prevent one from overriding the behavior.
2992:             */
2993:            public IssuePeer getPeer() {
2994:                return peer;
2995:            }
2996:
2997:            public String toString() {
2998:                StringBuffer str = new StringBuffer();
2999:                str.append("Issue:\n");
3000:                str.append("IssueId = ").append(getIssueId()).append("\n");
3001:                str.append("IdPrefix = ").append(getIdPrefix()).append("\n");
3002:                str.append("IdCount = ").append(getIdCount()).append("\n");
3003:                str.append("IdDomain = ").append(getIdDomain()).append("\n");
3004:                str.append("TypeId = ").append(getTypeId()).append("\n");
3005:                str.append("ModuleId = ").append(getModuleId()).append("\n");
3006:                str.append("CreatedTransId = ").append(getCreatedTransId())
3007:                        .append("\n");
3008:                str.append("LastTransId = ").append(getLastTransId()).append(
3009:                        "\n");
3010:                str.append("Deleted = ").append(getDeleted()).append("\n");
3011:                str.append("Moved = ").append(getMoved()).append("\n");
3012:                return (str.toString());
3013:            }
3014:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.