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 BaseScarabModule extends org.tigris.scarab.om.AbstractScarabModule 34 implements org.apache.fulcrum.intake.Retrievable 35 { 36 37 private static final ScarabModulePeer peer = 38 new ScarabModulePeer(); 39 40 41 42 private Integer moduleId; 43 44 45 private String realName; 46 47 48 private String domain; 49 50 51 private String code; 52 53 54 private String description; 55 56 57 private String url; 58 59 60 private String archiveEmail; 61 62 63 private Integer parentId; 64 65 66 private Integer ownerId; 67 68 69 private Integer qaContactId; 70 71 72 private boolean deleted = false; 73 74 75 private boolean locked = false; 76 77 78 private int classKey; 79 80 81 86 public Integer getModuleId() 87 { 88 return moduleId; 89 } 90 91 92 97 public void setModuleId(Integer v) throws TorqueException 98 { 99 100 if (!ObjectUtils.equals(this.moduleId, v)) 101 { 102 this.moduleId = v; 103 setModified(true); 104 } 105 106 107 108 if (collAttributeGroups != null) 110 { 111 for (int i = 0; i < collAttributeGroups.size(); i++) 112 { 113 ((AttributeGroup) collAttributeGroups.get(i)) 114 .setModuleId(v); 115 } 116 } 117 118 if (collIssues != null) 120 { 121 for (int i = 0; i < collIssues.size(); i++) 122 { 123 ((Issue) collIssues.get(i)) 124 .setModuleId(v); 125 } 126 } 127 128 if (collRModuleIssueTypes != null) 130 { 131 for (int i = 0; i < collRModuleIssueTypes.size(); i++) 132 { 133 ((RModuleIssueType) collRModuleIssueTypes.get(i)) 134 .setModuleId(v); 135 } 136 } 137 138 if (collMITListItems != null) 140 { 141 for (int i = 0; i < collMITListItems.size(); i++) 142 { 143 ((MITListItem) collMITListItems.get(i)) 144 .setModuleId(v); 145 } 146 } 147 148 if (collRModuleAttributes != null) 150 { 151 for (int i = 0; i < collRModuleAttributes.size(); i++) 152 { 153 ((RModuleAttribute) collRModuleAttributes.get(i)) 154 .setModuleId(v); 155 } 156 } 157 158 if (collRModuleOptions != null) 160 { 161 for (int i = 0; i < collRModuleOptions.size(); i++) 162 { 163 ((RModuleOption) collRModuleOptions.get(i)) 164 .setModuleId(v); 165 } 166 } 167 168 if (collRModuleUserAttributes != null) 170 { 171 for (int i = 0; i < collRModuleUserAttributes.size(); i++) 172 { 173 ((RModuleUserAttribute) collRModuleUserAttributes.get(i)) 174 .setModuleId(v); 175 } 176 } 177 178 if (collUserVotes != null) 180 { 181 for (int i = 0; i < collUserVotes.size(); i++) 182 { 183 ((UserVote) collUserVotes.get(i)) 184 .setModuleId(v); 185 } 186 } 187 188 if (collQuerys != null) 190 { 191 for (int i = 0; i < collQuerys.size(); i++) 192 { 193 ((Query) collQuerys.get(i)) 194 .setModuleId(v); 195 } 196 } 197 198 if (collReports != null) 200 { 201 for (int i = 0; i < collReports.size(); i++) 202 { 203 ((Report) collReports.get(i)) 204 .setModuleId(v); 205 } 206 } 207 208 if (collPendingGroupUserRoles != null) 210 { 211 for (int i = 0; i < collPendingGroupUserRoles.size(); i++) 212 { 213 ((PendingGroupUserRole) collPendingGroupUserRoles.get(i)) 214 .setGroupId(v); 215 } 216 } 217 218 if (collGlobalParameters != null) 220 { 221 for (int i = 0; i < collGlobalParameters.size(); i++) 222 { 223 ((GlobalParameter) collGlobalParameters.get(i)) 224 .setModuleId(v); 225 } 226 } 227 } 228 229 234 public String getRealName() 235 { 236 return realName; 237 } 238 239 240 245 public void setRealName(String v) 246 { 247 248 if (!ObjectUtils.equals(this.realName, v)) 249 { 250 this.realName = v; 251 setModified(true); 252 } 253 254 255 } 256 257 262 public String getDomain() 263 { 264 return domain; 265 } 266 267 268 273 public void setDomain(String v) 274 { 275 276 if (!ObjectUtils.equals(this.domain, v)) 277 { 278 this.domain = v; 279 setModified(true); 280 } 281 282 283 } 284 285 290 public String getCode() 291 { 292 return code; 293 } 294 295 296 301 public void setCode(String v) 302 { 303 304 if (!ObjectUtils.equals(this.code, v)) 305 { 306 this.code = v; 307 setModified(true); 308 } 309 310 311 } 312 313 318 public String getDescription() 319 { 320 return description; 321 } 322 323 324 329 public void setDescription(String v) 330 { 331 332 if (!ObjectUtils.equals(this.description, v)) 333 { 334 this.description = v; 335 setModified(true); 336 } 337 338 339 } 340 341 346 public String getUrl() 347 { 348 return url; 349 } 350 351 352 357 public void setUrl(String v) 358 { 359 360 if (!ObjectUtils.equals(this.url, v)) 361 { 362 this.url = v; 363 setModified(true); 364 } 365 366 367 } 368 369 374 public String getArchiveEmail() 375 { 376 return archiveEmail; 377 } 378 379 380 385 public void setArchiveEmail(String v) 386 { 387 388 if (!ObjectUtils.equals(this.archiveEmail, v)) 389 { 390 this.archiveEmail = v; 391 setModified(true); 392 } 393 394 395 } 396 397 402 public Integer getParentId() 403 { 404 return parentId; 405 } 406 407 408 413 public void setParentId(Integer v) throws TorqueException 414 { 415 416 if (!ObjectUtils.equals(this.parentId, v)) 417 { 418 this.parentId = v; 419 setModified(true); 420 } 421 422 423 if (aModuleRelatedByParentId != null && !ObjectUtils.equals(aModuleRelatedByParentId.getModuleId(), v)) 424 { 425 aModuleRelatedByParentId = null; 426 } 427 428 } 429 430 435 public Integer getOwnerId() 436 { 437 return ownerId; 438 } 439 440 441 446 public void setOwnerId(Integer v) throws TorqueException 447 { 448 449 if (!ObjectUtils.equals(this.ownerId, v)) 450 { 451 this.ownerId = v; 452 setModified(true); 453 } 454 455 456 if (aScarabUserRelatedByOwnerId != null && !ObjectUtils.equals(aScarabUserRelatedByOwnerId.getUserId(), v)) 457 { 458 aScarabUserRelatedByOwnerId = null; 459 } 460 461 } 462 463 468 public Integer getQaContactId() 469 { 470 return qaContactId; 471 } 472 473 474 479 public void setQaContactId(Integer v) throws TorqueException 480 { 481 482 if (!ObjectUtils.equals(this.qaContactId, v)) 483 { 484 this.qaContactId = v; 485 setModified(true); 486 } 487 488 489 if (aScarabUserRelatedByQaContactId != null && !ObjectUtils.equals(aScarabUserRelatedByQaContactId.getUserId(), v)) 490 { 491 aScarabUserRelatedByQaContactId = null; 492 } 493 494 } 495 496 501 public boolean getDeleted() 502 { 503 return deleted; 504 } 505 506 507 512 public void setDeleted(boolean v) 513 { 514 515 if (this.deleted != v) 516 { 517 this.deleted = v; 518 setModified(true); 519 } 520 521 522 } 523 524 529 public boolean getLocked() 530 { 531 return locked; 532 } 533 534 535 540 public void setLocked(boolean v) 541 { 542 543 if (this.locked != v) 544 { 545 this.locked = v; 546 setModified(true); 547 } 548 549 550 } 551 552 557 public int getClassKey() 558 { 559 return classKey; 560 } 561 562 563 568 public void setClassKey(int v) 569 { 570 571 if (this.classKey != v) 572 { 573 this.classKey = v; 574 setModified(true); 575 } 576 577 578 } 579 580 581 582 583 private Module aModuleRelatedByParentId; 584 585 591 public void setModuleRelatedByParentId(Module v) throws TorqueException 592 { 593 if (v == null) 594 { 595 setParentId((Integer ) null); 596 } 597 else 598 { 599 setParentId(v.getModuleId()); 600 } 601 aModuleRelatedByParentId = v; 602 } 603 604 605 611 public Module getModuleRelatedByParentId() throws TorqueException 612 { 613 if ( !ObjectUtils.equals(getParentId(), null) ) 614 { 615 return ModuleManager.getInstance(SimpleKey.keyFor(getParentId())); 616 } 617 return aModuleRelatedByParentId; 618 } 619 620 626 public void setModuleRelatedByParentIdKey(ObjectKey key) throws TorqueException 627 { 628 629 setParentId(new Integer (((NumberKey) key).intValue())); 630 } 631 632 633 634 private ScarabUser aScarabUserRelatedByOwnerId; 635 636 642 public void setScarabUserRelatedByOwnerId(ScarabUser v) throws TorqueException 643 { 644 if (v == null) 645 { 646 setOwnerId((Integer ) null); 647 } 648 else 649 { 650 setOwnerId(v.getUserId()); 651 } 652 aScarabUserRelatedByOwnerId = v; 653 } 654 655 656 662 public ScarabUser getScarabUserRelatedByOwnerId() throws TorqueException 663 { 664 if ( !ObjectUtils.equals(getOwnerId(), null) ) 665 { 666 return ScarabUserManager.getInstance(SimpleKey.keyFor(getOwnerId())); 667 } 668 return aScarabUserRelatedByOwnerId; 669 } 670 671 677 public void setScarabUserRelatedByOwnerIdKey(ObjectKey key) throws TorqueException 678 { 679 680 setOwnerId(new Integer (((NumberKey) key).intValue())); 681 } 682 683 684 685 private ScarabUser aScarabUserRelatedByQaContactId; 686 687 693 public void setScarabUserRelatedByQaContactId(ScarabUser v) throws TorqueException 694 { 695 if (v == null) 696 { 697 setQaContactId((Integer ) null); 698 } 699 else 700 { 701 setQaContactId(v.getUserId()); 702 } 703 aScarabUserRelatedByQaContactId = v; 704 } 705 706 707 713 public ScarabUser getScarabUserRelatedByQaContactId() throws TorqueException 714 { 715 if ( !ObjectUtils.equals(getQaContactId(), null) ) 716 { 717 return ScarabUserManager.getInstance(SimpleKey.keyFor(getQaContactId())); 718 } 719 return aScarabUserRelatedByQaContactId; 720 } 721 722 728 public void setScarabUserRelatedByQaContactIdKey(ObjectKey key) throws TorqueException 729 { 730 731 setQaContactId(new Integer (((NumberKey) key).intValue())); 732 } 733 734 735 736 739 protected List collAttributeGroups; 740 741 746 protected void initAttributeGroups() 747 { 748 if (collAttributeGroups == null) 749 { 750 collAttributeGroups = new ArrayList (); 751 } 752 } 753 754 755 762 public void addAttributeGroup(AttributeGroup l) throws TorqueException 763 { 764 getAttributeGroups().add(l); 765 l.setModule((ScarabModule)this); 766 } 767 768 771 private Criteria lastAttributeGroupsCriteria = null; 772 773 780 public List getAttributeGroups() throws TorqueException 781 { 782 if (collAttributeGroups == null) 783 { 784 collAttributeGroups = getAttributeGroups(new Criteria(10)); 785 } 786 return collAttributeGroups; 787 } 788 789 800 public List getAttributeGroups(Criteria criteria) throws TorqueException 801 { 802 if (collAttributeGroups == null) 803 { 804 if (isNew()) 805 { 806 collAttributeGroups = new ArrayList (); 807 } 808 else 809 { 810 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 811 collAttributeGroups = AttributeGroupPeer.doSelect(criteria); 812 } 813 } 814 else 815 { 816 if (!isNew()) 818 { 819 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 823 if (!lastAttributeGroupsCriteria.equals(criteria)) 824 { 825 collAttributeGroups = AttributeGroupPeer.doSelect(criteria); 826 } 827 } 828 } 829 lastAttributeGroupsCriteria = criteria; 830 831 return collAttributeGroups; 832 } 833 834 842 public List getAttributeGroups(Connection con) throws TorqueException 843 { 844 if (collAttributeGroups == null) 845 { 846 collAttributeGroups = getAttributeGroups(new Criteria(10),con); 847 } 848 return collAttributeGroups; 849 } 850 851 863 public List getAttributeGroups(Criteria criteria,Connection con) throws TorqueException 864 { 865 if (collAttributeGroups == null) 866 { 867 if (isNew()) 868 { 869 collAttributeGroups = new ArrayList (); 870 } 871 else 872 { 873 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 874 collAttributeGroups = AttributeGroupPeer.doSelect(criteria,con); 875 } 876 } 877 else 878 { 879 if (!isNew()) 881 { 882 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 886 if (!lastAttributeGroupsCriteria.equals(criteria)) 887 { 888 collAttributeGroups = AttributeGroupPeer.doSelect(criteria,con); 889 } 890 } 891 } 892 lastAttributeGroupsCriteria = criteria; 893 894 return collAttributeGroups; 895 } 896 897 898 899 900 901 902 903 904 905 906 907 918 protected List getAttributeGroupsJoinScarabModule(Criteria criteria) 919 throws TorqueException 920 { 921 if (collAttributeGroups == null) 922 { 923 if (isNew()) 924 { 925 collAttributeGroups = new ArrayList (); 926 } 927 else 928 { 929 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 930 collAttributeGroups = AttributeGroupPeer.doSelectJoinScarabModule(criteria); 931 } 932 } 933 else 934 { 935 939 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 940 if (!lastAttributeGroupsCriteria.equals(criteria)) 941 { 942 collAttributeGroups = AttributeGroupPeer.doSelectJoinScarabModule(criteria); 943 } 944 } 945 lastAttributeGroupsCriteria = criteria; 946 947 return collAttributeGroups; 948 } 949 950 951 952 953 954 955 956 957 958 969 protected List getAttributeGroupsJoinIssueType(Criteria criteria) 970 throws TorqueException 971 { 972 if (collAttributeGroups == null) 973 { 974 if (isNew()) 975 { 976 collAttributeGroups = new ArrayList (); 977 } 978 else 979 { 980 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 981 collAttributeGroups = AttributeGroupPeer.doSelectJoinIssueType(criteria); 982 } 983 } 984 else 985 { 986 990 criteria.add(AttributeGroupPeer.MODULE_ID, getModuleId() ); 991 if (!lastAttributeGroupsCriteria.equals(criteria)) 992 { 993 collAttributeGroups = AttributeGroupPeer.doSelectJoinIssueType(criteria); 994 } 995 } 996 lastAttributeGroupsCriteria = criteria; 997 998 return collAttributeGroups; 999 } 1000 1001 1002 1003 1004 1005 1008 protected List collIssues; 1009 1010 1015 protected void initIssues() 1016 { 1017 if (collIssues == null) 1018 { 1019 collIssues = new ArrayList (); 1020 } 1021 } 1022 1023 1024 1031 public void addIssue(Issue l) throws TorqueException 1032 { 1033 getIssues().add(l); 1034 l.setModule((ScarabModule)this); 1035 } 1036 1037 1040 private Criteria lastIssuesCriteria = null; 1041 1042 1049 public List getIssues() throws TorqueException 1050 { 1051 if (collIssues == null) 1052 { 1053 collIssues = getIssues(new Criteria(10)); 1054 } 1055 return collIssues; 1056 } 1057 1058 1069 public List getIssues(Criteria criteria) throws TorqueException 1070 { 1071 if (collIssues == null) 1072 { 1073 if (isNew()) 1074 { 1075 collIssues = new ArrayList (); 1076 } 1077 else 1078 { 1079 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1080 collIssues = IssuePeer.doSelect(criteria); 1081 } 1082 } 1083 else 1084 { 1085 if (!isNew()) 1087 { 1088 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1092 if (!lastIssuesCriteria.equals(criteria)) 1093 { 1094 collIssues = IssuePeer.doSelect(criteria); 1095 } 1096 } 1097 } 1098 lastIssuesCriteria = criteria; 1099 1100 return collIssues; 1101 } 1102 1103 1111 public List getIssues(Connection con) throws TorqueException 1112 { 1113 if (collIssues == null) 1114 { 1115 collIssues = getIssues(new Criteria(10),con); 1116 } 1117 return collIssues; 1118 } 1119 1120 1132 public List getIssues(Criteria criteria,Connection con) throws TorqueException 1133 { 1134 if (collIssues == null) 1135 { 1136 if (isNew()) 1137 { 1138 collIssues = new ArrayList (); 1139 } 1140 else 1141 { 1142 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1143 collIssues = IssuePeer.doSelect(criteria,con); 1144 } 1145 } 1146 else 1147 { 1148 if (!isNew()) 1150 { 1151 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1155 if (!lastIssuesCriteria.equals(criteria)) 1156 { 1157 collIssues = IssuePeer.doSelect(criteria,con); 1158 } 1159 } 1160 } 1161 lastIssuesCriteria = criteria; 1162 1163 return collIssues; 1164 } 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1187 protected List getIssuesJoinScarabModule(Criteria criteria) 1188 throws TorqueException 1189 { 1190 if (collIssues == null) 1191 { 1192 if (isNew()) 1193 { 1194 collIssues = new ArrayList (); 1195 } 1196 else 1197 { 1198 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1199 collIssues = IssuePeer.doSelectJoinScarabModule(criteria); 1200 } 1201 } 1202 else 1203 { 1204 1208 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1209 if (!lastIssuesCriteria.equals(criteria)) 1210 { 1211 collIssues = IssuePeer.doSelectJoinScarabModule(criteria); 1212 } 1213 } 1214 lastIssuesCriteria = criteria; 1215 1216 return collIssues; 1217 } 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1238 protected List getIssuesJoinIssueType(Criteria criteria) 1239 throws TorqueException 1240 { 1241 if (collIssues == null) 1242 { 1243 if (isNew()) 1244 { 1245 collIssues = new ArrayList (); 1246 } 1247 else 1248 { 1249 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1250 collIssues = IssuePeer.doSelectJoinIssueType(criteria); 1251 } 1252 } 1253 else 1254 { 1255 1259 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1260 if (!lastIssuesCriteria.equals(criteria)) 1261 { 1262 collIssues = IssuePeer.doSelectJoinIssueType(criteria); 1263 } 1264 } 1265 lastIssuesCriteria = criteria; 1266 1267 return collIssues; 1268 } 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1289 protected List getIssuesJoinActivitySet(Criteria criteria) 1290 throws TorqueException 1291 { 1292 if (collIssues == null) 1293 { 1294 if (isNew()) 1295 { 1296 collIssues = new ArrayList (); 1297 } 1298 else 1299 { 1300 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1301 collIssues = IssuePeer.doSelectJoinActivitySet(criteria); 1302 } 1303 } 1304 else 1305 { 1306 1310 criteria.add(IssuePeer.MODULE_ID, getModuleId() ); 1311 if (!lastIssuesCriteria.equals(criteria)) 1312 { 1313 collIssues = IssuePeer.doSelectJoinActivitySet(criteria); 1314 } 1315 } 1316 lastIssuesCriteria = criteria; 1317 1318 return collIssues; 1319 } 1320 1321 1322 1323 1324 1325 1328 protected List collRModuleIssueTypes; 1329 1330 1335 protected void initRModuleIssueTypes() 1336 { 1337 if (collRModuleIssueTypes == null) 1338 { 1339 collRModuleIssueTypes = new ArrayList (); 1340 } 1341 } 1342 1343 1344 1351 public void addRModuleIssueType(RModuleIssueType l) throws TorqueException 1352 { 1353 getRModuleIssueTypes().add(l); 1354 l.setModule((ScarabModule)this); 1355 } 1356 1357 1360 private Criteria lastRModuleIssueTypesCriteria = null; 1361 1362 1369 public List getRModuleIssueTypes() throws TorqueException 1370 { 1371 if (collRModuleIssueTypes == null) 1372 { 1373 collRModuleIssueTypes = getRModuleIssueTypes(new Criteria(10)); 1374 } 1375 return collRModuleIssueTypes; 1376 } 1377 1378 1389 public List getRModuleIssueTypes(Criteria criteria) throws TorqueException 1390 { 1391 if (collRModuleIssueTypes == null) 1392 { 1393 if (isNew()) 1394 { 1395 collRModuleIssueTypes = new ArrayList (); 1396 } 1397 else 1398 { 1399 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1400 collRModuleIssueTypes = RModuleIssueTypePeer.doSelect(criteria); 1401 } 1402 } 1403 else 1404 { 1405 if (!isNew()) 1407 { 1408 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1412 if (!lastRModuleIssueTypesCriteria.equals(criteria)) 1413 { 1414 collRModuleIssueTypes = RModuleIssueTypePeer.doSelect(criteria); 1415 } 1416 } 1417 } 1418 lastRModuleIssueTypesCriteria = criteria; 1419 1420 return collRModuleIssueTypes; 1421 } 1422 1423 1431 public List getRModuleIssueTypes(Connection con) throws TorqueException 1432 { 1433 if (collRModuleIssueTypes == null) 1434 { 1435 collRModuleIssueTypes = getRModuleIssueTypes(new Criteria(10),con); 1436 } 1437 return collRModuleIssueTypes; 1438 } 1439 1440 1452 public List getRModuleIssueTypes(Criteria criteria,Connection con) throws TorqueException 1453 { 1454 if (collRModuleIssueTypes == null) 1455 { 1456 if (isNew()) 1457 { 1458 collRModuleIssueTypes = new ArrayList (); 1459 } 1460 else 1461 { 1462 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1463 collRModuleIssueTypes = RModuleIssueTypePeer.doSelect(criteria,con); 1464 } 1465 } 1466 else 1467 { 1468 if (!isNew()) 1470 { 1471 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1475 if (!lastRModuleIssueTypesCriteria.equals(criteria)) 1476 { 1477 collRModuleIssueTypes = RModuleIssueTypePeer.doSelect(criteria,con); 1478 } 1479 } 1480 } 1481 lastRModuleIssueTypesCriteria = criteria; 1482 1483 return collRModuleIssueTypes; 1484 } 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1507 protected List getRModuleIssueTypesJoinScarabModule(Criteria criteria) 1508 throws TorqueException 1509 { 1510 if (collRModuleIssueTypes == null) 1511 { 1512 if (isNew()) 1513 { 1514 collRModuleIssueTypes = new ArrayList (); 1515 } 1516 else 1517 { 1518 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1519 collRModuleIssueTypes = RModuleIssueTypePeer.doSelectJoinScarabModule(criteria); 1520 } 1521 } 1522 else 1523 { 1524 1528 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1529 if (!lastRModuleIssueTypesCriteria.equals(criteria)) 1530 { 1531 collRModuleIssueTypes = RModuleIssueTypePeer.doSelectJoinScarabModule(criteria); 1532 } 1533 } 1534 lastRModuleIssueTypesCriteria = criteria; 1535 1536 return collRModuleIssueTypes; 1537 } 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1558 protected List getRModuleIssueTypesJoinIssueType(Criteria criteria) 1559 throws TorqueException 1560 { 1561 if (collRModuleIssueTypes == null) 1562 { 1563 if (isNew()) 1564 { 1565 collRModuleIssueTypes = new ArrayList (); 1566 } 1567 else 1568 { 1569 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1570 collRModuleIssueTypes = RModuleIssueTypePeer.doSelectJoinIssueType(criteria); 1571 } 1572 } 1573 else 1574 { 1575 1579 criteria.add(RModuleIssueTypePeer.MODULE_ID, getModuleId() ); 1580 if (!lastRModuleIssueTypesCriteria.equals(criteria)) 1581 { 1582 collRModuleIssueTypes = RModuleIssueTypePeer.doSelectJoinIssueType(criteria); 1583 } 1584 } 1585 lastRModuleIssueTypesCriteria = criteria; 1586 1587 return collRModuleIssueTypes; 1588 } 1589 1590 1591 1592 1593 1594 1597 protected List collMITListItems; 1598 1599 1604 protected void initMITListItems() 1605 { 1606 if (collMITListItems == null) 1607 { 1608 collMITListItems = new ArrayList (); 1609 } 1610 } 1611 1612 1613 1620 public void addMITListItem(MITListItem l) throws TorqueException 1621 { 1622 getMITListItems().add(l); 1623 l.setModule((ScarabModule)this); 1624 } 1625 1626 1629 private Criteria lastMITListItemsCriteria = null; 1630 1631 1638 public List getMITListItems() throws TorqueException 1639 { 1640 if (collMITListItems == null) 1641 { 1642 collMITListItems = getMITListItems(new Criteria(10)); 1643 } 1644 return collMITListItems; 1645 } 1646 1647 1658 public List getMITListItems(Criteria criteria) throws TorqueException 1659 { 1660 if (collMITListItems == null) 1661 { 1662 if (isNew()) 1663 { 1664 collMITListItems = new ArrayList (); 1665 } 1666 else 1667 { 1668 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1669 collMITListItems = MITListItemPeer.doSelect(criteria); 1670 } 1671 } 1672 else 1673 { 1674 if (!isNew()) 1676 { 1677 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1681 if (!lastMITListItemsCriteria.equals(criteria)) 1682 { 1683 collMITListItems = MITListItemPeer.doSelect(criteria); 1684 } 1685 } 1686 } 1687 lastMITListItemsCriteria = criteria; 1688 1689 return collMITListItems; 1690 } 1691 1692 1700 public List getMITListItems(Connection con) throws TorqueException 1701 { 1702 if (collMITListItems == null) 1703 { 1704 collMITListItems = getMITListItems(new Criteria(10),con); 1705 } 1706 return collMITListItems; 1707 } 1708 1709 1721 public List getMITListItems(Criteria criteria,Connection con) throws TorqueException 1722 { 1723 if (collMITListItems == null) 1724 { 1725 if (isNew()) 1726 { 1727 collMITListItems = new ArrayList (); 1728 } 1729 else 1730 { 1731 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1732 collMITListItems = MITListItemPeer.doSelect(criteria,con); 1733 } 1734 } 1735 else 1736 { 1737 if (!isNew()) 1739 { 1740 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1744 if (!lastMITListItemsCriteria.equals(criteria)) 1745 { 1746 collMITListItems = MITListItemPeer.doSelect(criteria,con); 1747 } 1748 } 1749 } 1750 lastMITListItemsCriteria = criteria; 1751 1752 return collMITListItems; 1753 } 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1776 protected List getMITListItemsJoinMITList(Criteria criteria) 1777 throws TorqueException 1778 { 1779 if (collMITListItems == null) 1780 { 1781 if (isNew()) 1782 { 1783 collMITListItems = new ArrayList (); 1784 } 1785 else 1786 { 1787 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1788 collMITListItems = MITListItemPeer.doSelectJoinMITList(criteria); 1789 } 1790 } 1791 else 1792 { 1793 1797 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1798 if (!lastMITListItemsCriteria.equals(criteria)) 1799 { 1800 collMITListItems = MITListItemPeer.doSelectJoinMITList(criteria); 1801 } 1802 } 1803 lastMITListItemsCriteria = criteria; 1804 1805 return collMITListItems; 1806 } 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1827 protected List getMITListItemsJoinScarabModule(Criteria criteria) 1828 throws TorqueException 1829 { 1830 if (collMITListItems == null) 1831 { 1832 if (isNew()) 1833 { 1834 collMITListItems = new ArrayList (); 1835 } 1836 else 1837 { 1838 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1839 collMITListItems = MITListItemPeer.doSelectJoinScarabModule(criteria); 1840 } 1841 } 1842 else 1843 { 1844 1848 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1849 if (!lastMITListItemsCriteria.equals(criteria)) 1850 { 1851 collMITListItems = MITListItemPeer.doSelectJoinScarabModule(criteria); 1852 } 1853 } 1854 lastMITListItemsCriteria = criteria; 1855 1856 return collMITListItems; 1857 } 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1878 protected List getMITListItemsJoinIssueType(Criteria criteria) 1879 throws TorqueException 1880 { 1881 if (collMITListItems == null) 1882 { 1883 if (isNew()) 1884 { 1885 collMITListItems = new ArrayList (); 1886 } 1887 else 1888 { 1889 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1890 collMITListItems = MITListItemPeer.doSelectJoinIssueType(criteria); 1891 } 1892 } 1893 else 1894 { 1895 1899 criteria.add(MITListItemPeer.MODULE_ID, getModuleId() ); 1900 if (!lastMITListItemsCriteria.equals(criteria)) 1901 { 1902 collMITListItems = MITListItemPeer.doSelectJoinIssueType(criteria); 1903 } 1904 } 1905 lastMITListItemsCriteria = criteria; 1906 1907 return collMITListItems; 1908 } 1909 1910 1911 1912 1913 1914 1915 1916 1917 1920 protected List collRModuleAttributes; 1921 1922 1927 protected void initRModuleAttributes() 1928 { 1929 if (collRModuleAttributes == null) 1930 { 1931 collRModuleAttributes = new ArrayList (); 1932 } 1933 } 1934 1935 1936 1943 public void addRModuleAttribute(RModuleAttribute l) throws TorqueException 1944 { 1945 getRModuleAttributes().add(l); 1946 l.setModule((ScarabModule)this); 1947 } 1948 1949 1952 private Criteria lastRModuleAttributesCriteria = null; 1953 1954 1961 public List getRModuleAttributes() throws TorqueException 1962 { 1963 if (collRModuleAttributes == null) 1964 { 1965 collRModuleAttributes = getRModuleAttributes(new Criteria(10)); 1966 } 1967 return collRModuleAttributes; 1968 } 1969 1970 1981 public List getRModuleAttributes(Criteria criteria) throws TorqueException 1982 { 1983 if (collRModuleAttributes == null) 1984 { 1985 if (isNew()) 1986 { 1987 collRModuleAttributes = new ArrayList (); 1988 } 1989 else 1990 { 1991 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 1992 collRModuleAttributes = RModuleAttributePeer.doSelect(criteria); 1993 } 1994 } 1995 else 1996 { 1997 if (!isNew()) 1999 { 2000 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2004 if (!lastRModuleAttributesCriteria.equals(criteria)) 2005 { 2006 collRModuleAttributes = RModuleAttributePeer.doSelect(criteria); 2007 } 2008 } 2009 } 2010 lastRModuleAttributesCriteria = criteria; 2011 2012 return collRModuleAttributes; 2013 } 2014 2015 2023 public List getRModuleAttributes(Connection con) throws TorqueException 2024 { 2025 if (collRModuleAttributes == null) 2026 { 2027 collRModuleAttributes = getRModuleAttributes(new Criteria(10),con); 2028 } 2029 return collRModuleAttributes; 2030 } 2031 2032 2044 public List getRModuleAttributes(Criteria criteria,Connection con) throws TorqueException 2045 { 2046 if (collRModuleAttributes == null) 2047 { 2048 if (isNew()) 2049 { 2050 collRModuleAttributes = new ArrayList (); 2051 } 2052 else 2053 { 2054 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2055 collRModuleAttributes = RModuleAttributePeer.doSelect(criteria,con); 2056 } 2057 } 2058 else 2059 { 2060 if (!isNew()) 2062 { 2063 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2067 if (!lastRModuleAttributesCriteria.equals(criteria)) 2068 { 2069 collRModuleAttributes = RModuleAttributePeer.doSelect(criteria,con); 2070 } 2071 } 2072 } 2073 lastRModuleAttributesCriteria = criteria; 2074 2075 return collRModuleAttributes; 2076 } 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2099 protected List getRModuleAttributesJoinAttribute(Criteria criteria) 2100 throws TorqueException 2101 { 2102 if (collRModuleAttributes == null) 2103 { 2104 if (isNew()) 2105 { 2106 collRModuleAttributes = new ArrayList (); 2107 } 2108 else 2109 { 2110 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2111 collRModuleAttributes = RModuleAttributePeer.doSelectJoinAttribute(criteria); 2112 } 2113 } 2114 else 2115 { 2116 2120 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2121 if (!lastRModuleAttributesCriteria.equals(criteria)) 2122 { 2123 collRModuleAttributes = RModuleAttributePeer.doSelectJoinAttribute(criteria); 2124 } 2125 } 2126 lastRModuleAttributesCriteria = criteria; 2127 2128 return collRModuleAttributes; 2129 } 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2150 protected List getRModuleAttributesJoinScarabModule(Criteria criteria) 2151 throws TorqueException 2152 { 2153 if (collRModuleAttributes == null) 2154 { 2155 if (isNew()) 2156 { 2157 collRModuleAttributes = new ArrayList (); 2158 } 2159 else 2160 { 2161 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2162 collRModuleAttributes = RModuleAttributePeer.doSelectJoinScarabModule(criteria); 2163 } 2164 } 2165 else 2166 { 2167 2171 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2172 if (!lastRModuleAttributesCriteria.equals(criteria)) 2173 { 2174 collRModuleAttributes = RModuleAttributePeer.doSelectJoinScarabModule(criteria); 2175 } 2176 } 2177 lastRModuleAttributesCriteria = criteria; 2178 2179 return collRModuleAttributes; 2180 } 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2201 protected List getRModuleAttributesJoinIssueType(Criteria criteria) 2202 throws TorqueException 2203 { 2204 if (collRModuleAttributes == null) 2205 { 2206 if (isNew()) 2207 { 2208 collRModuleAttributes = new ArrayList (); 2209 } 2210 else 2211 { 2212 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2213 collRModuleAttributes = RModuleAttributePeer.doSelectJoinIssueType(criteria); 2214 } 2215 } 2216 else 2217 { 2218 2222 criteria.add(RModuleAttributePeer.MODULE_ID, getModuleId() ); 2223 if (!lastRModuleAttributesCriteria.equals(criteria)) 2224 { 2225 collRModuleAttributes = RModuleAttributePeer.doSelectJoinIssueType(criteria); 2226 } 2227 } 2228 lastRModuleAttributesCriteria = criteria; 2229 2230 return collRModuleAttributes; 2231 } 2232 2233 2234 2235 2236 2237 2240 protected List collRModuleOptions; 2241 2242 2247 protected void initRModuleOptions() 2248 { 2249 if (collRModuleOptions == null) 2250 { 2251 collRModuleOptions = new ArrayList (); 2252 } 2253 } 2254 2255 2256 2263 public void addRModuleOption(RModuleOption l) throws TorqueException 2264 { 2265 getRModuleOptions().add(l); 2266 l.setModule((ScarabModule)this); 2267 } 2268 2269 2272 private Criteria lastRModuleOptionsCriteria = null; 2273 2274 2281 public List getRModuleOptions() throws TorqueException 2282 { 2283 if (collRModuleOptions == null) 2284 { 2285 collRModuleOptions = getRModuleOptions(new Criteria(10)); 2286 } 2287 return collRModuleOptions; 2288 } 2289 2290 2301 public List getRModuleOptions(Criteria criteria) throws TorqueException 2302 { 2303 if (collRModuleOptions == null) 2304 { 2305 if (isNew()) 2306 { 2307 collRModuleOptions = new ArrayList (); 2308 } 2309 else 2310 { 2311 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2312 collRModuleOptions = RModuleOptionPeer.doSelect(criteria); 2313 } 2314 } 2315 else 2316 { 2317 if (!isNew()) 2319 { 2320 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2324 if (!lastRModuleOptionsCriteria.equals(criteria)) 2325 { 2326 collRModuleOptions = RModuleOptionPeer.doSelect(criteria); 2327 } 2328 } 2329 } 2330 lastRModuleOptionsCriteria = criteria; 2331 2332 return collRModuleOptions; 2333 } 2334 2335 2343 public List getRModuleOptions(Connection con) throws TorqueException 2344 { 2345 if (collRModuleOptions == null) 2346 { 2347 collRModuleOptions = getRModuleOptions(new Criteria(10),con); 2348 } 2349 return collRModuleOptions; 2350 } 2351 2352 2364 public List getRModuleOptions(Criteria criteria,Connection con) throws TorqueException 2365 { 2366 if (collRModuleOptions == null) 2367 { 2368 if (isNew()) 2369 { 2370 collRModuleOptions = new ArrayList (); 2371 } 2372 else 2373 { 2374 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2375 collRModuleOptions = RModuleOptionPeer.doSelect(criteria,con); 2376 } 2377 } 2378 else 2379 { 2380 if (!isNew()) 2382 { 2383 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2387 if (!lastRModuleOptionsCriteria.equals(criteria)) 2388 { 2389 collRModuleOptions = RModuleOptionPeer.doSelect(criteria,con); 2390 } 2391 } 2392 } 2393 lastRModuleOptionsCriteria = criteria; 2394 2395 return collRModuleOptions; 2396 } 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2419 protected List getRModuleOptionsJoinAttributeOption(Criteria criteria) 2420 throws TorqueException 2421 { 2422 if (collRModuleOptions == null) 2423 { 2424 if (isNew()) 2425 { 2426 collRModuleOptions = new ArrayList (); 2427 } 2428 else 2429 { 2430 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2431 collRModuleOptions = RModuleOptionPeer.doSelectJoinAttributeOption(criteria); 2432 } 2433 } 2434 else 2435 { 2436 2440 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2441 if (!lastRModuleOptionsCriteria.equals(criteria)) 2442 { 2443 collRModuleOptions = RModuleOptionPeer.doSelectJoinAttributeOption(criteria); 2444 } 2445 } 2446 lastRModuleOptionsCriteria = criteria; 2447 2448 return collRModuleOptions; 2449 } 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2470 protected List getRModuleOptionsJoinScarabModule(Criteria criteria) 2471 throws TorqueException 2472 { 2473 if (collRModuleOptions == null) 2474 { 2475 if (isNew()) 2476 { 2477 collRModuleOptions = new ArrayList (); 2478 } 2479 else 2480 { 2481 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2482 collRModuleOptions = RModuleOptionPeer.doSelectJoinScarabModule(criteria); 2483 } 2484 } 2485 else 2486 { 2487 2491 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2492 if (!lastRModuleOptionsCriteria.equals(criteria)) 2493 { 2494 collRModuleOptions = RModuleOptionPeer.doSelectJoinScarabModule(criteria); 2495 } 2496 } 2497 lastRModuleOptionsCriteria = criteria; 2498 2499 return collRModuleOptions; 2500 } 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2521 protected List getRModuleOptionsJoinIssueType(Criteria criteria) 2522 throws TorqueException 2523 { 2524 if (collRModuleOptions == null) 2525 { 2526 if (isNew()) 2527 { 2528 collRModuleOptions = new ArrayList (); 2529 } 2530 else 2531 { 2532 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2533 collRModuleOptions = RModuleOptionPeer.doSelectJoinIssueType(criteria); 2534 } 2535 } 2536 else 2537 { 2538 2542 criteria.add(RModuleOptionPeer.MODULE_ID, getModuleId() ); 2543 if (!lastRModuleOptionsCriteria.equals(criteria)) 2544 { 2545 collRModuleOptions = RModuleOptionPeer.doSelectJoinIssueType(criteria); 2546 } 2547 } 2548 lastRModuleOptionsCriteria = criteria; 2549 2550 return collRModuleOptions; 2551 } 2552 2553 2554 2555 2556 2557 2560 protected List collRModuleUserAttributes; 2561 2562 2567 protected void initRModuleUserAttributes() 2568 { 2569 if (collRModuleUserAttributes == null) 2570 { 2571 collRModuleUserAttributes = new ArrayList (); 2572 } 2573 } 2574 2575 2576 2583 public void addRModuleUserAttribute(RModuleUserAttribute l) throws TorqueException 2584 { 2585 getRModuleUserAttributes().add(l); 2586 l.setModule((ScarabModule)this); 2587 } 2588 2589 2592 private Criteria lastRModuleUserAttributesCriteria = null; 2593 2594 2601 public List getRModuleUserAttributes() throws TorqueException 2602 { 2603 if (collRModuleUserAttributes == null) 2604 { 2605 collRModuleUserAttributes = getRModuleUserAttributes(new Criteria(10)); 2606 } 2607 return collRModuleUserAttributes; 2608 } 2609 2610 2621 public List getRModuleUserAttributes(Criteria criteria) throws TorqueException 2622 { 2623 if (collRModuleUserAttributes == null) 2624 { 2625 if (isNew()) 2626 { 2627 collRModuleUserAttributes = new ArrayList (); 2628 } 2629 else 2630 { 2631 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2632 collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria); 2633 } 2634 } 2635 else 2636 { 2637 if (!isNew()) 2639 { 2640 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2644 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2645 { 2646 collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria); 2647 } 2648 } 2649 } 2650 lastRModuleUserAttributesCriteria = criteria; 2651 2652 return collRModuleUserAttributes; 2653 } 2654 2655 2663 public List getRModuleUserAttributes(Connection con) throws TorqueException 2664 { 2665 if (collRModuleUserAttributes == null) 2666 { 2667 collRModuleUserAttributes = getRModuleUserAttributes(new Criteria(10),con); 2668 } 2669 return collRModuleUserAttributes; 2670 } 2671 2672 2684 public List getRModuleUserAttributes(Criteria criteria,Connection con) throws TorqueException 2685 { 2686 if (collRModuleUserAttributes == null) 2687 { 2688 if (isNew()) 2689 { 2690 collRModuleUserAttributes = new ArrayList (); 2691 } 2692 else 2693 { 2694 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2695 collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria,con); 2696 } 2697 } 2698 else 2699 { 2700 if (!isNew()) 2702 { 2703 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2707 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2708 { 2709 collRModuleUserAttributes = RModuleUserAttributePeer.doSelect(criteria,con); 2710 } 2711 } 2712 } 2713 lastRModuleUserAttributesCriteria = criteria; 2714 2715 return collRModuleUserAttributes; 2716 } 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2739 protected List getRModuleUserAttributesJoinMITList(Criteria criteria) 2740 throws TorqueException 2741 { 2742 if (collRModuleUserAttributes == null) 2743 { 2744 if (isNew()) 2745 { 2746 collRModuleUserAttributes = new ArrayList (); 2747 } 2748 else 2749 { 2750 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2751 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinMITList(criteria); 2752 } 2753 } 2754 else 2755 { 2756 2760 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2761 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2762 { 2763 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinMITList(criteria); 2764 } 2765 } 2766 lastRModuleUserAttributesCriteria = criteria; 2767 2768 return collRModuleUserAttributes; 2769 } 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2790 protected List getRModuleUserAttributesJoinScarabModule(Criteria criteria) 2791 throws TorqueException 2792 { 2793 if (collRModuleUserAttributes == null) 2794 { 2795 if (isNew()) 2796 { 2797 collRModuleUserAttributes = new ArrayList (); 2798 } 2799 else 2800 { 2801 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2802 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabModule(criteria); 2803 } 2804 } 2805 else 2806 { 2807 2811 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2812 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2813 { 2814 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabModule(criteria); 2815 } 2816 } 2817 lastRModuleUserAttributesCriteria = criteria; 2818 2819 return collRModuleUserAttributes; 2820 } 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2841 protected List getRModuleUserAttributesJoinScarabUserImpl(Criteria criteria) 2842 throws TorqueException 2843 { 2844 if (collRModuleUserAttributes == null) 2845 { 2846 if (isNew()) 2847 { 2848 collRModuleUserAttributes = new ArrayList (); 2849 } 2850 else 2851 { 2852 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2853 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabUserImpl(criteria); 2854 } 2855 } 2856 else 2857 { 2858 2862 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2863 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2864 { 2865 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinScarabUserImpl(criteria); 2866 } 2867 } 2868 lastRModuleUserAttributesCriteria = criteria; 2869 2870 return collRModuleUserAttributes; 2871 } 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2892 protected List getRModuleUserAttributesJoinIssueType(Criteria criteria) 2893 throws TorqueException 2894 { 2895 if (collRModuleUserAttributes == null) 2896 { 2897 if (isNew()) 2898 { 2899 collRModuleUserAttributes = new ArrayList (); 2900 } 2901 else 2902 { 2903 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2904 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinIssueType(criteria); 2905 } 2906 } 2907 else 2908 { 2909 2913 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2914 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2915 { 2916 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinIssueType(criteria); 2917 } 2918 } 2919 lastRModuleUserAttributesCriteria = criteria; 2920 2921 return collRModuleUserAttributes; 2922 } 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2943 protected List getRModuleUserAttributesJoinAttribute(Criteria criteria) 2944 throws TorqueException 2945 { 2946 if (collRModuleUserAttributes == null) 2947 { 2948 if (isNew()) 2949 { 2950 collRModuleUserAttributes = new ArrayList (); 2951 } 2952 else 2953 { 2954 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2955 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinAttribute(criteria); 2956 } 2957 } 2958 else 2959 { 2960 2964 criteria.add(RModuleUserAttributePeer.MODULE_ID, getModuleId() ); 2965 if (!lastRModuleUserAttributesCriteria.equals(criteria)) 2966 { 2967 collRModuleUserAttributes = RModuleUserAttributePeer.doSelectJoinAttribute(criteria); 2968 } 2969 } 2970 lastRModuleUserAttributesCriteria = criteria; 2971 2972 return collRModuleUserAttributes; 2973 } 2974 2975 2976 2977 2978 2979 2982 protected List collUserVotes; 2983 2984 2989 protected void initUserVotes() 2990 { 2991 if (collUserVotes == null) 2992 { 2993 collUserVotes = new ArrayList (); 2994 } 2995 } 2996 2997 2998 3005 public void addUserVote(UserVote l) throws TorqueException 3006 { 3007 getUserVotes().add(l); 3008 l.setModule((ScarabModule)this); 3009 } 3010 3011 3014 private Criteria lastUserVotesCriteria = null; 3015 3016 3023 public List getUserVotes() throws TorqueException 3024 { 3025 if (collUserVotes == null) 3026 { 3027 collUserVotes = getUserVotes(new Criteria(10)); 3028 } 3029 return collUserVotes; 3030 } 3031 3032 3043 public List getUserVotes(Criteria criteria) throws TorqueException 3044 { 3045 if (collUserVotes == null) 3046 { 3047 if (isNew()) 3048 { 3049 collUserVotes = new ArrayList (); 3050 } 3051 else 3052 { 3053 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3054 collUserVotes = UserVotePeer.doSelect(criteria); 3055 } 3056 } 3057 else 3058 { 3059 if (!isNew()) 3061 { 3062 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3066 if (!lastUserVotesCriteria.equals(criteria)) 3067 { 3068 collUserVotes = UserVotePeer.doSelect(criteria); 3069 } 3070 } 3071 } 3072 lastUserVotesCriteria = criteria; 3073 3074 return collUserVotes; 3075 } 3076 3077 3085 public List getUserVotes(Connection con) throws TorqueException 3086 { 3087 if (collUserVotes == null) 3088 { 3089 collUserVotes = getUserVotes(new Criteria(10),con); 3090 } 3091 return collUserVotes; 3092 } 3093 3094 3106 public List getUserVotes(Criteria criteria,Connection con) throws TorqueException 3107 { 3108 if (collUserVotes == null) 3109 { 3110 if (isNew()) 3111 { 3112 collUserVotes = new ArrayList (); 3113 } 3114 else 3115 { 3116 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3117 collUserVotes = UserVotePeer.doSelect(criteria,con); 3118 } 3119 } 3120 else 3121 { 3122 if (!isNew()) 3124 { 3125 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3129 if (!lastUserVotesCriteria.equals(criteria)) 3130 { 3131 collUserVotes = UserVotePeer.doSelect(criteria,con); 3132 } 3133 } 3134 } 3135 lastUserVotesCriteria = criteria; 3136 3137 return collUserVotes; 3138 } 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3161 protected List getUserVotesJoinScarabModule(Criteria criteria) 3162 throws TorqueException 3163 { 3164 if (collUserVotes == null) 3165 { 3166 if (isNew()) 3167 { 3168 collUserVotes = new ArrayList (); 3169 } 3170 else 3171 { 3172 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3173 collUserVotes = UserVotePeer.doSelectJoinScarabModule(criteria); 3174 } 3175 } 3176 else 3177 { 3178 3182 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3183 if (!lastUserVotesCriteria.equals(criteria)) 3184 { 3185 collUserVotes = UserVotePeer.doSelectJoinScarabModule(criteria); 3186 } 3187 } 3188 lastUserVotesCriteria = criteria; 3189 3190 return collUserVotes; 3191 } 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3212 protected List getUserVotesJoinScarabUserImpl(Criteria criteria) 3213 throws TorqueException 3214 { 3215 if (collUserVotes == null) 3216 { 3217 if (isNew()) 3218 { 3219 collUserVotes = new ArrayList (); 3220 } 3221 else 3222 { 3223 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3224 collUserVotes = UserVotePeer.doSelectJoinScarabUserImpl(criteria); 3225 } 3226 } 3227 else 3228 { 3229 3233 criteria.add(UserVotePeer.MODULE_ID, getModuleId() ); 3234 if (!lastUserVotesCriteria.equals(criteria)) 3235 { 3236 collUserVotes = UserVotePeer.doSelectJoinScarabUserImpl(criteria); 3237 } 3238 } 3239 lastUserVotesCriteria = criteria; 3240 3241 return collUserVotes; 3242 } 3243 3244 3245 3246 3247 3248 3251 protected List collQuerys; 3252 3253 3258 protected void initQuerys() 3259 { 3260 if (collQuerys == null) 3261 { 3262 collQuerys = new ArrayList (); 3263 } 3264 } 3265 3266 3267 3274 public void addQuery(Query l) throws TorqueException 3275 { 3276 getQuerys().add(l); 3277 l.setModule((ScarabModule)this); 3278 } 3279 3280 3283 private Criteria lastQuerysCriteria = null; 3284 3285 3292 public List getQuerys() throws TorqueException 3293 { 3294 if (collQuerys == null) 3295 { 3296 collQuerys = getQuerys(new Criteria(10)); 3297 } 3298 return collQuerys; 3299 } 3300 3301 3312 public List getQuerys(Criteria criteria) throws TorqueException 3313 { 3314 if (collQuerys == null) 3315 { 3316 if (isNew()) 3317 { 3318 collQuerys = new ArrayList (); 3319 } 3320 else 3321 { 3322 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3323 collQuerys = QueryPeer.doSelect(criteria); 3324 } 3325 } 3326 else 3327 { 3328 if (!isNew()) 3330 { 3331 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3335 if (!lastQuerysCriteria.equals(criteria)) 3336 { 3337 collQuerys = QueryPeer.doSelect(criteria); 3338 } 3339 } 3340 } 3341 lastQuerysCriteria = criteria; 3342 3343 return collQuerys; 3344 } 3345 3346 3354 public List getQuerys(Connection con) throws TorqueException 3355 { 3356 if (collQuerys == null) 3357 { 3358 collQuerys = getQuerys(new Criteria(10),con); 3359 } 3360 return collQuerys; 3361 } 3362 3363 3375 public List getQuerys(Criteria criteria,Connection con) throws TorqueException 3376 { 3377 if (collQuerys == null) 3378 { 3379 if (isNew()) 3380 { 3381 collQuerys = new ArrayList (); 3382 } 3383 else 3384 { 3385 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3386 collQuerys = QueryPeer.doSelect(criteria,con); 3387 } 3388 } 3389 else 3390 { 3391 if (!isNew()) 3393 { 3394 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3398 if (!lastQuerysCriteria.equals(criteria)) 3399 { 3400 collQuerys = QueryPeer.doSelect(criteria,con); 3401 } 3402 } 3403 } 3404 lastQuerysCriteria = criteria; 3405 3406 return collQuerys; 3407 } 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3430 protected List getQuerysJoinScarabUserImpl(Criteria criteria) 3431 throws TorqueException 3432 { 3433 if (collQuerys == null) 3434 { 3435 if (isNew()) 3436 { 3437 collQuerys = new ArrayList (); 3438 } 3439 else 3440 { 3441 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3442 collQuerys = QueryPeer.doSelectJoinScarabUserImpl(criteria); 3443 } 3444 } 3445 else 3446 { 3447 3451 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3452 if (!lastQuerysCriteria.equals(criteria)) 3453 { 3454 collQuerys = QueryPeer.doSelectJoinScarabUserImpl(criteria); 3455 } 3456 } 3457 lastQuerysCriteria = criteria; 3458 3459 return collQuerys; 3460 } 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3481 protected List getQuerysJoinScope(Criteria criteria) 3482 throws TorqueException 3483 { 3484 if (collQuerys == null) 3485 { 3486 if (isNew()) 3487 { 3488 collQuerys = new ArrayList (); 3489 } 3490 else 3491 { 3492 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3493 collQuerys = QueryPeer.doSelectJoinScope(criteria); 3494 } 3495 } 3496 else 3497 { 3498 3502 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3503 if (!lastQuerysCriteria.equals(criteria)) 3504 { 3505 collQuerys = QueryPeer.doSelectJoinScope(criteria); 3506 } 3507 } 3508 lastQuerysCriteria = criteria; 3509 3510 return collQuerys; 3511 } 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3532 protected List getQuerysJoinScarabModule(Criteria criteria) 3533 throws TorqueException 3534 { 3535 if (collQuerys == null) 3536 { 3537 if (isNew()) 3538 { 3539 collQuerys = new ArrayList (); 3540 } 3541 else 3542 { 3543 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3544 collQuerys = QueryPeer.doSelectJoinScarabModule(criteria); 3545 } 3546 } 3547 else 3548 { 3549 3553 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3554 if (!lastQuerysCriteria.equals(criteria)) 3555 { 3556 collQuerys = QueryPeer.doSelectJoinScarabModule(criteria); 3557 } 3558 } 3559 lastQuerysCriteria = criteria; 3560 3561 return collQuerys; 3562 } 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3583 protected List getQuerysJoinIssueType(Criteria criteria) 3584 throws TorqueException 3585 { 3586 if (collQuerys == null) 3587 { 3588 if (isNew()) 3589 { 3590 collQuerys = new ArrayList (); 3591 } 3592 else 3593 { 3594 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3595 collQuerys = QueryPeer.doSelectJoinIssueType(criteria); 3596 } 3597 } 3598 else 3599 { 3600 3604 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3605 if (!lastQuerysCriteria.equals(criteria)) 3606 { 3607 collQuerys = QueryPeer.doSelectJoinIssueType(criteria); 3608 } 3609 } 3610 lastQuerysCriteria = criteria; 3611 3612 return collQuerys; 3613 } 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3634 protected List getQuerysJoinMITList(Criteria criteria) 3635 throws TorqueException 3636 { 3637 if (collQuerys == null) 3638 { 3639 if (isNew()) 3640 { 3641 collQuerys = new ArrayList (); 3642 } 3643 else 3644 { 3645 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3646 collQuerys = QueryPeer.doSelectJoinMITList(criteria); 3647 } 3648 } 3649 else 3650 { 3651 3655 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3656 if (!lastQuerysCriteria.equals(criteria)) 3657 { 3658 collQuerys = QueryPeer.doSelectJoinMITList(criteria); 3659 } 3660 } 3661 lastQuerysCriteria = criteria; 3662 3663 return collQuerys; 3664 } 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3685 protected List getQuerysJoinFrequency(Criteria criteria) 3686 throws TorqueException 3687 { 3688 if (collQuerys == null) 3689 { 3690 if (isNew()) 3691 { 3692 collQuerys = new ArrayList (); 3693 } 3694 else 3695 { 3696 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3697 collQuerys = QueryPeer.doSelectJoinFrequency(criteria); 3698 } 3699 } 3700 else 3701 { 3702 3706 criteria.add(QueryPeer.MODULE_ID, getModuleId() ); 3707 if (!lastQuerysCriteria.equals(criteria)) 3708 { 3709 collQuerys = QueryPeer.doSelectJoinFrequency(criteria); 3710 } 3711 } 3712 lastQuerysCriteria = criteria; 3713 3714 return collQuerys; 3715 } 3716 3717 3718 3719 3720 3721 3724 protected List collReports; 3725 3726 3731 protected void initReports() 3732 { 3733 if (collReports == null) 3734 { 3735 collReports = new ArrayList (); 3736 } 3737 } 3738 3739 3740 3747 public void addReport(Report l) throws TorqueException 3748 { 3749 getReports().add(l); 3750 l.setModule((ScarabModule)this); 3751 } 3752 3753 3756 private Criteria lastReportsCriteria = null; 3757 3758 3765 public List getReports() throws TorqueException 3766 { 3767 if (collReports == null) 3768 { 3769 collReports = getReports(new Criteria(10)); 3770 } 3771 return collReports; 3772 } 3773 3774 3785 public List getReports(Criteria criteria) throws TorqueException 3786 { 3787 if (collReports == null) 3788 { 3789 if (isNew()) 3790 { 3791 collReports = new ArrayList (); 3792 } 3793 else 3794 { 3795 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3796 collReports = ReportPeer.doSelect(criteria); 3797 } 3798 } 3799 else 3800 { 3801 if (!isNew()) 3803 { 3804 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3808 if (!lastReportsCriteria.equals(criteria)) 3809 { 3810 collReports = ReportPeer.doSelect(criteria); 3811 } 3812 } 3813 } 3814 lastReportsCriteria = criteria; 3815 3816 return collReports; 3817 } 3818 3819 3827 public List getReports(Connection con) throws TorqueException 3828 { 3829 if (collReports == null) 3830 { 3831 collReports = getReports(new Criteria(10),con); 3832 } 3833 return collReports; 3834 } 3835 3836 3848 public List getReports(Criteria criteria,Connection con) throws TorqueException 3849 { 3850 if (collReports == null) 3851 { 3852 if (isNew()) 3853 { 3854 collReports = new ArrayList (); 3855 } 3856 else 3857 { 3858 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3859 collReports = ReportPeer.doSelect(criteria,con); 3860 } 3861 } 3862 else 3863 { 3864 if (!isNew()) 3866 { 3867 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3871 if (!lastReportsCriteria.equals(criteria)) 3872 { 3873 collReports = ReportPeer.doSelect(criteria,con); 3874 } 3875 } 3876 } 3877 lastReportsCriteria = criteria; 3878 3879 return collReports; 3880 } 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3903 protected List getReportsJoinIssueType(Criteria criteria) 3904 throws TorqueException 3905 { 3906 if (collReports == null) 3907 { 3908 if (isNew()) 3909 { 3910 collReports = new ArrayList (); 3911 } 3912 else 3913 { 3914 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3915 collReports = ReportPeer.doSelectJoinIssueType(criteria); 3916 } 3917 } 3918 else 3919 { 3920 3924 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3925 if (!lastReportsCriteria.equals(criteria)) 3926 { 3927 collReports = ReportPeer.doSelectJoinIssueType(criteria); 3928 } 3929 } 3930 lastReportsCriteria = criteria; 3931 3932 return collReports; 3933 } 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3954 protected List getReportsJoinScarabUserImpl(Criteria criteria) 3955 throws TorqueException 3956 { 3957 if (collReports == null) 3958 { 3959 if (isNew()) 3960 { 3961 collReports = new ArrayList (); 3962 } 3963 else 3964 { 3965 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3966 collReports = ReportPeer.doSelectJoinScarabUserImpl(criteria); 3967 } 3968 } 3969 else 3970 { 3971 3975 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 3976 if (!lastReportsCriteria.equals(criteria)) 3977 { 3978 collReports = ReportPeer.doSelectJoinScarabUserImpl(criteria); 3979 } 3980 } 3981 lastReportsCriteria = criteria; 3982 3983 return collReports; 3984 } 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 4005 protected List getReportsJoinScarabModule(Criteria criteria) 4006 throws TorqueException 4007 { 4008 if (collReports == null) 4009 { 4010 if (isNew()) 4011 { 4012 collReports = new ArrayList (); 4013 } 4014 else 4015 { 4016 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 4017 collReports = ReportPeer.doSelectJoinScarabModule(criteria); 4018 } 4019 } 4020 else 4021 { 4022 4026 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 4027 if (!lastReportsCriteria.equals(criteria)) 4028 { 4029 collReports = ReportPeer.doSelectJoinScarabModule(criteria); 4030 } 4031 } 4032 lastReportsCriteria = criteria; 4033 4034 return collReports; 4035 } 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4056 protected List getReportsJoinScope(Criteria criteria) 4057 throws TorqueException 4058 { 4059 if (collReports == null) 4060 { 4061 if (isNew()) 4062 { 4063 collReports = new ArrayList (); 4064 } 4065 else 4066 { 4067 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 4068 collReports = ReportPeer.doSelectJoinScope(criteria); 4069 } 4070 } 4071 else 4072 { 4073 4077 criteria.add(ReportPeer.MODULE_ID, getModuleId() ); 4078 if (!lastReportsCriteria.equals(criteria)) 4079 { 4080 collReports = ReportPeer.doSelectJoinScope(criteria); 4081 } 4082 } 4083 lastReportsCriteria = criteria; 4084 4085 return collReports; 4086 } 4087 4088 4089 4090 4091 4092 4095 protected List collPendingGroupUserRoles; 4096 4097 4102 protected void initPendingGroupUserRoles() 4103 { 4104 if (collPendingGroupUserRoles == null) 4105 { 4106 collPendingGroupUserRoles = new ArrayList (); 4107 } 4108 } 4109 4110 4111 4118 public void addPendingGroupUserRole(PendingGroupUserRole l) throws TorqueException 4119 { 4120 getPendingGroupUserRoles().add(l); 4121 l.setModule((ScarabModule)this); 4122 } 4123 4124 4127 private Criteria lastPendingGroupUserRolesCriteria = null; 4128 4129 4136 public List getPendingGroupUserRoles() throws TorqueException 4137 { 4138 if (collPendingGroupUserRoles == null) 4139 { 4140 collPendingGroupUserRoles = getPendingGroupUserRoles(new Criteria(10)); 4141 } 4142 return collPendingGroupUserRoles; 4143 } 4144 4145 4156 public List getPendingGroupUserRoles(Criteria criteria) throws TorqueException 4157 { 4158 if (collPendingGroupUserRoles == null) 4159 { 4160 if (isNew()) 4161 { 4162 collPendingGroupUserRoles = new ArrayList (); 4163 } 4164 else 4165 { 4166 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4167 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelect(criteria); 4168 } 4169 } 4170 else 4171 { 4172 if (!isNew()) 4174 { 4175 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4179 if (!lastPendingGroupUserRolesCriteria.equals(criteria)) 4180 { 4181 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelect(criteria); 4182 } 4183 } 4184 } 4185 lastPendingGroupUserRolesCriteria = criteria; 4186 4187 return collPendingGroupUserRoles; 4188 } 4189 4190 4198 public List getPendingGroupUserRoles(Connection con) throws TorqueException 4199 { 4200 if (collPendingGroupUserRoles == null) 4201 { 4202 collPendingGroupUserRoles = getPendingGroupUserRoles(new Criteria(10),con); 4203 } 4204 return collPendingGroupUserRoles; 4205 } 4206 4207 4219 public List getPendingGroupUserRoles(Criteria criteria,Connection con) throws TorqueException 4220 { 4221 if (collPendingGroupUserRoles == null) 4222 { 4223 if (isNew()) 4224 { 4225 collPendingGroupUserRoles = new ArrayList (); 4226 } 4227 else 4228 { 4229 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4230 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelect(criteria,con); 4231 } 4232 } 4233 else 4234 { 4235 if (!isNew()) 4237 { 4238 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4242 if (!lastPendingGroupUserRolesCriteria.equals(criteria)) 4243 { 4244 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelect(criteria,con); 4245 } 4246 } 4247 } 4248 lastPendingGroupUserRolesCriteria = criteria; 4249 4250 return collPendingGroupUserRoles; 4251 } 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4274 protected List getPendingGroupUserRolesJoinScarabUserImpl(Criteria criteria) 4275 throws TorqueException 4276 { 4277 if (collPendingGroupUserRoles == null) 4278 { 4279 if (isNew()) 4280 { 4281 collPendingGroupUserRoles = new ArrayList (); 4282 } 4283 else 4284 { 4285 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4286 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelectJoinScarabUserImpl(criteria); 4287 } 4288 } 4289 else 4290 { 4291 4295 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4296 if (!lastPendingGroupUserRolesCriteria.equals(criteria)) 4297 { 4298 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelectJoinScarabUserImpl(criteria); 4299 } 4300 } 4301 lastPendingGroupUserRolesCriteria = criteria; 4302 4303 return collPendingGroupUserRoles; 4304 } 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4325 protected List getPendingGroupUserRolesJoinScarabModule(Criteria criteria) 4326 throws TorqueException 4327 { 4328 if (collPendingGroupUserRoles == null) 4329 { 4330 if (isNew()) 4331 { 4332 collPendingGroupUserRoles = new ArrayList (); 4333 } 4334 else 4335 { 4336 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4337 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelectJoinScarabModule(criteria); 4338 } 4339 } 4340 else 4341 { 4342 4346 criteria.add(PendingGroupUserRolePeer.GROUP_ID, getModuleId() ); 4347 if (!lastPendingGroupUserRolesCriteria.equals(criteria)) 4348 { 4349 collPendingGroupUserRoles = PendingGroupUserRolePeer.doSelectJoinScarabModule(criteria); 4350 } 4351 } 4352 lastPendingGroupUserRolesCriteria = criteria; 4353 4354 return collPendingGroupUserRoles; 4355 } 4356 4357 4358 4359 4360 4361 4364 protected List collGlobalParameters; 4365 4366 4371 protected void initGlobalParameters() 4372 { 4373 if (collGlobalParameters == null) 4374 { 4375 collGlobalParameters = new ArrayList (); 4376 } 4377 } 4378 4379 4380 4387 public void addGlobalParameter(GlobalParameter l) throws TorqueException 4388 { 4389 getGlobalParameters().add(l); 4390 l.setModule((ScarabModule)this); 4391 } 4392 4393 4396 private Criteria lastGlobalParametersCriteria = null; 4397 4398 4405 public List getGlobalParameters() throws TorqueException 4406 { 4407 if (collGlobalParameters == null) 4408 { 4409 collGlobalParameters = getGlobalParameters(new Criteria(10)); 4410 } 4411 return collGlobalParameters; 4412 } 4413 4414 4425 public List getGlobalParameters(Criteria criteria) throws TorqueException 4426 { 4427 if (collGlobalParameters == null) 4428 { 4429 if (isNew()) 4430 { 4431 collGlobalParameters = new ArrayList (); 4432 } 4433 else 4434 { 4435 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4436 collGlobalParameters = GlobalParameterPeer.doSelect(criteria); 4437 } 4438 } 4439 else 4440 { 4441 if (!isNew()) 4443 { 4444 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4448 if (!lastGlobalParametersCriteria.equals(criteria)) 4449 { 4450 collGlobalParameters = GlobalParameterPeer.doSelect(criteria); 4451 } 4452 } 4453 } 4454 lastGlobalParametersCriteria = criteria; 4455 4456 return collGlobalParameters; 4457 } 4458 4459 4467 public List getGlobalParameters(Connection con) throws TorqueException 4468 { 4469 if (collGlobalParameters == null) 4470 { 4471 collGlobalParameters = getGlobalParameters(new Criteria(10),con); 4472 } 4473 return collGlobalParameters; 4474 } 4475 4476 4488 public List getGlobalParameters(Criteria criteria,Connection con) throws TorqueException 4489 { 4490 if (collGlobalParameters == null) 4491 { 4492 if (isNew()) 4493 { 4494 collGlobalParameters = new ArrayList (); 4495 } 4496 else 4497 { 4498 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4499 collGlobalParameters = GlobalParameterPeer.doSelect(criteria,con); 4500 } 4501 } 4502 else 4503 { 4504 if (!isNew()) 4506 { 4507 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4511 if (!lastGlobalParametersCriteria.equals(criteria)) 4512 { 4513 collGlobalParameters = GlobalParameterPeer.doSelect(criteria,con); 4514 } 4515 } 4516 } 4517 lastGlobalParametersCriteria = criteria; 4518 4519 return collGlobalParameters; 4520 } 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4543 protected List getGlobalParametersJoinScarabModule(Criteria criteria) 4544 throws TorqueException 4545 { 4546 if (collGlobalParameters == null) 4547 { 4548 if (isNew()) 4549 { 4550 collGlobalParameters = new ArrayList (); 4551 } 4552 else 4553 { 4554 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4555 collGlobalParameters = GlobalParameterPeer.doSelectJoinScarabModule(criteria); 4556 } 4557 } 4558 else 4559 { 4560 4564 criteria.add(GlobalParameterPeer.MODULE_ID, getModuleId() ); 4565 if (!lastGlobalParametersCriteria.equals(criteria)) 4566 { 4567 collGlobalParameters = GlobalParameterPeer.doSelectJoinScarabModule(criteria); 4568 } 4569 } 4570 lastGlobalParametersCriteria = criteria; 4571 4572 return collGlobalParameters; 4573 } 4574 4575 4576 4577 4578 private static List fieldNames = null; 4579 4580 4585 public static synchronized List getFieldNames() 4586 { 4587 if (fieldNames == null) 4588 { 4589 fieldNames = new ArrayList (); 4590 fieldNames.add("ModuleId"); 4591 fieldNames.add("RealName"); 4592 fieldNames.add("Domain"); 4593 fieldNames.add("Code"); 4594 fieldNames.add("Description"); 4595 fieldNames.add("Url"); 4596 fieldNames.add("ArchiveEmail"); 4597 fieldNames.add("ParentId"); 4598 fieldNames.add("OwnerId"); 4599 fieldNames.add("QaContactId"); 4600 fieldNames.add("Deleted"); 4601 fieldNames.add("Locked"); 4602 fieldNames.add("ClassKey"); 4603 fieldNames = Collections.unmodifiableList(fieldNames); 4604 } 4605 return fieldNames; 4606 } 4607 4608 4614 public Object getByName(String name) 4615 { 4616 if (name.equals("ModuleId")) 4617 { 4618 return getModuleId(); 4619 } 4620 if (name.equals("RealName")) 4621 { 4622 return getRealName(); 4623 } 4624 if (name.equals("Domain")) 4625 { 4626 return getDomain(); 4627 } 4628 if (name.equals("Code")) 4629 { 4630 return getCode(); 4631 } 4632 if (name.equals("Description")) 4633 { 4634 return getDescription(); 4635 } 4636 if (name.equals("Url")) 4637 { 4638 return getUrl(); 4639 } 4640 if (name.equals("ArchiveEmail")) 4641 { 4642 return getArchiveEmail(); 4643 } 4644 if (name.equals("ParentId")) 4645 { 4646 return getParentId(); 4647 } 4648 if (name.equals("OwnerId")) 4649 { 4650 return getOwnerId(); 4651 } 4652 if (name.equals("QaContactId")) 4653 { 4654 return getQaContactId(); 4655 } 4656 if (name.equals("Deleted")) 4657 { 4658 return Boolean.valueOf(getDeleted()); 4659 } 4660 if (name.equals("Locked")) 4661 { 4662 return Boolean.valueOf(getLocked()); 4663 } 4664 if (name.equals("ClassKey")) 4665 { 4666 return new Integer (getClassKey()); 4667 } 4668 return null; 4669 } 4670 4671 4679 public Object getByPeerName(String name) 4680 { 4681 if (name.equals(ScarabModulePeer.MODULE_ID)) 4682 { 4683 return getModuleId(); 4684 } 4685 if (name.equals(ScarabModulePeer.MODULE_NAME)) 4686 { 4687 return getRealName(); 4688 } 4689 if (name.equals(ScarabModulePeer.DOMAIN)) 4690 { 4691 return getDomain(); 4692 } 4693 if (name.equals(ScarabModulePeer.MODULE_CODE)) 4694 { 4695 return getCode(); 4696 } 4697 if (name.equals(ScarabModulePeer.MODULE_DESCRIPTION)) 4698 { 4699 return getDescription(); 4700 } 4701 if (name.equals(ScarabModulePeer.MODULE_URL)) 4702 { 4703 return getUrl(); 4704 } 4705 if (name.equals(ScarabModulePeer.ARCHIVE_EMAIL)) 4706 { 4707 return getArchiveEmail(); 4708 } 4709 if (name.equals(ScarabModulePeer.PARENT_ID)) 4710 { 4711 return getParentId(); 4712 } 4713 if (name.equals(ScarabModulePeer.OWNER_ID)) 4714 { 4715 return getOwnerId(); 4716 } 4717 if (name.equals(ScarabModulePeer.QA_CONTACT_ID)) 4718 { 4719 return getQaContactId(); 4720 } 4721 if (name.equals(ScarabModulePeer.DELETED)) 4722 { 4723 return Boolean.valueOf(getDeleted()); 4724 } 4725 if (name.equals(ScarabModulePeer.LOCKED)) 4726 { 4727 return Boolean.valueOf(getLocked()); 4728 } 4729 if (name.equals(ScarabModulePeer.CLASS_KEY)) 4730 { 4731 return new Integer (getClassKey()); 4732 } 4733 return null; 4734 } 4735 4736 4743 public Object getByPosition(int pos) 4744 { 4745 if (pos == 0) 4746 { 4747 return getModuleId(); 4748 } 4749 if (pos == 1) 4750 { 4751 return getRealName(); 4752 } 4753 if (pos == 2) 4754 { 4755 return getDomain(); 4756 } 4757 if (pos == 3) 4758 { 4759 return getCode(); 4760 } 4761 if (pos == 4) 4762 { 4763 return getDescription(); 4764 } 4765 if (pos == 5) 4766 { 4767 return getUrl(); 4768 } 4769 if (pos == 6) 4770 { 4771 return getArchiveEmail(); 4772 } 4773 if (pos == 7) 4774 { 4775 return getParentId(); 4776 } 4777 if (pos == 8) 4778 { 4779 return getOwnerId(); 4780 } 4781 if (pos == 9) 4782 { 4783 return getQaContactId(); 4784 } 4785 if (pos == 10) 4786 { 4787 return Boolean.valueOf(getDeleted()); 4788 } 4789 if (pos == 11) 4790 { 4791 return Boolean.valueOf(getLocked()); 4792 } 4793 if (pos == 12) 4794 { 4795 return new Integer (getClassKey()); 4796 } 4797 return null; 4798 } 4799 4800 4806 public void save() throws Exception 4807 { 4808 save(ScarabModulePeer.getMapBuilder() 4809 .getDatabaseMap().getName()); 4810 } 4811 4812 4822 public void save(String dbName) throws TorqueException 4823 { 4824 Connection con = null; 4825 try 4826 { 4827 con = Transaction.begin(dbName); 4828 save(con); 4829 Transaction.commit(con); 4830 } 4831 catch(TorqueException e) 4832 { 4833 Transaction.safeRollback(con); 4834 throw e; 4835 } 4836 } 4837 4838 4840 private boolean alreadyInSave = false; 4841 4851 public void save(Connection con) throws TorqueException 4852 { 4853 if (!alreadyInSave) 4854 { 4855 alreadyInSave = true; 4856 4857 4858 4859 if (isModified()) 4861 { 4862 if (isNew()) 4863 { 4864 ScarabModulePeer.doInsert((ScarabModule)this, con); 4865 setNew(false); 4866 } 4867 else 4868 { 4869 ScarabModulePeer.doUpdate((ScarabModule)this, con); 4870 } 4871 4872 if (isCacheOnSave()) 4873 { 4874 ModuleManager.putInstance(this); 4875 } 4876 } 4877 4878 4879 if (collAttributeGroups != null) 4880 { 4881 for (int i = 0; i < collAttributeGroups.size(); i++) 4882 { 4883 ((AttributeGroup)collAttributeGroups.get(i)).save(con); 4884 } 4885 } 4886 4887 if (collIssues != null) 4888 { 4889 for (int i = 0; i < collIssues.size(); i++) 4890 { 4891 ((Issue)collIssues.get(i)).save(con); 4892 } 4893 } 4894 4895 if (collRModuleIssueTypes != null) 4896 { 4897 for (int i = 0; i < collRModuleIssueTypes.size(); i++) 4898 { 4899 ((RModuleIssueType)collRModuleIssueTypes.get(i)).save(con); 4900 } 4901 } 4902 4903 if (collMITListItems != null) 4904 { 4905 for (int i = 0; i < collMITListItems.size(); i++) 4906 { 4907 ((MITListItem)collMITListItems.get(i)).save(con); 4908 } 4909 } 4910 4911 if (collRModuleAttributes != null) 4912 { 4913 for (int i = 0; i < collRModuleAttributes.size(); i++) 4914 { 4915 ((RModuleAttribute)collRModuleAttributes.get(i)).save(con); 4916 } 4917 } 4918 4919 if (collRModuleOptions != null) 4920 { 4921 for (int i = 0; i < collRModuleOptions.size(); i++) 4922 { 4923 ((RModuleOption)collRModuleOptions.get(i)).save(con); 4924 } 4925 } 4926 4927 if (collRModuleUserAttributes != null) 4928 { 4929 for (int i = 0; i < collRModuleUserAttributes.size(); i++) 4930 { 4931 ((RModuleUserAttribute)collRModuleUserAttributes.get(i)).save(con); 4932 } 4933 } 4934 4935 if (collUserVotes != null) 4936 { 4937 for (int i = 0; i < collUserVotes.size(); i++) 4938 { 4939 ((UserVote)collUserVotes.get(i)).save(con); 4940 } 4941 } 4942 4943 if (collQuerys != null) 4944 { 4945 for (int i = 0; i < collQuerys.size(); i++) 4946 { 4947 ((Query)collQuerys.get(i)).save(con); 4948 } 4949 } 4950 4951 if (collReports != null) 4952 { 4953 for (int i = 0; i < collReports.size(); i++) 4954 { 4955 ((Report)collReports.get(i)).save(con); 4956 } 4957 } 4958 4959 if (collPendingGroupUserRoles != null) 4960 { 4961 for (int i = 0; i < collPendingGroupUserRoles.size(); i++) 4962 { 4963 ((PendingGroupUserRole)collPendingGroupUserRoles.get(i)).save(con); 4964 } 4965 } 4966 4967 if (collGlobalParameters != null) 4968 { 4969 for (int i = 0; i < collGlobalParameters.size(); i++) 4970 { 4971 ((GlobalParameter)collGlobalParameters.get(i)).save(con); 4972 } 4973 } 4974 alreadyInSave = false; 4975 } 4976 } 4977 4978 4982 protected boolean isCacheOnSave() 4983 { 4984 return true; 4985 } 4986 4987 4988 4993 public void setPrimaryKey(ObjectKey moduleId) 4994 throws TorqueException { 4995 setModuleId(new Integer (((NumberKey)moduleId).intValue())); 4996 } 4997 4998 5003 public void setPrimaryKey(String key) throws TorqueException 5004 { 5005 setModuleId(new Integer (key)); 5006 } 5007 5008 5009 5013 public ObjectKey getPrimaryKey() 5014 { 5015 return SimpleKey.keyFor(getModuleId()); 5016 } 5017 5018 5022 public String getQueryKey() 5023 { 5024 if (getPrimaryKey() == null) 5025 { 5026 return ""; 5027 } 5028 else 5029 { 5030 return getPrimaryKey().toString(); 5031 } 5032 } 5033 5034 5038 public void setQueryKey(String key) 5039 throws TorqueException 5040 { 5041 setPrimaryKey(key); 5042 } 5043 5044 5050 public ScarabModule copyInto(ScarabModule copyObj) throws TorqueException 5051 { 5052 copyObj.setModuleId(moduleId); 5053 copyObj.setRealName(realName); 5054 copyObj.setDomain(domain); 5055 copyObj.setCode(code); 5056 copyObj.setDescription(description); 5057 copyObj.setUrl(url); 5058 copyObj.setArchiveEmail(archiveEmail); 5059 copyObj.setParentId(parentId); 5060 copyObj.setOwnerId(ownerId); 5061 copyObj.setQaContactId(qaContactId); 5062 copyObj.setDeleted(deleted); 5063 copyObj.setLocked(locked); 5064 copyObj.setClassKey(classKey); 5065 5066 copyObj.setModuleId((Integer )null); 5067 5068 5069 5070 List v = getAttributeGroups(); 5071 for (int i = 0; i < v.size(); i++) 5072 { 5073 AttributeGroup obj = (AttributeGroup) v.get(i); 5074 copyObj.addAttributeGroup(obj.copy()); 5075 } 5076 5077 5078 v = getIssues(); 5079 for (int i = 0; i < v.size(); i++) 5080 { 5081 Issue obj = (Issue) v.get(i); 5082 copyObj.addIssue(obj.copy()); 5083 } 5084 5085 5086 v = getRModuleIssueTypes(); 5087 for (int i = 0; i < v.size(); i++) 5088 { 5089 RModuleIssueType obj = (RModuleIssueType) v.get(i); 5090 copyObj.addRModuleIssueType(obj.copy()); 5091 } 5092 5093 5094 v = getMITListItems(); 5095 for (int i = 0; i < v.size(); i++) 5096 { 5097 MITListItem obj = (MITListItem) v.get(i); 5098 copyObj.addMITListItem(obj.copy()); 5099 } 5100 5101 5102 v = getRModuleAttributes(); 5103 for (int i = 0; i < v.size(); i++) 5104 { 5105 RModuleAttribute obj = (RModuleAttribute) v.get(i); 5106 copyObj.addRModuleAttribute(obj.copy()); 5107 } 5108 5109 5110 v = getRModuleOptions(); 5111 for (int i = 0; i < v.size(); i++) 5112 { 5113 RModuleOption obj = (RModuleOption) v.get(i); 5114 copyObj.addRModuleOption(obj.copy()); 5115 } 5116 5117 5118 v = getRModuleUserAttributes(); 5119 for (int i = 0; i < v.size(); i++) 5120 { 5121 RModuleUserAttribute obj = (RModuleUserAttribute) v.get(i); 5122 copyObj.addRModuleUserAttribute(obj.copy()); 5123 } 5124 5125 5126 v = getUserVotes(); 5127 for (int i = 0; i < v.size(); i++) 5128 { 5129 UserVote obj = (UserVote) v.get(i); 5130 copyObj.addUserVote(obj.copy()); 5131 } 5132 5133 5134 v = getQuerys(); 5135 for (int i = 0; i < v.size(); i++) 5136 { 5137 Query obj = (Query) v.get(i); 5138 copyObj.addQuery(obj.copy()); 5139 } 5140 5141 5142 v = getReports(); 5143 for (int i = 0; i < v.size(); i++) 5144 { 5145 Report obj = (Report) v.get(i); 5146 copyObj.addReport(obj.copy()); 5147 } 5148 5149 5150 v = getPendingGroupUserRoles(); 5151 for (int i = 0; i < v.size(); i++) 5152 { 5153 PendingGroupUserRole obj = (PendingGroupUserRole) v.get(i); 5154 copyObj.addPendingGroupUserRole(obj.copy()); 5155 } 5156 5157 5158 v = getGlobalParameters(); 5159 for (int i = 0; i < v.size(); i++) 5160 { 5161 GlobalParameter obj = (GlobalParameter) v.get(i); 5162 copyObj.addGlobalParameter(obj.copy()); 5163 } 5164 return copyObj; 5165 } 5166 5167 5173 public ScarabModulePeer getPeer() 5174 { 5175 return peer; 5176 } 5177 5178 public String toString() 5179 { 5180 StringBuffer str = new StringBuffer (); 5181 str.append("ScarabModule:\n"); 5182 str.append("ModuleId = ") 5183 .append(getModuleId()) 5184 .append("\n"); 5185 str.append("RealName = ") 5186 .append(getRealName()) 5187 .append("\n"); 5188 str.append("Domain = ") 5189 .append(getDomain()) 5190 .append("\n"); 5191 str.append("Code = ") 5192 .append(getCode()) 5193 .append("\n"); 5194 str.append("Description = ") 5195 .append(getDescription()) 5196 .append("\n"); 5197 str.append("Url = ") 5198 .append(getUrl()) 5199 .append("\n"); 5200 str.append("ArchiveEmail = ") 5201 .append(getArchiveEmail()) 5202 .append("\n"); 5203 str.append("ParentId = ") 5204 .append(getParentId()) 5205 .append("\n"); 5206 str.append("OwnerId = ") 5207 .append(getOwnerId()) 5208 .append("\n"); 5209 str.append("QaContactId = ") 5210 .append(getQaContactId()) 5211 .append("\n"); 5212 str.append("Deleted = ") 5213 .append(getDeleted()) 5214 .append("\n"); 5215 str.append("Locked = ") 5216 .append(getLocked()) 5217 .append("\n"); 5218 str.append("ClassKey = ") 5219 .append(getClassKey()) 5220 .append("\n"); 5221 return(str.toString()); 5222 } 5223} 5224 | Popular Tags |