1 package org.tigris.scarab.om; 2 3 4 import java.math.BigDecimal ; 5 import java.sql.Connection ; 6 import java.util.ArrayList ; 7 import java.util.Collections ; 8 import java.util.Date ; 9 import java.util.List ; 10 11 import org.apache.commons.lang.ObjectUtils; 12 import org.apache.fulcrum.intake.Retrievable; 13 import org.apache.torque.TorqueException; 14 import org.apache.torque.om.BaseObject; 15 import org.apache.torque.om.ComboKey; 16 import org.apache.torque.om.DateKey; 17 import org.apache.torque.om.NumberKey; 18 import org.apache.torque.om.ObjectKey; 19 import org.apache.torque.om.SimpleKey; 20 import org.apache.torque.om.StringKey; 21 import org.apache.torque.om.Persistent; 22 import org.apache.torque.util.Criteria; 23 import org.apache.torque.util.Transaction; 24 25 26 27 28 29 33 public abstract class BaseIssue extends BaseObject 34 implements org.apache.fulcrum.intake.Retrievable 35 { 36 37 private static final IssuePeer peer = 38 new IssuePeer(); 39 40 41 42 private Long issueId; 43 44 45 private String idPrefix; 46 47 48 private int idCount; 49 50 51 private String idDomain; 52 53 54 private Integer typeId; 55 56 57 private Integer moduleId; 58 59 60 private Long createdTransId; 61 62 63 private boolean deleted = false; 64 65 66 71 public Long getIssueId() 72 { 73 return issueId; 74 } 75 76 77 82 public void setIssueId(Long v) throws TorqueException 83 { 84 85 if (!ObjectUtils.equals(this.issueId, v)) 86 { 87 this.issueId = v; 88 setModified(true); 89 } 90 91 92 93 if (collActivitys != null) 95 { 96 for (int i = 0; i < collActivitys.size(); i++) 97 { 98 ((Activity) collActivitys.get(i)) 99 .setIssueId(v); 100 } 101 } 102 103 if (collAttachments != null) 105 { 106 for (int i = 0; i < collAttachments.size(); i++) 107 { 108 ((Attachment) collAttachments.get(i)) 109 .setIssueId(v); 110 } 111 } 112 113 if (collDependsRelatedByObservedId != null) 115 { 116 for (int i = 0; i < collDependsRelatedByObservedId.size(); i++) 117 { 118 ((Depend) collDependsRelatedByObservedId.get(i)) 119 .setObservedId(v); 120 } 121 } 122 123 if (collDependsRelatedByObserverId != null) 125 { 126 for (int i = 0; i < collDependsRelatedByObserverId.size(); i++) 127 { 128 ((Depend) collDependsRelatedByObserverId.get(i)) 129 .setObserverId(v); 130 } 131 } 132 133 if (collAttributeValues != null) 135 { 136 for (int i = 0; i < collAttributeValues.size(); i++) 137 { 138 ((AttributeValue) collAttributeValues.get(i)) 139 .setIssueId(v); 140 } 141 } 142 143 if (collIssueVotes != null) 145 { 146 for (int i = 0; i < collIssueVotes.size(); i++) 147 { 148 ((IssueVote) collIssueVotes.get(i)) 149 .setIssueId(v); 150 } 151 } 152 153 if (collIssueTemplateInfos != null) 155 { 156 for (int i = 0; i < collIssueTemplateInfos.size(); i++) 157 { 158 ((IssueTemplateInfo) collIssueTemplateInfos.get(i)) 159 .setIssueId(v); 160 } 161 } 162 } 163 164 169 public String getIdPrefix() 170 { 171 return idPrefix; 172 } 173 174 175 180 public void setIdPrefix(String v) 181 { 182 183 if (!ObjectUtils.equals(this.idPrefix, v)) 184 { 185 this.idPrefix = v; 186 setModified(true); 187 } 188 189 190 } 191 192 197 public int getIdCount() 198 { 199 return idCount; 200 } 201 202 203 208 public void setIdCount(int v) 209 { 210 211 if (this.idCount != v) 212 { 213 this.idCount = v; 214 setModified(true); 215 } 216 217 218 } 219 220 225 public String getIdDomain() 226 { 227 return idDomain; 228 } 229 230 231 236 public void setIdDomain(String v) 237 { 238 239 if (!ObjectUtils.equals(this.idDomain, v)) 240 { 241 this.idDomain = v; 242 setModified(true); 243 } 244 245 246 } 247 248 253 public Integer getTypeId() 254 { 255 return typeId; 256 } 257 258 259 264 public void setTypeId(Integer v) throws TorqueException 265 { 266 267 if (!ObjectUtils.equals(this.typeId, v)) 268 { 269 this.typeId = v; 270 setModified(true); 271 } 272 273 274 if (aIssueType != null && !ObjectUtils.equals(aIssueType.getIssueTypeId(), v)) 275 { 276 aIssueType = null; 277 } 278 279 } 280 281 286 public Integer getModuleId() 287 { 288 return moduleId; 289 } 290 291 292 297 public void setModuleId(Integer v) throws TorqueException 298 { 299 300 if (!ObjectUtils.equals(this.moduleId, v)) 301 { 302 this.moduleId = v; 303 setModified(true); 304 } 305 306 307 if (aModule != null && !ObjectUtils.equals(aModule.getModuleId(), v)) 308 { 309 aModule = null; 310 } 311 312 } 313 314 319 public Long getCreatedTransId() 320 { 321 return createdTransId; 322 } 323 324 325 330 public void setCreatedTransId(Long v) throws TorqueException 331 { 332 333 if (!ObjectUtils.equals(this.createdTransId, v)) 334 { 335 this.createdTransId = v; 336 setModified(true); 337 } 338 339 340 if (aActivitySet != null && !ObjectUtils.equals(aActivitySet.getActivitySetId(), v)) 341 { 342 aActivitySet = null; 343 } 344 345 } 346 347 352 public boolean getDeleted() 353 { 354 return deleted; 355 } 356 357 358 363 public void setDeleted(boolean v) 364 { 365 366 if (this.deleted != v) 367 { 368 this.deleted = v; 369 setModified(true); 370 } 371 372 373 } 374 375 376 377 378 private Module aModule; 379 380 386 public void setModule(Module v) throws TorqueException 387 { 388 if (v == null) 389 { 390 setModuleId((Integer ) null); 391 } 392 else 393 { 394 setModuleId(v.getModuleId()); 395 } 396 aModule = v; 397 } 398 399 400 406 public Module getModule() throws TorqueException 407 { 408 if ( !ObjectUtils.equals(getModuleId(), null) ) 409 { 410 return ModuleManager.getInstance(SimpleKey.keyFor(getModuleId())); 411 } 412 return aModule; 413 } 414 415 421 public void setModuleKey(ObjectKey key) throws TorqueException 422 { 423 424 setModuleId(new Integer (((NumberKey) key).intValue())); 425 } 426 427 428 429 private IssueType aIssueType; 430 431 437 public void setIssueType(IssueType v) throws TorqueException 438 { 439 if (v == null) 440 { 441 setTypeId((Integer ) null); 442 } 443 else 444 { 445 setTypeId(v.getIssueTypeId()); 446 } 447 aIssueType = v; 448 } 449 450 451 457 public IssueType getIssueType() throws TorqueException 458 { 459 if ( !ObjectUtils.equals(getTypeId(), null) ) 460 { 461 return IssueTypeManager.getInstance(SimpleKey.keyFor(getTypeId())); 462 } 463 return aIssueType; 464 } 465 466 472 public void setIssueTypeKey(ObjectKey key) throws TorqueException 473 { 474 475 setTypeId(new Integer (((NumberKey) key).intValue())); 476 } 477 478 479 480 private ActivitySet aActivitySet; 481 482 488 public void setActivitySet(ActivitySet v) throws TorqueException 489 { 490 if (v == null) 491 { 492 setCreatedTransId((Long ) null); 493 } 494 else 495 { 496 setCreatedTransId(v.getActivitySetId()); 497 } 498 aActivitySet = v; 499 } 500 501 502 508 public ActivitySet getActivitySet() throws TorqueException 509 { 510 if ( !ObjectUtils.equals(getCreatedTransId(), null) ) 511 { 512 return ActivitySetManager.getInstance(SimpleKey.keyFor(getCreatedTransId())); 513 } 514 return aActivitySet; 515 } 516 517 523 public void setActivitySetKey(ObjectKey key) throws TorqueException 524 { 525 526 setCreatedTransId(new Long (((NumberKey) key).longValue())); 527 } 528 529 530 531 534 protected List collActivitys; 535 536 541 protected void initActivitys() 542 { 543 if (collActivitys == null) 544 { 545 collActivitys = new ArrayList (); 546 } 547 } 548 549 550 557 public void addActivity(Activity l) throws TorqueException 558 { 559 getActivitys().add(l); 560 l.setIssue((Issue)this); 561 } 562 563 566 private Criteria lastActivitysCriteria = null; 567 568 575 public List getActivitys() throws TorqueException 576 { 577 if (collActivitys == null) 578 { 579 collActivitys = getActivitys(new Criteria(10)); 580 } 581 return collActivitys; 582 } 583 584 595 public List getActivitys(Criteria criteria) throws TorqueException 596 { 597 if (collActivitys == null) 598 { 599 if (isNew()) 600 { 601 collActivitys = new ArrayList (); 602 } 603 else 604 { 605 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 606 collActivitys = ActivityPeer.doSelect(criteria); 607 } 608 } 609 else 610 { 611 if (!isNew()) 613 { 614 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 618 if (!lastActivitysCriteria.equals(criteria)) 619 { 620 collActivitys = ActivityPeer.doSelect(criteria); 621 } 622 } 623 } 624 lastActivitysCriteria = criteria; 625 626 return collActivitys; 627 } 628 629 637 public List getActivitys(Connection con) throws TorqueException 638 { 639 if (collActivitys == null) 640 { 641 collActivitys = getActivitys(new Criteria(10),con); 642 } 643 return collActivitys; 644 } 645 646 658 public List getActivitys(Criteria criteria,Connection con) throws TorqueException 659 { 660 if (collActivitys == null) 661 { 662 if (isNew()) 663 { 664 collActivitys = new ArrayList (); 665 } 666 else 667 { 668 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 669 collActivitys = ActivityPeer.doSelect(criteria,con); 670 } 671 } 672 else 673 { 674 if (!isNew()) 676 { 677 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 681 if (!lastActivitysCriteria.equals(criteria)) 682 { 683 collActivitys = ActivityPeer.doSelect(criteria,con); 684 } 685 } 686 } 687 lastActivitysCriteria = criteria; 688 689 return collActivitys; 690 } 691 692 693 694 695 696 697 698 699 700 701 702 713 protected List getActivitysJoinIssue(Criteria criteria) 714 throws TorqueException 715 { 716 if (collActivitys == null) 717 { 718 if (isNew()) 719 { 720 collActivitys = new ArrayList (); 721 } 722 else 723 { 724 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 725 collActivitys = ActivityPeer.doSelectJoinIssue(criteria); 726 } 727 } 728 else 729 { 730 734 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 735 if (!lastActivitysCriteria.equals(criteria)) 736 { 737 collActivitys = ActivityPeer.doSelectJoinIssue(criteria); 738 } 739 } 740 lastActivitysCriteria = criteria; 741 742 return collActivitys; 743 } 744 745 746 747 748 749 750 751 752 753 764 protected List getActivitysJoinAttribute(Criteria criteria) 765 throws TorqueException 766 { 767 if (collActivitys == null) 768 { 769 if (isNew()) 770 { 771 collActivitys = new ArrayList (); 772 } 773 else 774 { 775 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 776 collActivitys = ActivityPeer.doSelectJoinAttribute(criteria); 777 } 778 } 779 else 780 { 781 785 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 786 if (!lastActivitysCriteria.equals(criteria)) 787 { 788 collActivitys = ActivityPeer.doSelectJoinAttribute(criteria); 789 } 790 } 791 lastActivitysCriteria = criteria; 792 793 return collActivitys; 794 } 795 796 797 798 799 800 801 802 803 804 815 protected List getActivitysJoinActivitySet(Criteria criteria) 816 throws TorqueException 817 { 818 if (collActivitys == null) 819 { 820 if (isNew()) 821 { 822 collActivitys = new ArrayList (); 823 } 824 else 825 { 826 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 827 collActivitys = ActivityPeer.doSelectJoinActivitySet(criteria); 828 } 829 } 830 else 831 { 832 836 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 837 if (!lastActivitysCriteria.equals(criteria)) 838 { 839 collActivitys = ActivityPeer.doSelectJoinActivitySet(criteria); 840 } 841 } 842 lastActivitysCriteria = criteria; 843 844 return collActivitys; 845 } 846 847 848 849 850 851 852 853 854 855 866 protected List getActivitysJoinScarabUserImplRelatedByOldUserId(Criteria criteria) 867 throws TorqueException 868 { 869 if (collActivitys == null) 870 { 871 if (isNew()) 872 { 873 collActivitys = new ArrayList (); 874 } 875 else 876 { 877 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 878 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria); 879 } 880 } 881 else 882 { 883 887 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 888 if (!lastActivitysCriteria.equals(criteria)) 889 { 890 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByOldUserId(criteria); 891 } 892 } 893 lastActivitysCriteria = criteria; 894 895 return collActivitys; 896 } 897 898 899 900 901 902 903 904 905 906 917 protected List getActivitysJoinScarabUserImplRelatedByNewUserId(Criteria criteria) 918 throws TorqueException 919 { 920 if (collActivitys == null) 921 { 922 if (isNew()) 923 { 924 collActivitys = new ArrayList (); 925 } 926 else 927 { 928 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 929 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria); 930 } 931 } 932 else 933 { 934 938 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 939 if (!lastActivitysCriteria.equals(criteria)) 940 { 941 collActivitys = ActivityPeer.doSelectJoinScarabUserImplRelatedByNewUserId(criteria); 942 } 943 } 944 lastActivitysCriteria = criteria; 945 946 return collActivitys; 947 } 948 949 950 951 952 953 954 955 956 957 968 protected List getActivitysJoinAttributeOptionRelatedByOldOptionId(Criteria criteria) 969 throws TorqueException 970 { 971 if (collActivitys == null) 972 { 973 if (isNew()) 974 { 975 collActivitys = new ArrayList (); 976 } 977 else 978 { 979 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 980 collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria); 981 } 982 } 983 else 984 { 985 989 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 990 if (!lastActivitysCriteria.equals(criteria)) 991 { 992 collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByOldOptionId(criteria); 993 } 994 } 995 lastActivitysCriteria = criteria; 996 997 return collActivitys; 998 } 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1019 protected List getActivitysJoinAttributeOptionRelatedByNewOptionId(Criteria criteria) 1020 throws TorqueException 1021 { 1022 if (collActivitys == null) 1023 { 1024 if (isNew()) 1025 { 1026 collActivitys = new ArrayList (); 1027 } 1028 else 1029 { 1030 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1031 collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria); 1032 } 1033 } 1034 else 1035 { 1036 1040 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1041 if (!lastActivitysCriteria.equals(criteria)) 1042 { 1043 collActivitys = ActivityPeer.doSelectJoinAttributeOptionRelatedByNewOptionId(criteria); 1044 } 1045 } 1046 lastActivitysCriteria = criteria; 1047 1048 return collActivitys; 1049 } 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1070 protected List getActivitysJoinAttachment(Criteria criteria) 1071 throws TorqueException 1072 { 1073 if (collActivitys == null) 1074 { 1075 if (isNew()) 1076 { 1077 collActivitys = new ArrayList (); 1078 } 1079 else 1080 { 1081 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1082 collActivitys = ActivityPeer.doSelectJoinAttachment(criteria); 1083 } 1084 } 1085 else 1086 { 1087 1091 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1092 if (!lastActivitysCriteria.equals(criteria)) 1093 { 1094 collActivitys = ActivityPeer.doSelectJoinAttachment(criteria); 1095 } 1096 } 1097 lastActivitysCriteria = criteria; 1098 1099 return collActivitys; 1100 } 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1121 protected List getActivitysJoinDepend(Criteria criteria) 1122 throws TorqueException 1123 { 1124 if (collActivitys == null) 1125 { 1126 if (isNew()) 1127 { 1128 collActivitys = new ArrayList (); 1129 } 1130 else 1131 { 1132 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1133 collActivitys = ActivityPeer.doSelectJoinDepend(criteria); 1134 } 1135 } 1136 else 1137 { 1138 1142 criteria.add(ActivityPeer.ISSUE_ID, getIssueId() ); 1143 if (!lastActivitysCriteria.equals(criteria)) 1144 { 1145 collActivitys = ActivityPeer.doSelectJoinDepend(criteria); 1146 } 1147 } 1148 lastActivitysCriteria = criteria; 1149 1150 return collActivitys; 1151 } 1152 1153 1154 1155 1156 1157 1160 protected List collAttachments; 1161 1162 1167 protected void initAttachments() 1168 { 1169 if (collAttachments == null) 1170 { 1171 collAttachments = new ArrayList (); 1172 } 1173 } 1174 1175 1176 1183 public void addAttachment(Attachment l) throws TorqueException 1184 { 1185 getAttachments().add(l); 1186 l.setIssue((Issue)this); 1187 } 1188 1189 1192 private Criteria lastAttachmentsCriteria = null; 1193 1194 1201 public List getAttachments() throws TorqueException 1202 { 1203 if (collAttachments == null) 1204 { 1205 collAttachments = getAttachments(new Criteria(10)); 1206 } 1207 return collAttachments; 1208 } 1209 1210 1221 public List getAttachments(Criteria criteria) throws TorqueException 1222 { 1223 if (collAttachments == null) 1224 { 1225 if (isNew()) 1226 { 1227 collAttachments = new ArrayList (); 1228 } 1229 else 1230 { 1231 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1232 collAttachments = AttachmentPeer.doSelect(criteria); 1233 } 1234 } 1235 else 1236 { 1237 if (!isNew()) 1239 { 1240 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1244 if (!lastAttachmentsCriteria.equals(criteria)) 1245 { 1246 collAttachments = AttachmentPeer.doSelect(criteria); 1247 } 1248 } 1249 } 1250 lastAttachmentsCriteria = criteria; 1251 1252 return collAttachments; 1253 } 1254 1255 1263 public List getAttachments(Connection con) throws TorqueException 1264 { 1265 if (collAttachments == null) 1266 { 1267 collAttachments = getAttachments(new Criteria(10),con); 1268 } 1269 return collAttachments; 1270 } 1271 1272 1284 public List getAttachments(Criteria criteria,Connection con) throws TorqueException 1285 { 1286 if (collAttachments == null) 1287 { 1288 if (isNew()) 1289 { 1290 collAttachments = new ArrayList (); 1291 } 1292 else 1293 { 1294 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1295 collAttachments = AttachmentPeer.doSelect(criteria,con); 1296 } 1297 } 1298 else 1299 { 1300 if (!isNew()) 1302 { 1303 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1307 if (!lastAttachmentsCriteria.equals(criteria)) 1308 { 1309 collAttachments = AttachmentPeer.doSelect(criteria,con); 1310 } 1311 } 1312 } 1313 lastAttachmentsCriteria = criteria; 1314 1315 return collAttachments; 1316 } 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1339 protected List getAttachmentsJoinIssue(Criteria criteria) 1340 throws TorqueException 1341 { 1342 if (collAttachments == null) 1343 { 1344 if (isNew()) 1345 { 1346 collAttachments = new ArrayList (); 1347 } 1348 else 1349 { 1350 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1351 collAttachments = AttachmentPeer.doSelectJoinIssue(criteria); 1352 } 1353 } 1354 else 1355 { 1356 1360 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1361 if (!lastAttachmentsCriteria.equals(criteria)) 1362 { 1363 collAttachments = AttachmentPeer.doSelectJoinIssue(criteria); 1364 } 1365 } 1366 lastAttachmentsCriteria = criteria; 1367 1368 return collAttachments; 1369 } 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1390 protected List getAttachmentsJoinAttachmentType(Criteria criteria) 1391 throws TorqueException 1392 { 1393 if (collAttachments == null) 1394 { 1395 if (isNew()) 1396 { 1397 collAttachments = new ArrayList (); 1398 } 1399 else 1400 { 1401 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1402 collAttachments = AttachmentPeer.doSelectJoinAttachmentType(criteria); 1403 } 1404 } 1405 else 1406 { 1407 1411 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1412 if (!lastAttachmentsCriteria.equals(criteria)) 1413 { 1414 collAttachments = AttachmentPeer.doSelectJoinAttachmentType(criteria); 1415 } 1416 } 1417 lastAttachmentsCriteria = criteria; 1418 1419 return collAttachments; 1420 } 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1441 protected List getAttachmentsJoinScarabUserImplRelatedByCreatedBy(Criteria criteria) 1442 throws TorqueException 1443 { 1444 if (collAttachments == null) 1445 { 1446 if (isNew()) 1447 { 1448 collAttachments = new ArrayList (); 1449 } 1450 else 1451 { 1452 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1453 collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByCreatedBy(criteria); 1454 } 1455 } 1456 else 1457 { 1458 1462 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1463 if (!lastAttachmentsCriteria.equals(criteria)) 1464 { 1465 collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByCreatedBy(criteria); 1466 } 1467 } 1468 lastAttachmentsCriteria = criteria; 1469 1470 return collAttachments; 1471 } 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1492 protected List getAttachmentsJoinScarabUserImplRelatedByModifiedBy(Criteria criteria) 1493 throws TorqueException 1494 { 1495 if (collAttachments == null) 1496 { 1497 if (isNew()) 1498 { 1499 collAttachments = new ArrayList (); 1500 } 1501 else 1502 { 1503 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1504 collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByModifiedBy(criteria); 1505 } 1506 } 1507 else 1508 { 1509 1513 criteria.add(AttachmentPeer.ISSUE_ID, getIssueId() ); 1514 if (!lastAttachmentsCriteria.equals(criteria)) 1515 { 1516 collAttachments = AttachmentPeer.doSelectJoinScarabUserImplRelatedByModifiedBy(criteria); 1517 } 1518 } 1519 lastAttachmentsCriteria = criteria; 1520 1521 return collAttachments; 1522 } 1523 1524 1525 1526 1527 1528 1531 protected List collDependsRelatedByObservedId; 1532 1533 1538 protected void initDependsRelatedByObservedId() 1539 { 1540 if (collDependsRelatedByObservedId == null) 1541 { 1542 collDependsRelatedByObservedId = new ArrayList (); 1543 } 1544 } 1545 1546 1547 1554 public void addDependRelatedByObservedId(Depend l) throws TorqueException 1555 { 1556 getDependsRelatedByObservedId().add(l); 1557 l.setIssueRelatedByObservedId((Issue)this); 1558 } 1559 1560 1563 private Criteria lastDependsRelatedByObservedIdCriteria = null; 1564 1565 1572 public List getDependsRelatedByObservedId() throws TorqueException 1573 { 1574 if (collDependsRelatedByObservedId == null) 1575 { 1576 collDependsRelatedByObservedId = getDependsRelatedByObservedId(new Criteria(10)); 1577 } 1578 return collDependsRelatedByObservedId; 1579 } 1580 1581 1592 public List getDependsRelatedByObservedId(Criteria criteria) throws TorqueException 1593 { 1594 if (collDependsRelatedByObservedId == null) 1595 { 1596 if (isNew()) 1597 { 1598 collDependsRelatedByObservedId = new ArrayList (); 1599 } 1600 else 1601 { 1602 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1603 collDependsRelatedByObservedId = DependPeer.doSelect(criteria); 1604 } 1605 } 1606 else 1607 { 1608 if (!isNew()) 1610 { 1611 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1615 if (!lastDependsRelatedByObservedIdCriteria.equals(criteria)) 1616 { 1617 collDependsRelatedByObservedId = DependPeer.doSelect(criteria); 1618 } 1619 } 1620 } 1621 lastDependsRelatedByObservedIdCriteria = criteria; 1622 1623 return collDependsRelatedByObservedId; 1624 } 1625 1626 1634 public List getDependsRelatedByObservedId(Connection con) throws TorqueException 1635 { 1636 if (collDependsRelatedByObservedId == null) 1637 { 1638 collDependsRelatedByObservedId = getDependsRelatedByObservedId(new Criteria(10),con); 1639 } 1640 return collDependsRelatedByObservedId; 1641 } 1642 1643 1655 public List getDependsRelatedByObservedId(Criteria criteria,Connection con) throws TorqueException 1656 { 1657 if (collDependsRelatedByObservedId == null) 1658 { 1659 if (isNew()) 1660 { 1661 collDependsRelatedByObservedId = new ArrayList (); 1662 } 1663 else 1664 { 1665 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1666 collDependsRelatedByObservedId = DependPeer.doSelect(criteria,con); 1667 } 1668 } 1669 else 1670 { 1671 if (!isNew()) 1673 { 1674 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1678 if (!lastDependsRelatedByObservedIdCriteria.equals(criteria)) 1679 { 1680 collDependsRelatedByObservedId = DependPeer.doSelect(criteria,con); 1681 } 1682 } 1683 } 1684 lastDependsRelatedByObservedIdCriteria = criteria; 1685 1686 return collDependsRelatedByObservedId; 1687 } 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1718 protected List getDependsRelatedByObservedIdJoinIssueRelatedByObserverId(Criteria criteria) 1719 throws TorqueException 1720 { 1721 if (collDependsRelatedByObservedId == null) 1722 { 1723 if (isNew()) 1724 { 1725 collDependsRelatedByObservedId = new ArrayList (); 1726 } 1727 else 1728 { 1729 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1730 collDependsRelatedByObservedId = DependPeer.doSelectJoinIssueRelatedByObserverId(criteria); 1731 } 1732 } 1733 else 1734 { 1735 1739 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1740 if (!lastDependsRelatedByObservedIdCriteria.equals(criteria)) 1741 { 1742 collDependsRelatedByObservedId = DependPeer.doSelectJoinIssueRelatedByObserverId(criteria); 1743 } 1744 } 1745 lastDependsRelatedByObservedIdCriteria = criteria; 1746 1747 return collDependsRelatedByObservedId; 1748 } 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1769 protected List getDependsRelatedByObservedIdJoinDependType(Criteria criteria) 1770 throws TorqueException 1771 { 1772 if (collDependsRelatedByObservedId == null) 1773 { 1774 if (isNew()) 1775 { 1776 collDependsRelatedByObservedId = new ArrayList (); 1777 } 1778 else 1779 { 1780 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1781 collDependsRelatedByObservedId = DependPeer.doSelectJoinDependType(criteria); 1782 } 1783 } 1784 else 1785 { 1786 1790 criteria.add(DependPeer.OBSERVED_ID, getIssueId() ); 1791 if (!lastDependsRelatedByObservedIdCriteria.equals(criteria)) 1792 { 1793 collDependsRelatedByObservedId = DependPeer.doSelectJoinDependType(criteria); 1794 } 1795 } 1796 lastDependsRelatedByObservedIdCriteria = criteria; 1797 1798 return collDependsRelatedByObservedId; 1799 } 1800 1801 1802 1803 1804 1805 1808 protected List collDependsRelatedByObserverId; 1809 1810 1815 protected void initDependsRelatedByObserverId() 1816 { 1817 if (collDependsRelatedByObserverId == null) 1818 { 1819 collDependsRelatedByObserverId = new ArrayList (); 1820 } 1821 } 1822 1823 1824 1831 public void addDependRelatedByObserverId(Depend l) throws TorqueException 1832 { 1833 getDependsRelatedByObserverId().add(l); 1834 l.setIssueRelatedByObserverId((Issue)this); 1835 } 1836 1837 1840 private Criteria lastDependsRelatedByObserverIdCriteria = null; 1841 1842 1849 public List getDependsRelatedByObserverId() throws TorqueException 1850 { 1851 if (collDependsRelatedByObserverId == null) 1852 { 1853 collDependsRelatedByObserverId = getDependsRelatedByObserverId(new Criteria(10)); 1854 } 1855 return collDependsRelatedByObserverId; 1856 } 1857 1858 1869 public List getDependsRelatedByObserverId(Criteria criteria) throws TorqueException 1870 { 1871 if (collDependsRelatedByObserverId == null) 1872 { 1873 if (isNew()) 1874 { 1875 collDependsRelatedByObserverId = new ArrayList (); 1876 } 1877 else 1878 { 1879 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 1880 collDependsRelatedByObserverId = DependPeer.doSelect(criteria); 1881 } 1882 } 1883 else 1884 { 1885 if (!isNew()) 1887 { 1888 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 1892 if (!lastDependsRelatedByObserverIdCriteria.equals(criteria)) 1893 { 1894 collDependsRelatedByObserverId = DependPeer.doSelect(criteria); 1895 } 1896 } 1897 } 1898 lastDependsRelatedByObserverIdCriteria = criteria; 1899 1900 return collDependsRelatedByObserverId; 1901 } 1902 1903 1911 public List getDependsRelatedByObserverId(Connection con) throws TorqueException 1912 { 1913 if (collDependsRelatedByObserverId == null) 1914 { 1915 collDependsRelatedByObserverId = getDependsRelatedByObserverId(new Criteria(10),con); 1916 } 1917 return collDependsRelatedByObserverId; 1918 } 1919 1920 1932 public List getDependsRelatedByObserverId(Criteria criteria,Connection con) throws TorqueException 1933 { 1934 if (collDependsRelatedByObserverId == null) 1935 { 1936 if (isNew()) 1937 { 1938 collDependsRelatedByObserverId = new ArrayList (); 1939 } 1940 else 1941 { 1942 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 1943 collDependsRelatedByObserverId = DependPeer.doSelect(criteria,con); 1944 } 1945 } 1946 else 1947 { 1948 if (!isNew()) 1950 { 1951 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 1955 if (!lastDependsRelatedByObserverIdCriteria.equals(criteria)) 1956 { 1957 collDependsRelatedByObserverId = DependPeer.doSelect(criteria,con); 1958 } 1959 } 1960 } 1961 lastDependsRelatedByObserverIdCriteria = criteria; 1962 1963 return collDependsRelatedByObserverId; 1964 } 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1987 protected List getDependsRelatedByObserverIdJoinIssueRelatedByObservedId(Criteria criteria) 1988 throws TorqueException 1989 { 1990 if (collDependsRelatedByObserverId == null) 1991 { 1992 if (isNew()) 1993 { 1994 collDependsRelatedByObserverId = new ArrayList (); 1995 } 1996 else 1997 { 1998 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 1999 collDependsRelatedByObserverId = DependPeer.doSelectJoinIssueRelatedByObservedId(criteria); 2000 } 2001 } 2002 else 2003 { 2004 2008 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 2009 if (!lastDependsRelatedByObserverIdCriteria.equals(criteria)) 2010 { 2011 collDependsRelatedByObserverId = DependPeer.doSelectJoinIssueRelatedByObservedId(criteria); 2012 } 2013 } 2014 lastDependsRelatedByObserverIdCriteria = criteria; 2015 2016 return collDependsRelatedByObserverId; 2017 } 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2046 protected List getDependsRelatedByObserverIdJoinDependType(Criteria criteria) 2047 throws TorqueException 2048 { 2049 if (collDependsRelatedByObserverId == null) 2050 { 2051 if (isNew()) 2052 { 2053 collDependsRelatedByObserverId = new ArrayList (); 2054 } 2055 else 2056 { 2057 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 2058 collDependsRelatedByObserverId = DependPeer.doSelectJoinDependType(criteria); 2059 } 2060 } 2061 else 2062 { 2063 2067 criteria.add(DependPeer.OBSERVER_ID, getIssueId() ); 2068 if (!lastDependsRelatedByObserverIdCriteria.equals(criteria)) 2069 { 2070 collDependsRelatedByObserverId = DependPeer.doSelectJoinDependType(criteria); 2071 } 2072 } 2073 lastDependsRelatedByObserverIdCriteria = criteria; 2074 2075 return collDependsRelatedByObserverId; 2076 } 2077 2078 2079 2080 2081 2082 2085 protected List collAttributeValues; 2086 2087 2092 protected void initAttributeValues() 2093 { 2094 if (collAttributeValues == null) 2095 { 2096 collAttributeValues = new ArrayList (); 2097 } 2098 } 2099 2100 2101 2108 public void addAttributeValue(AttributeValue l) throws TorqueException 2109 { 2110 getAttributeValues().add(l); 2111 l.setIssue((Issue)this); 2112 } 2113 2114 2117 private Criteria lastAttributeValuesCriteria = null; 2118 2119 2126 public List getAttributeValues() throws TorqueException 2127 { 2128 if (collAttributeValues == null) 2129 { 2130 collAttributeValues = getAttributeValues(new Criteria(10)); 2131 } 2132 return collAttributeValues; 2133 } 2134 2135 2146 public List getAttributeValues(Criteria criteria) throws TorqueException 2147 { 2148 if (collAttributeValues == null) 2149 { 2150 if (isNew()) 2151 { 2152 collAttributeValues = new ArrayList (); 2153 } 2154 else 2155 { 2156 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2157 collAttributeValues = AttributeValuePeer.doSelect(criteria); 2158 } 2159 } 2160 else 2161 { 2162 if (!isNew()) 2164 { 2165 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2169 if (!lastAttributeValuesCriteria.equals(criteria)) 2170 { 2171 collAttributeValues = AttributeValuePeer.doSelect(criteria); 2172 } 2173 } 2174 } 2175 lastAttributeValuesCriteria = criteria; 2176 2177 return collAttributeValues; 2178 } 2179 2180 2188 public List getAttributeValues(Connection con) throws TorqueException 2189 { 2190 if (collAttributeValues == null) 2191 { 2192 collAttributeValues = getAttributeValues(new Criteria(10),con); 2193 } 2194 return collAttributeValues; 2195 } 2196 2197 2209 public List getAttributeValues(Criteria criteria,Connection con) throws TorqueException 2210 { 2211 if (collAttributeValues == null) 2212 { 2213 if (isNew()) 2214 { 2215 collAttributeValues = new ArrayList (); 2216 } 2217 else 2218 { 2219 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2220 collAttributeValues = AttributeValuePeer.doSelect(criteria,con); 2221 } 2222 } 2223 else 2224 { 2225 if (!isNew()) 2227 { 2228 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2232 if (!lastAttributeValuesCriteria.equals(criteria)) 2233 { 2234 collAttributeValues = AttributeValuePeer.doSelect(criteria,con); 2235 } 2236 } 2237 } 2238 lastAttributeValuesCriteria = criteria; 2239 2240 return collAttributeValues; 2241 } 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2264 protected List getAttributeValuesJoinIssue(Criteria criteria) 2265 throws TorqueException 2266 { 2267 if (collAttributeValues == null) 2268 { 2269 if (isNew()) 2270 { 2271 collAttributeValues = new ArrayList (); 2272 } 2273 else 2274 { 2275 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2276 collAttributeValues = AttributeValuePeer.doSelectJoinIssue(criteria); 2277 } 2278 } 2279 else 2280 { 2281 2285 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2286 if (!lastAttributeValuesCriteria.equals(criteria)) 2287 { 2288 collAttributeValues = AttributeValuePeer.doSelectJoinIssue(criteria); 2289 } 2290 } 2291 lastAttributeValuesCriteria = criteria; 2292 2293 return collAttributeValues; 2294 } 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2315 protected List getAttributeValuesJoinAttribute(Criteria criteria) 2316 throws TorqueException 2317 { 2318 if (collAttributeValues == null) 2319 { 2320 if (isNew()) 2321 { 2322 collAttributeValues = new ArrayList (); 2323 } 2324 else 2325 { 2326 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2327 collAttributeValues = AttributeValuePeer.doSelectJoinAttribute(criteria); 2328 } 2329 } 2330 else 2331 { 2332 2336 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2337 if (!lastAttributeValuesCriteria.equals(criteria)) 2338 { 2339 collAttributeValues = AttributeValuePeer.doSelectJoinAttribute(criteria); 2340 } 2341 } 2342 lastAttributeValuesCriteria = criteria; 2343 2344 return collAttributeValues; 2345 } 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2366 protected List getAttributeValuesJoinAttributeOption(Criteria criteria) 2367 throws TorqueException 2368 { 2369 if (collAttributeValues == null) 2370 { 2371 if (isNew()) 2372 { 2373 collAttributeValues = new ArrayList (); 2374 } 2375 else 2376 { 2377 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2378 collAttributeValues = AttributeValuePeer.doSelectJoinAttributeOption(criteria); 2379 } 2380 } 2381 else 2382 { 2383 2387 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2388 if (!lastAttributeValuesCriteria.equals(criteria)) 2389 { 2390 collAttributeValues = AttributeValuePeer.doSelectJoinAttributeOption(criteria); 2391 } 2392 } 2393 lastAttributeValuesCriteria = criteria; 2394 2395 return collAttributeValues; 2396 } 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2417 protected List getAttributeValuesJoinScarabUserImpl(Criteria criteria) 2418 throws TorqueException 2419 { 2420 if (collAttributeValues == null) 2421 { 2422 if (isNew()) 2423 { 2424 collAttributeValues = new ArrayList (); 2425 } 2426 else 2427 { 2428 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2429 collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria); 2430 } 2431 } 2432 else 2433 { 2434 2438 criteria.add(AttributeValuePeer.ISSUE_ID, getIssueId() ); 2439 if (!lastAttributeValuesCriteria.equals(criteria)) 2440 { 2441 collAttributeValues = AttributeValuePeer.doSelectJoinScarabUserImpl(criteria); 2442 } 2443 } 2444 lastAttributeValuesCriteria = criteria; 2445 2446 return collAttributeValues; 2447 } 2448 2449 2450 2451 2452 2453 2456 protected List collIssueVotes; 2457 2458 2463 protected void initIssueVotes() 2464 { 2465 if (collIssueVotes == null) 2466 { 2467 collIssueVotes = new ArrayList (); 2468 } 2469 } 2470 2471 2472 2479 public void addIssueVote(IssueVote l) throws TorqueException 2480 { 2481 getIssueVotes().add(l); 2482 l.setIssue((Issue)this); 2483 } 2484 2485 2488 private Criteria lastIssueVotesCriteria = null; 2489 2490 2497 public List getIssueVotes() throws TorqueException 2498 { 2499 if (collIssueVotes == null) 2500 { 2501 collIssueVotes = getIssueVotes(new Criteria(10)); 2502 } 2503 return collIssueVotes; 2504 } 2505 2506 2517 public List getIssueVotes(Criteria criteria) throws TorqueException 2518 { 2519 if (collIssueVotes == null) 2520 { 2521 if (isNew()) 2522 { 2523 collIssueVotes = new ArrayList (); 2524 } 2525 else 2526 { 2527 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2528 collIssueVotes = IssueVotePeer.doSelect(criteria); 2529 } 2530 } 2531 else 2532 { 2533 if (!isNew()) 2535 { 2536 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2540 if (!lastIssueVotesCriteria.equals(criteria)) 2541 { 2542 collIssueVotes = IssueVotePeer.doSelect(criteria); 2543 } 2544 } 2545 } 2546 lastIssueVotesCriteria = criteria; 2547 2548 return collIssueVotes; 2549 } 2550 2551 2559 public List getIssueVotes(Connection con) throws TorqueException 2560 { 2561 if (collIssueVotes == null) 2562 { 2563 collIssueVotes = getIssueVotes(new Criteria(10),con); 2564 } 2565 return collIssueVotes; 2566 } 2567 2568 2580 public List getIssueVotes(Criteria criteria,Connection con) throws TorqueException 2581 { 2582 if (collIssueVotes == null) 2583 { 2584 if (isNew()) 2585 { 2586 collIssueVotes = new ArrayList (); 2587 } 2588 else 2589 { 2590 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2591 collIssueVotes = IssueVotePeer.doSelect(criteria,con); 2592 } 2593 } 2594 else 2595 { 2596 if (!isNew()) 2598 { 2599 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2603 if (!lastIssueVotesCriteria.equals(criteria)) 2604 { 2605 collIssueVotes = IssueVotePeer.doSelect(criteria,con); 2606 } 2607 } 2608 } 2609 lastIssueVotesCriteria = criteria; 2610 2611 return collIssueVotes; 2612 } 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2635 protected List getIssueVotesJoinIssue(Criteria criteria) 2636 throws TorqueException 2637 { 2638 if (collIssueVotes == null) 2639 { 2640 if (isNew()) 2641 { 2642 collIssueVotes = new ArrayList (); 2643 } 2644 else 2645 { 2646 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2647 collIssueVotes = IssueVotePeer.doSelectJoinIssue(criteria); 2648 } 2649 } 2650 else 2651 { 2652 2656 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2657 if (!lastIssueVotesCriteria.equals(criteria)) 2658 { 2659 collIssueVotes = IssueVotePeer.doSelectJoinIssue(criteria); 2660 } 2661 } 2662 lastIssueVotesCriteria = criteria; 2663 2664 return collIssueVotes; 2665 } 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2686 protected List getIssueVotesJoinScarabUserImpl(Criteria criteria) 2687 throws TorqueException 2688 { 2689 if (collIssueVotes == null) 2690 { 2691 if (isNew()) 2692 { 2693 collIssueVotes = new ArrayList (); 2694 } 2695 else 2696 { 2697 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2698 collIssueVotes = IssueVotePeer.doSelectJoinScarabUserImpl(criteria); 2699 } 2700 } 2701 else 2702 { 2703 2707 criteria.add(IssueVotePeer.ISSUE_ID, getIssueId() ); 2708 if (!lastIssueVotesCriteria.equals(criteria)) 2709 { 2710 collIssueVotes = IssueVotePeer.doSelectJoinScarabUserImpl(criteria); 2711 } 2712 } 2713 lastIssueVotesCriteria = criteria; 2714 2715 return collIssueVotes; 2716 } 2717 2718 2719 2720 2721 2722 2725 protected List collIssueTemplateInfos; 2726 2727 2732 protected void initIssueTemplateInfos() 2733 { 2734 if (collIssueTemplateInfos == null) 2735 { 2736 collIssueTemplateInfos = new ArrayList (); 2737 } 2738 } 2739 2740 2741 2748 public void addIssueTemplateInfo(IssueTemplateInfo l) throws TorqueException 2749 { 2750 getIssueTemplateInfos().add(l); 2751 l.setIssue((Issue)this); 2752 } 2753 2754 2757 private Criteria lastIssueTemplateInfosCriteria = null; 2758 2759 2766 public List getIssueTemplateInfos() throws TorqueException 2767 { 2768 if (collIssueTemplateInfos == null) 2769 { 2770 collIssueTemplateInfos = getIssueTemplateInfos(new Criteria(10)); 2771 } 2772 return collIssueTemplateInfos; 2773 } 2774 2775 2786 public List getIssueTemplateInfos(Criteria criteria) throws TorqueException 2787 { 2788 if (collIssueTemplateInfos == null) 2789 { 2790 if (isNew()) 2791 { 2792 collIssueTemplateInfos = new ArrayList (); 2793 } 2794 else 2795 { 2796 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2797 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria); 2798 } 2799 } 2800 else 2801 { 2802 if (!isNew()) 2804 { 2805 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2809 if (!lastIssueTemplateInfosCriteria.equals(criteria)) 2810 { 2811 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria); 2812 } 2813 } 2814 } 2815 lastIssueTemplateInfosCriteria = criteria; 2816 2817 return collIssueTemplateInfos; 2818 } 2819 2820 2828 public List getIssueTemplateInfos(Connection con) throws TorqueException 2829 { 2830 if (collIssueTemplateInfos == null) 2831 { 2832 collIssueTemplateInfos = getIssueTemplateInfos(new Criteria(10),con); 2833 } 2834 return collIssueTemplateInfos; 2835 } 2836 2837 2849 public List getIssueTemplateInfos(Criteria criteria,Connection con) throws TorqueException 2850 { 2851 if (collIssueTemplateInfos == null) 2852 { 2853 if (isNew()) 2854 { 2855 collIssueTemplateInfos = new ArrayList (); 2856 } 2857 else 2858 { 2859 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2860 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria,con); 2861 } 2862 } 2863 else 2864 { 2865 if (!isNew()) 2867 { 2868 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2872 if (!lastIssueTemplateInfosCriteria.equals(criteria)) 2873 { 2874 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelect(criteria,con); 2875 } 2876 } 2877 } 2878 lastIssueTemplateInfosCriteria = criteria; 2879 2880 return collIssueTemplateInfos; 2881 } 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2904 protected List getIssueTemplateInfosJoinIssue(Criteria criteria) 2905 throws TorqueException 2906 { 2907 if (collIssueTemplateInfos == null) 2908 { 2909 if (isNew()) 2910 { 2911 collIssueTemplateInfos = new ArrayList (); 2912 } 2913 else 2914 { 2915 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2916 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinIssue(criteria); 2917 } 2918 } 2919 else 2920 { 2921 2925 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2926 if (!lastIssueTemplateInfosCriteria.equals(criteria)) 2927 { 2928 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinIssue(criteria); 2929 } 2930 } 2931 lastIssueTemplateInfosCriteria = criteria; 2932 2933 return collIssueTemplateInfos; 2934 } 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2955 protected List getIssueTemplateInfosJoinScope(Criteria criteria) 2956 throws TorqueException 2957 { 2958 if (collIssueTemplateInfos == null) 2959 { 2960 if (isNew()) 2961 { 2962 collIssueTemplateInfos = new ArrayList (); 2963 } 2964 else 2965 { 2966 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2967 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinScope(criteria); 2968 } 2969 } 2970 else 2971 { 2972 2976 criteria.add(IssueTemplateInfoPeer.ISSUE_ID, getIssueId() ); 2977 if (!lastIssueTemplateInfosCriteria.equals(criteria)) 2978 { 2979 collIssueTemplateInfos = IssueTemplateInfoPeer.doSelectJoinScope(criteria); 2980 } 2981 } 2982 lastIssueTemplateInfosCriteria = criteria; 2983 2984 return collIssueTemplateInfos; 2985 } 2986 2987 2988 2989 2990 private static List fieldNames = null; 2991 2992 2997 public static synchronized List getFieldNames() 2998 { 2999 if (fieldNames == null) 3000 { 3001 fieldNames = new ArrayList (); 3002 fieldNames.add("IssueId"); 3003 fieldNames.add("IdPrefix"); 3004 fieldNames.add("IdCount"); 3005 fieldNames.add("IdDomain"); 3006 fieldNames.add("TypeId"); 3007 fieldNames.add("ModuleId"); 3008 fieldNames.add("CreatedTransId"); 3009 fieldNames.add("Deleted"); 3010 fieldNames = Collections.unmodifiableList(fieldNames); 3011 } 3012 return fieldNames; 3013 } 3014 3015 3021 public Object getByName(String name) 3022 { 3023 if (name.equals("IssueId")) 3024 { 3025 return getIssueId(); 3026 } 3027 if (name.equals("IdPrefix")) 3028 { 3029 return getIdPrefix(); 3030 } 3031 if (name.equals("IdCount")) 3032 { 3033 return new Integer (getIdCount()); 3034 } 3035 if (name.equals("IdDomain")) 3036 { 3037 return getIdDomain(); 3038 } 3039 if (name.equals("TypeId")) 3040 { 3041 return getTypeId(); 3042 } 3043 if (name.equals("ModuleId")) 3044 { 3045 return getModuleId(); 3046 } 3047 if (name.equals("CreatedTransId")) 3048 { 3049 return getCreatedTransId(); 3050 } 3051 if (name.equals("Deleted")) 3052 { 3053 return Boolean.valueOf(getDeleted()); 3054 } 3055 return null; 3056 } 3057 3058 3066 public Object getByPeerName(String name) 3067 { 3068 if (name.equals(IssuePeer.ISSUE_ID)) 3069 { 3070 return getIssueId(); 3071 } 3072 if (name.equals(IssuePeer.ID_PREFIX)) 3073 { 3074 return getIdPrefix(); 3075 } 3076 if (name.equals(IssuePeer.ID_COUNT)) 3077 { 3078 return new Integer (getIdCount()); 3079 } 3080 if (name.equals(IssuePeer.ID_DOMAIN)) 3081 { 3082 return getIdDomain(); 3083 } 3084 if (name.equals(IssuePeer.TYPE_ID)) 3085 { 3086 return getTypeId(); 3087 } 3088 if (name.equals(IssuePeer.MODULE_ID)) 3089 { 3090 return getModuleId(); 3091 } 3092 if (name.equals(IssuePeer.CREATED_TRANS_ID)) 3093 { 3094 return getCreatedTransId(); 3095 } 3096 if (name.equals(IssuePeer.DELETED)) 3097 { 3098 return Boolean.valueOf(getDeleted()); 3099 } 3100 return null; 3101 } 3102 3103 3110 public Object getByPosition(int pos) 3111 { 3112 if (pos == 0) 3113 { 3114 return getIssueId(); 3115 } 3116 if (pos == 1) 3117 { 3118 return getIdPrefix(); 3119 } 3120 if (pos == 2) 3121 { 3122 return new Integer (getIdCount()); 3123 } 3124 if (pos == 3) 3125 { 3126 return getIdDomain(); 3127 } 3128 if (pos == 4) 3129 { 3130 return getTypeId(); 3131 } 3132 if (pos == 5) 3133 { 3134 return getModuleId(); 3135 } 3136 if (pos == 6) 3137 { 3138 return getCreatedTransId(); 3139 } 3140 if (pos == 7) 3141 { 3142 return Boolean.valueOf(getDeleted()); 3143 } 3144 return null; 3145 } 3146 3147 3153 public void save() throws Exception 3154 { 3155 save(IssuePeer.getMapBuilder() 3156 .getDatabaseMap().getName()); 3157 } 3158 3159 3169 public void save(String dbName) throws TorqueException 3170 { 3171 Connection con = null; 3172 try 3173 { 3174 con = Transaction.begin(dbName); 3175 save(con); 3176 Transaction.commit(con); 3177 } 3178 catch(TorqueException e) 3179 { 3180 Transaction.safeRollback(con); 3181 throw e; 3182 } 3183 } 3184 3185 3187 private boolean alreadyInSave = false; 3188 3198 public void save(Connection con) throws TorqueException 3199 { 3200 if (!alreadyInSave) 3201 { 3202 alreadyInSave = true; 3203 3204 3205 3206 if (isModified()) 3208 { 3209 if (isNew()) 3210 { 3211 IssuePeer.doInsert((Issue)this, con); 3212 setNew(false); 3213 } 3214 else 3215 { 3216 IssuePeer.doUpdate((Issue)this, con); 3217 } 3218 3219 if (isCacheOnSave()) 3220 { 3221 IssueManager.putInstance(this); 3222 } 3223 } 3224 3225 3226 if (collActivitys != null) 3227 { 3228 for (int i = 0; i < collActivitys.size(); i++) 3229 { 3230 ((Activity)collActivitys.get(i)).save(con); 3231 } 3232 } 3233 3234 if (collAttachments != null) 3235 { 3236 for (int i = 0; i < collAttachments.size(); i++) 3237 { 3238 ((Attachment)collAttachments.get(i)).save(con); 3239 } 3240 } 3241 3242 if (collDependsRelatedByObservedId != null) 3243 { 3244 for (int i = 0; i < collDependsRelatedByObservedId.size(); i++) 3245 { 3246 ((Depend)collDependsRelatedByObservedId.get(i)).save(con); 3247 } 3248 } 3249 3250 if (collDependsRelatedByObserverId != null) 3251 { 3252 for (int i = 0; i < collDependsRelatedByObserverId.size(); i++) 3253 { 3254 ((Depend)collDependsRelatedByObserverId.get(i)).save(con); 3255 } 3256 } 3257 3258 if (collAttributeValues != null) 3259 { 3260 for (int i = 0; i < collAttributeValues.size(); i++) 3261 { 3262 ((AttributeValue)collAttributeValues.get(i)).save(con); 3263 } 3264 } 3265 3266 if (collIssueVotes != null) 3267 { 3268 for (int i = 0; i < collIssueVotes.size(); i++) 3269 { 3270 ((IssueVote)collIssueVotes.get(i)).save(con); 3271 } 3272 } 3273 3274 if (collIssueTemplateInfos != null) 3275 { 3276 for (int i = 0; i < collIssueTemplateInfos.size(); i++) 3277 { 3278 ((IssueTemplateInfo)collIssueTemplateInfos.get(i)).save(con); 3279 } 3280 } 3281 alreadyInSave = false; 3282 } 3283 } 3284 3285 3289 protected boolean isCacheOnSave() 3290 { 3291 return true; 3292 } 3293 3294 3295 3300 public void setPrimaryKey(ObjectKey issueId) 3301 throws TorqueException { 3302 setIssueId(new Long (((NumberKey)issueId).longValue())); 3303 } 3304 3305 3310 public void setPrimaryKey(String key) throws TorqueException 3311 { 3312 setIssueId(new Long (key)); 3313 } 3314 3315 3316 3320 public ObjectKey getPrimaryKey() 3321 { 3322 return SimpleKey.keyFor(getIssueId()); 3323 } 3324 3325 3329 public String getQueryKey() 3330 { 3331 if (getPrimaryKey() == null) 3332 { 3333 return ""; 3334 } 3335 else 3336 { 3337 return getPrimaryKey().toString(); 3338 } 3339 } 3340 3341 3345 public void setQueryKey(String key) 3346 throws TorqueException 3347 { 3348 setPrimaryKey(key); 3349 } 3350 3351 3357 public Issue copy() throws TorqueException 3358 { 3359 Issue copyObj = new Issue(); 3360 copyObj.setIssueId(issueId); 3361 copyObj.setIdPrefix(idPrefix); 3362 copyObj.setIdCount(idCount); 3363 copyObj.setIdDomain(idDomain); 3364 copyObj.setTypeId(typeId); 3365 copyObj.setModuleId(moduleId); 3366 copyObj.setCreatedTransId(createdTransId); 3367 copyObj.setDeleted(deleted); 3368 3369 copyObj.setIssueId((Long )null); 3370 3371 3372 3373 List v = getActivitys(); 3374 for (int i = 0; i < v.size(); i++) 3375 { 3376 Activity obj = (Activity) v.get(i); 3377 copyObj.addActivity(obj.copy()); 3378 } 3379 3380 3381 v = getAttachments(); 3382 for (int i = 0; i < v.size(); i++) 3383 { 3384 Attachment obj = (Attachment) v.get(i); 3385 copyObj.addAttachment(obj.copy()); 3386 } 3387 3388 3389 v = getDependsRelatedByObservedId(); 3390 for (int i = 0; i < v.size(); i++) 3391 { 3392 Depend obj = (Depend) v.get(i); 3393 copyObj.addDependRelatedByObservedId(obj.copy()); 3394 } 3395 3396 3397 v = getDependsRelatedByObserverId(); 3398 for (int i = 0; i < v.size(); i++) 3399 { 3400 Depend obj = (Depend) v.get(i); 3401 copyObj.addDependRelatedByObserverId(obj.copy()); 3402 } 3403 3404 3405 v = getAttributeValues(); 3406 for (int i = 0; i < v.size(); i++) 3407 { 3408 AttributeValue obj = (AttributeValue) v.get(i); 3409 copyObj.addAttributeValue(obj.copy()); 3410 } 3411 3412 3413 v = getIssueVotes(); 3414 for (int i = 0; i < v.size(); i++) 3415 { 3416 IssueVote obj = (IssueVote) v.get(i); 3417 copyObj.addIssueVote(obj.copy()); 3418 } 3419 3420 3421 v = getIssueTemplateInfos(); 3422 for (int i = 0; i < v.size(); i++) 3423 { 3424 IssueTemplateInfo obj = (IssueTemplateInfo) v.get(i); 3425 copyObj.addIssueTemplateInfo(obj.copy()); 3426 } 3427 return copyObj; 3428 } 3429 3430 3436 public IssuePeer getPeer() 3437 { 3438 return peer; 3439 } 3440 3441 public String toString() 3442 { 3443 StringBuffer str = new StringBuffer (); 3444 str.append("Issue:\n"); 3445 str.append("IssueId = ") 3446 .append(getIssueId()) 3447 .append("\n"); 3448 str.append("IdPrefix = ") 3449 .append(getIdPrefix()) 3450 .append("\n"); 3451 str.append("IdCount = ") 3452 .append(getIdCount()) 3453 .append("\n"); 3454 str.append("IdDomain = ") 3455 .append(getIdDomain()) 3456 .append("\n"); 3457 str.append("TypeId = ") 3458 .append(getTypeId()) 3459 .append("\n"); 3460 str.append("ModuleId = ") 3461 .append(getModuleId()) 3462 .append("\n"); 3463 str.append("CreatedTransId = ") 3464 .append(getCreatedTransId()) 3465 .append("\n"); 3466 str.append("Deleted = ") 3467 .append(getDeleted()) 3468 .append("\n"); 3469 return(str.toString()); 3470 } 3471} 3472 | Popular Tags |