1 package org.tigris.scarab.om; 2 3 import java.math.BigDecimal ; 4 import java.sql.Connection ; 5 import java.sql.SQLException ; 6 import java.util.ArrayList ; 7 import java.util.Date ; 8 import java.util.Iterator ; 9 import java.util.LinkedList ; 10 import java.util.List ; 11 12 import org.apache.torque.NoRowsException; 13 import org.apache.torque.TooManyRowsException; 14 import org.apache.torque.Torque; 15 import org.apache.torque.TorqueException; 16 import org.apache.torque.map.MapBuilder; 17 import org.apache.torque.map.TableMap; 18 import org.apache.torque.om.DateKey; 19 import org.apache.torque.om.NumberKey; 20 import org.apache.torque.om.StringKey; 21 import org.apache.torque.om.ObjectKey; 22 import org.apache.torque.om.SimpleKey; 23 import org.apache.torque.util.BasePeer; 24 import org.apache.torque.util.Criteria; 25 26 import com.workingdogs.village.DataSetException; 27 import com.workingdogs.village.QueryDataSet; 28 import com.workingdogs.village.Record; 29 30 import org.tigris.scarab.om.map.*; 32 33 34 35 36 37 38 39 40 42 public abstract class BaseQueryPeer 43 extends BasePeer 44 { 45 46 47 public static final String DATABASE_NAME = "scarab"; 48 49 50 public static final String TABLE_NAME = "SCARAB_QUERY"; 51 52 57 public static MapBuilder getMapBuilder() 58 throws TorqueException 59 { 60 return getMapBuilder(QueryMapBuilder.CLASS_NAME); 61 } 62 63 64 public static final String QUERY_ID; 65 66 public static final String USER_ID; 67 68 public static final String NAME; 69 70 public static final String DESCRIPTION; 71 72 public static final String VALUE; 73 74 public static final String SCOPE_ID; 75 76 public static final String ISSUE_TYPE_ID; 77 78 public static final String MODULE_ID; 79 80 public static final String LIST_ID; 81 82 public static final String DELETED; 83 84 public static final String APPROVED; 85 86 public static final String CREATED_DATE; 87 88 public static final String SUBSCRIPTION_FREQUENCY_ID; 89 90 public static final String HOME_PAGE; 91 92 public static final String PREFERRED_ORDER; 93 94 static 95 { 96 QUERY_ID = "SCARAB_QUERY.QUERY_ID"; 97 USER_ID = "SCARAB_QUERY.USER_ID"; 98 NAME = "SCARAB_QUERY.NAME"; 99 DESCRIPTION = "SCARAB_QUERY.DESCRIPTION"; 100 VALUE = "SCARAB_QUERY.VALUE"; 101 SCOPE_ID = "SCARAB_QUERY.SCOPE_ID"; 102 ISSUE_TYPE_ID = "SCARAB_QUERY.ISSUE_TYPE_ID"; 103 MODULE_ID = "SCARAB_QUERY.MODULE_ID"; 104 LIST_ID = "SCARAB_QUERY.LIST_ID"; 105 DELETED = "SCARAB_QUERY.DELETED"; 106 APPROVED = "SCARAB_QUERY.APPROVED"; 107 CREATED_DATE = "SCARAB_QUERY.CREATED_DATE"; 108 SUBSCRIPTION_FREQUENCY_ID = "SCARAB_QUERY.SUBSCRIPTION_FREQUENCY_ID"; 109 HOME_PAGE = "SCARAB_QUERY.HOME_PAGE"; 110 PREFERRED_ORDER = "SCARAB_QUERY.PREFERRED_ORDER"; 111 if (Torque.isInit()) 112 { 113 try 114 { 115 getMapBuilder(QueryMapBuilder.CLASS_NAME); 116 } 117 catch (Exception e) 118 { 119 log.error("Could not initialize Peer", e); 120 } 121 } 122 else 123 { 124 Torque.registerMapBuilder(QueryMapBuilder.CLASS_NAME); 125 } 126 } 127 128 129 public static final int numColumns = 15; 130 131 132 protected static final String CLASSNAME_DEFAULT = 133 "org.tigris.scarab.om.Query"; 134 135 136 protected static final Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT); 137 138 144 private static Class initClass(String className) 145 { 146 Class c = null; 147 try 148 { 149 c = Class.forName(className); 150 } 151 catch (Throwable t) 152 { 153 log.error("A FATAL ERROR has occurred which should not " 154 + "have happened under any circumstance. Please notify " 155 + "the Torque developers <torque-dev@db.apache.org> " 156 + "and give as many details as possible (including the error " 157 + "stack trace).", t); 158 159 if (t instanceof Error ) 161 { 162 throw (Error ) t.fillInStackTrace(); 163 } 164 } 165 return c; 166 } 167 168 178 public static List resultSet2Objects(java.sql.ResultSet results) 179 throws TorqueException 180 { 181 try 182 { 183 QueryDataSet qds = null; 184 List rows = null; 185 try 186 { 187 qds = new QueryDataSet(results); 188 rows = getSelectResults(qds); 189 } 190 finally 191 { 192 if (qds != null) 193 { 194 qds.close(); 195 } 196 } 197 198 return populateObjects(rows); 199 } 200 catch (SQLException e) 201 { 202 throw new TorqueException(e); 203 } 204 catch (DataSetException e) 205 { 206 throw new TorqueException(e); 207 } 208 } 209 210 211 212 219 public static ObjectKey doInsert(Criteria criteria) 220 throws TorqueException 221 { 222 return BaseQueryPeer 223 .doInsert(criteria, (Connection ) null); 224 } 225 226 236 public static ObjectKey doInsert(Criteria criteria, Connection con) 237 throws TorqueException 238 { 239 if (criteria.containsKey(DELETED)) 241 { 242 Object possibleBoolean = criteria.get(DELETED); 243 if (possibleBoolean instanceof Boolean ) 244 { 245 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 246 } 247 } 248 if (criteria.containsKey(APPROVED)) 250 { 251 Object possibleBoolean = criteria.get(APPROVED); 252 if (possibleBoolean instanceof Boolean ) 253 { 254 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 255 } 256 } 257 if (criteria.containsKey(HOME_PAGE)) 259 { 260 Object possibleBoolean = criteria.get(HOME_PAGE); 261 if (possibleBoolean instanceof Boolean ) 262 { 263 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 264 } 265 } 266 267 setDbName(criteria); 268 269 if (con == null) 270 { 271 return BasePeer.doInsert(criteria); 272 } 273 else 274 { 275 return BasePeer.doInsert(criteria, con); 276 } 277 } 278 279 286 public static void addSelectColumns(Criteria criteria) 287 throws TorqueException 288 { 289 criteria.addSelectColumn(QUERY_ID); 290 criteria.addSelectColumn(USER_ID); 291 criteria.addSelectColumn(NAME); 292 criteria.addSelectColumn(DESCRIPTION); 293 criteria.addSelectColumn(VALUE); 294 criteria.addSelectColumn(SCOPE_ID); 295 criteria.addSelectColumn(ISSUE_TYPE_ID); 296 criteria.addSelectColumn(MODULE_ID); 297 criteria.addSelectColumn(LIST_ID); 298 criteria.addSelectColumn(DELETED); 299 criteria.addSelectColumn(APPROVED); 300 criteria.addSelectColumn(CREATED_DATE); 301 criteria.addSelectColumn(SUBSCRIPTION_FREQUENCY_ID); 302 criteria.addSelectColumn(HOME_PAGE); 303 criteria.addSelectColumn(PREFERRED_ORDER); 304 } 305 306 315 public static Query row2Object(Record row, 316 int offset, 317 Class cls) 318 throws TorqueException 319 { 320 try 321 { 322 Query obj = (Query) cls.newInstance(); 323 QueryPeer.populateObject(row, offset, obj); 324 obj.setModified(false); 325 obj.setNew(false); 326 327 return obj; 328 } 329 catch (InstantiationException e) 330 { 331 throw new TorqueException(e); 332 } 333 catch (IllegalAccessException e) 334 { 335 throw new TorqueException(e); 336 } 337 } 338 339 348 public static void populateObject(Record row, 349 int offset, 350 Query obj) 351 throws TorqueException 352 { 353 try 354 { 355 obj.setQueryId(row.getValue(offset + 0).asLongObj()); 356 obj.setUserId(row.getValue(offset + 1).asIntegerObj()); 357 obj.setName(row.getValue(offset + 2).asString()); 358 obj.setDescription(row.getValue(offset + 3).asString()); 359 obj.setValue(row.getValue(offset + 4).asString()); 360 obj.setScopeId(row.getValue(offset + 5).asIntegerObj()); 361 obj.setIssueTypeId(row.getValue(offset + 6).asIntegerObj()); 362 obj.setModuleId(row.getValue(offset + 7).asIntegerObj()); 363 obj.setListId(row.getValue(offset + 8).asLongObj()); 364 obj.setDeleted(row.getValue(offset + 9).asBoolean()); 365 obj.setApproved(row.getValue(offset + 10).asBoolean()); 366 obj.setCreatedDate(row.getValue(offset + 11).asUtilDate()); 367 obj.setSubscriptionFrequencyId(row.getValue(offset + 12).asIntegerObj()); 368 obj.setHomePage(row.getValue(offset + 13).asBoolean()); 369 obj.setOrder(row.getValue(offset + 14).asInt()); 370 } 371 catch (DataSetException e) 372 { 373 throw new TorqueException(e); 374 } 375 } 376 377 385 public static List doSelect(Criteria criteria) throws TorqueException 386 { 387 return populateObjects(doSelectVillageRecords(criteria)); 388 } 389 390 399 public static List doSelect(Criteria criteria, Connection con) 400 throws TorqueException 401 { 402 return populateObjects(doSelectVillageRecords(criteria, con)); 403 } 404 405 415 public static List doSelectVillageRecords(Criteria criteria) 416 throws TorqueException 417 { 418 return BaseQueryPeer 419 .doSelectVillageRecords(criteria, (Connection ) null); 420 } 421 422 431 public static List doSelectVillageRecords(Criteria criteria, Connection con) 432 throws TorqueException 433 { 434 if (criteria.getSelectColumns().size() == 0) 435 { 436 addSelectColumns(criteria); 437 } 438 439 if (criteria.containsKey(DELETED)) 441 { 442 Object possibleBoolean = criteria.get(DELETED); 443 if (possibleBoolean instanceof Boolean ) 444 { 445 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 446 } 447 } 448 if (criteria.containsKey(APPROVED)) 450 { 451 Object possibleBoolean = criteria.get(APPROVED); 452 if (possibleBoolean instanceof Boolean ) 453 { 454 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 455 } 456 } 457 if (criteria.containsKey(HOME_PAGE)) 459 { 460 Object possibleBoolean = criteria.get(HOME_PAGE); 461 if (possibleBoolean instanceof Boolean ) 462 { 463 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 464 } 465 } 466 467 setDbName(criteria); 468 469 if (con == null) 472 { 473 return BasePeer.doSelect(criteria); 474 } 475 else 476 { 477 return BasePeer.doSelect(criteria, con); 478 } 479 } 480 481 488 public static List populateObjects(List records) 489 throws TorqueException 490 { 491 List results = new ArrayList (records.size()); 492 493 for (int i = 0; i < records.size(); i++) 495 { 496 Record row = (Record) records.get(i); 497 results.add(QueryPeer.row2Object(row, 1, 498 QueryPeer.getOMClass())); 499 } 500 return results; 501 } 502 503 504 512 public static Class getOMClass() 513 throws TorqueException 514 { 515 return CLASS_DEFAULT; 516 } 517 518 526 public static void doUpdate(Criteria criteria) throws TorqueException 527 { 528 BaseQueryPeer 529 .doUpdate(criteria, (Connection ) null); 530 } 531 532 543 public static void doUpdate(Criteria criteria, Connection con) 544 throws TorqueException 545 { 546 Criteria selectCriteria = new Criteria(DATABASE_NAME, 2); 547 selectCriteria.put(QUERY_ID, criteria.remove(QUERY_ID)); 548 if (criteria.containsKey(DELETED)) 550 { 551 Object possibleBoolean = criteria.get(DELETED); 552 if (possibleBoolean instanceof Boolean ) 553 { 554 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 555 } 556 } 557 if (criteria.containsKey(APPROVED)) 559 { 560 Object possibleBoolean = criteria.get(APPROVED); 561 if (possibleBoolean instanceof Boolean ) 562 { 563 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 564 } 565 } 566 if (criteria.containsKey(HOME_PAGE)) 568 { 569 Object possibleBoolean = criteria.get(HOME_PAGE); 570 if (possibleBoolean instanceof Boolean ) 571 { 572 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 573 } 574 } 575 576 setDbName(criteria); 577 578 if (con == null) 579 { 580 BasePeer.doUpdate(selectCriteria, criteria); 581 } 582 else 583 { 584 BasePeer.doUpdate(selectCriteria, criteria, con); 585 } 586 } 587 588 595 public static void doDelete(Criteria criteria) throws TorqueException 596 { 597 QueryPeer 598 .doDelete(criteria, (Connection ) null); 599 } 600 601 611 public static void doDelete(Criteria criteria, Connection con) 612 throws TorqueException 613 { 614 if (criteria.containsKey(DELETED)) 616 { 617 Object possibleBoolean = criteria.get(DELETED); 618 if (possibleBoolean instanceof Boolean ) 619 { 620 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 621 } 622 } 623 if (criteria.containsKey(APPROVED)) 625 { 626 Object possibleBoolean = criteria.get(APPROVED); 627 if (possibleBoolean instanceof Boolean ) 628 { 629 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 630 } 631 } 632 if (criteria.containsKey(HOME_PAGE)) 634 { 635 Object possibleBoolean = criteria.get(HOME_PAGE); 636 if (possibleBoolean instanceof Boolean ) 637 { 638 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 639 } 640 } 641 642 setDbName(criteria); 643 644 if (con == null) 645 { 646 BasePeer.doDelete(criteria); 647 } 648 else 649 { 650 BasePeer.doDelete(criteria, con); 651 } 652 } 653 654 660 public static List doSelect(Query obj) throws TorqueException 661 { 662 return doSelect(buildSelectCriteria(obj)); 663 } 664 665 671 public static void doInsert(Query obj) throws TorqueException 672 { 673 obj.setPrimaryKey(doInsert(buildCriteria(obj))); 674 obj.setNew(false); 675 obj.setModified(false); 676 } 677 678 683 public static void doUpdate(Query obj) throws TorqueException 684 { 685 doUpdate(buildCriteria(obj)); 686 obj.setModified(false); 687 } 688 689 694 public static void doDelete(Query obj) throws TorqueException 695 { 696 doDelete(buildSelectCriteria(obj)); 697 } 698 699 709 public static void doInsert(Query obj, Connection con) 710 throws TorqueException 711 { 712 obj.setPrimaryKey(doInsert(buildCriteria(obj), con)); 713 obj.setNew(false); 714 obj.setModified(false); 715 } 716 717 727 public static void doUpdate(Query obj, Connection con) 728 throws TorqueException 729 { 730 doUpdate(buildCriteria(obj), con); 731 obj.setModified(false); 732 } 733 734 744 public static void doDelete(Query obj, Connection con) 745 throws TorqueException 746 { 747 doDelete(buildSelectCriteria(obj), con); 748 } 749 750 757 public static void doDelete(ObjectKey pk) throws TorqueException 758 { 759 BaseQueryPeer 760 .doDelete(pk, (Connection ) null); 761 } 762 763 773 public static void doDelete(ObjectKey pk, Connection con) 774 throws TorqueException 775 { 776 doDelete(buildCriteria(pk), con); 777 } 778 779 780 public static Criteria buildCriteria( ObjectKey pk ) 781 { 782 Criteria criteria = new Criteria(); 783 criteria.add(QUERY_ID, pk); 784 return criteria; 785 } 786 787 788 public static Criteria buildCriteria( Query obj ) 789 { 790 Criteria criteria = new Criteria(DATABASE_NAME); 791 if (!obj.isNew()) 792 criteria.add(QUERY_ID, obj.getQueryId()); 793 criteria.add(USER_ID, obj.getUserId()); 794 criteria.add(NAME, obj.getName()); 795 criteria.add(DESCRIPTION, obj.getDescription()); 796 criteria.add(VALUE, obj.getValue()); 797 criteria.add(SCOPE_ID, obj.getScopeId()); 798 criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId()); 799 criteria.add(MODULE_ID, obj.getModuleId()); 800 criteria.add(LIST_ID, obj.getListId()); 801 criteria.add(DELETED, obj.getDeleted()); 802 criteria.add(APPROVED, obj.getApproved()); 803 criteria.add(CREATED_DATE, obj.getCreatedDate()); 804 criteria.add(SUBSCRIPTION_FREQUENCY_ID, obj.getSubscriptionFrequencyId()); 805 criteria.add(HOME_PAGE, obj.getHomePage()); 806 criteria.add(PREFERRED_ORDER, obj.getOrder()); 807 return criteria; 808 } 809 810 811 public static Criteria buildSelectCriteria( Query obj ) 812 { 813 Criteria criteria = new Criteria(DATABASE_NAME); 814 if (!obj.isNew()) 815 criteria.add(QUERY_ID, obj.getQueryId()); 816 criteria.add(USER_ID, obj.getUserId()); 817 criteria.add(NAME, obj.getName()); 818 criteria.add(DESCRIPTION, obj.getDescription()); 819 criteria.add(VALUE, obj.getValue()); 820 criteria.add(SCOPE_ID, obj.getScopeId()); 821 criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId()); 822 criteria.add(MODULE_ID, obj.getModuleId()); 823 criteria.add(LIST_ID, obj.getListId()); 824 criteria.add(DELETED, obj.getDeleted()); 825 criteria.add(APPROVED, obj.getApproved()); 826 criteria.add(CREATED_DATE, obj.getCreatedDate()); 827 criteria.add(SUBSCRIPTION_FREQUENCY_ID, obj.getSubscriptionFrequencyId()); 828 criteria.add(HOME_PAGE, obj.getHomePage()); 829 criteria.add(PREFERRED_ORDER, obj.getOrder()); 830 return criteria; 831 } 832 833 834 843 public static Query retrieveByPK(Long pk) 844 throws TorqueException, NoRowsException, TooManyRowsException 845 { 846 return retrieveByPK(SimpleKey.keyFor(pk)); 847 } 848 849 859 public static Query retrieveByPK(Long pk, Connection con) 860 throws TorqueException, NoRowsException, TooManyRowsException 861 { 862 return retrieveByPK(SimpleKey.keyFor(pk), con); 863 } 864 865 874 public static Query retrieveByPK(ObjectKey pk) 875 throws TorqueException, NoRowsException, TooManyRowsException 876 { 877 Connection db = null; 878 Query retVal = null; 879 try 880 { 881 db = Torque.getConnection(DATABASE_NAME); 882 retVal = retrieveByPK(pk, db); 883 } 884 finally 885 { 886 Torque.closeConnection(db); 887 } 888 return(retVal); 889 } 890 891 901 public static Query retrieveByPK(ObjectKey pk, Connection con) 902 throws TorqueException, NoRowsException, TooManyRowsException 903 { 904 Criteria criteria = buildCriteria(pk); 905 List v = doSelect(criteria, con); 906 if (v.size() == 0) 907 { 908 throw new NoRowsException("Failed to select a row."); 909 } 910 else if (v.size() > 1) 911 { 912 throw new TooManyRowsException("Failed to select only one row."); 913 } 914 else 915 { 916 return (Query)v.get(0); 917 } 918 } 919 920 927 public static List retrieveByPKs(List pks) 928 throws TorqueException 929 { 930 Connection db = null; 931 List retVal = null; 932 try 933 { 934 db = Torque.getConnection(DATABASE_NAME); 935 retVal = retrieveByPKs(pks, db); 936 } 937 finally 938 { 939 Torque.closeConnection(db); 940 } 941 return(retVal); 942 } 943 944 952 public static List retrieveByPKs( List pks, Connection dbcon ) 953 throws TorqueException 954 { 955 List objs = null; 956 if (pks == null || pks.size() == 0) 957 { 958 objs = new LinkedList (); 959 } 960 else 961 { 962 Criteria criteria = new Criteria(); 963 criteria.addIn( QUERY_ID, pks ); 964 objs = doSelect(criteria, dbcon); 965 } 966 return objs; 967 } 968 969 970 971 972 973 974 975 976 977 978 989 protected static List doSelectJoinScarabUserImpl(Criteria criteria) 990 throws TorqueException 991 { 992 setDbName(criteria); 993 994 QueryPeer.addSelectColumns(criteria); 995 int offset = numColumns + 1; 996 ScarabUserImplPeer.addSelectColumns(criteria); 997 998 999 criteria.addJoin(QueryPeer.USER_ID, 1000 ScarabUserImplPeer.USER_ID); 1001 1002 1003 if (criteria.containsKey(DELETED)) 1005 { 1006 Object possibleBoolean = criteria.get(DELETED); 1007 if (possibleBoolean instanceof Boolean ) 1008 { 1009 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1010 } 1011 } 1012 if (criteria.containsKey(APPROVED)) 1014 { 1015 Object possibleBoolean = criteria.get(APPROVED); 1016 if (possibleBoolean instanceof Boolean ) 1017 { 1018 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1019 } 1020 } 1021 if (criteria.containsKey(HOME_PAGE)) 1023 { 1024 Object possibleBoolean = criteria.get(HOME_PAGE); 1025 if (possibleBoolean instanceof Boolean ) 1026 { 1027 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1028 } 1029 } 1030 1031 List rows = BasePeer.doSelect(criteria); 1032 List results = new ArrayList (); 1033 1034 for (int i = 0; i < rows.size(); i++) 1035 { 1036 Record row = (Record) rows.get(i); 1037 1038 Class omClass = QueryPeer.getOMClass(); 1039 Query obj1 = (Query) QueryPeer 1040 .row2Object(row, 1, omClass); 1041 omClass = ScarabUserImplPeer.getOMClass(); 1042 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 1043 .row2Object(row, offset, omClass); 1044 1045 boolean newObject = true; 1046 for (int j = 0; j < results.size(); j++) 1047 { 1048 Query temp_obj1 = (Query)results.get(j); 1049 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 1050 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1051 { 1052 newObject = false; 1053 temp_obj2.addQuery(obj1); 1054 break; 1055 } 1056 } 1057 if (newObject) 1058 { 1059 obj2.initQuerys(); 1060 obj2.addQuery(obj1); 1061 } 1062 results.add(obj1); 1063 } 1064 return results; 1065 } 1066 1067 1068 1069 1070 1081 protected static List doSelectJoinScope(Criteria criteria) 1082 throws TorqueException 1083 { 1084 setDbName(criteria); 1085 1086 QueryPeer.addSelectColumns(criteria); 1087 int offset = numColumns + 1; 1088 ScopePeer.addSelectColumns(criteria); 1089 1090 1091 criteria.addJoin(QueryPeer.SCOPE_ID, 1092 ScopePeer.SCOPE_ID); 1093 1094 1095 if (criteria.containsKey(DELETED)) 1097 { 1098 Object possibleBoolean = criteria.get(DELETED); 1099 if (possibleBoolean instanceof Boolean ) 1100 { 1101 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1102 } 1103 } 1104 if (criteria.containsKey(APPROVED)) 1106 { 1107 Object possibleBoolean = criteria.get(APPROVED); 1108 if (possibleBoolean instanceof Boolean ) 1109 { 1110 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1111 } 1112 } 1113 if (criteria.containsKey(HOME_PAGE)) 1115 { 1116 Object possibleBoolean = criteria.get(HOME_PAGE); 1117 if (possibleBoolean instanceof Boolean ) 1118 { 1119 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1120 } 1121 } 1122 1123 List rows = BasePeer.doSelect(criteria); 1124 List results = new ArrayList (); 1125 1126 for (int i = 0; i < rows.size(); i++) 1127 { 1128 Record row = (Record) rows.get(i); 1129 1130 Class omClass = QueryPeer.getOMClass(); 1131 Query obj1 = (Query) QueryPeer 1132 .row2Object(row, 1, omClass); 1133 omClass = ScopePeer.getOMClass(); 1134 Scope obj2 = (Scope)ScopePeer 1135 .row2Object(row, offset, omClass); 1136 1137 boolean newObject = true; 1138 for (int j = 0; j < results.size(); j++) 1139 { 1140 Query temp_obj1 = (Query)results.get(j); 1141 Scope temp_obj2 = (Scope)temp_obj1.getScope(); 1142 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1143 { 1144 newObject = false; 1145 temp_obj2.addQuery(obj1); 1146 break; 1147 } 1148 } 1149 if (newObject) 1150 { 1151 obj2.initQuerys(); 1152 obj2.addQuery(obj1); 1153 } 1154 results.add(obj1); 1155 } 1156 return results; 1157 } 1158 1159 1160 1161 1162 1173 protected static List doSelectJoinScarabModule(Criteria criteria) 1174 throws TorqueException 1175 { 1176 setDbName(criteria); 1177 1178 QueryPeer.addSelectColumns(criteria); 1179 int offset = numColumns + 1; 1180 ScarabModulePeer.addSelectColumns(criteria); 1181 1182 1183 criteria.addJoin(QueryPeer.MODULE_ID, 1184 ScarabModulePeer.MODULE_ID); 1185 1186 1187 if (criteria.containsKey(DELETED)) 1189 { 1190 Object possibleBoolean = criteria.get(DELETED); 1191 if (possibleBoolean instanceof Boolean ) 1192 { 1193 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1194 } 1195 } 1196 if (criteria.containsKey(APPROVED)) 1198 { 1199 Object possibleBoolean = criteria.get(APPROVED); 1200 if (possibleBoolean instanceof Boolean ) 1201 { 1202 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1203 } 1204 } 1205 if (criteria.containsKey(HOME_PAGE)) 1207 { 1208 Object possibleBoolean = criteria.get(HOME_PAGE); 1209 if (possibleBoolean instanceof Boolean ) 1210 { 1211 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1212 } 1213 } 1214 1215 List rows = BasePeer.doSelect(criteria); 1216 List results = new ArrayList (); 1217 1218 for (int i = 0; i < rows.size(); i++) 1219 { 1220 Record row = (Record) rows.get(i); 1221 1222 Class omClass = QueryPeer.getOMClass(); 1223 Query obj1 = (Query) QueryPeer 1224 .row2Object(row, 1, omClass); 1225 omClass = ScarabModulePeer.getOMClass(row, offset); 1226 ScarabModule obj2 = (ScarabModule)ScarabModulePeer 1227 .row2Object(row, offset, omClass); 1228 1229 boolean newObject = true; 1230 for (int j = 0; j < results.size(); j++) 1231 { 1232 Query temp_obj1 = (Query)results.get(j); 1233 ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule(); 1234 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1235 { 1236 newObject = false; 1237 temp_obj2.addQuery(obj1); 1238 break; 1239 } 1240 } 1241 if (newObject) 1242 { 1243 obj2.initQuerys(); 1244 obj2.addQuery(obj1); 1245 } 1246 results.add(obj1); 1247 } 1248 return results; 1249 } 1250 1251 1252 1253 1254 1265 protected static List doSelectJoinIssueType(Criteria criteria) 1266 throws TorqueException 1267 { 1268 setDbName(criteria); 1269 1270 QueryPeer.addSelectColumns(criteria); 1271 int offset = numColumns + 1; 1272 IssueTypePeer.addSelectColumns(criteria); 1273 1274 1275 criteria.addJoin(QueryPeer.ISSUE_TYPE_ID, 1276 IssueTypePeer.ISSUE_TYPE_ID); 1277 1278 1279 if (criteria.containsKey(DELETED)) 1281 { 1282 Object possibleBoolean = criteria.get(DELETED); 1283 if (possibleBoolean instanceof Boolean ) 1284 { 1285 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1286 } 1287 } 1288 if (criteria.containsKey(APPROVED)) 1290 { 1291 Object possibleBoolean = criteria.get(APPROVED); 1292 if (possibleBoolean instanceof Boolean ) 1293 { 1294 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1295 } 1296 } 1297 if (criteria.containsKey(HOME_PAGE)) 1299 { 1300 Object possibleBoolean = criteria.get(HOME_PAGE); 1301 if (possibleBoolean instanceof Boolean ) 1302 { 1303 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1304 } 1305 } 1306 1307 List rows = BasePeer.doSelect(criteria); 1308 List results = new ArrayList (); 1309 1310 for (int i = 0; i < rows.size(); i++) 1311 { 1312 Record row = (Record) rows.get(i); 1313 1314 Class omClass = QueryPeer.getOMClass(); 1315 Query obj1 = (Query) QueryPeer 1316 .row2Object(row, 1, omClass); 1317 omClass = IssueTypePeer.getOMClass(); 1318 IssueType obj2 = (IssueType)IssueTypePeer 1319 .row2Object(row, offset, omClass); 1320 1321 boolean newObject = true; 1322 for (int j = 0; j < results.size(); j++) 1323 { 1324 Query temp_obj1 = (Query)results.get(j); 1325 IssueType temp_obj2 = (IssueType)temp_obj1.getIssueType(); 1326 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1327 { 1328 newObject = false; 1329 temp_obj2.addQuery(obj1); 1330 break; 1331 } 1332 } 1333 if (newObject) 1334 { 1335 obj2.initQuerys(); 1336 obj2.addQuery(obj1); 1337 } 1338 results.add(obj1); 1339 } 1340 return results; 1341 } 1342 1343 1344 1345 1346 1357 protected static List doSelectJoinMITList(Criteria criteria) 1358 throws TorqueException 1359 { 1360 setDbName(criteria); 1361 1362 QueryPeer.addSelectColumns(criteria); 1363 int offset = numColumns + 1; 1364 MITListPeer.addSelectColumns(criteria); 1365 1366 1367 criteria.addJoin(QueryPeer.LIST_ID, 1368 MITListPeer.LIST_ID); 1369 1370 1371 if (criteria.containsKey(DELETED)) 1373 { 1374 Object possibleBoolean = criteria.get(DELETED); 1375 if (possibleBoolean instanceof Boolean ) 1376 { 1377 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1378 } 1379 } 1380 if (criteria.containsKey(APPROVED)) 1382 { 1383 Object possibleBoolean = criteria.get(APPROVED); 1384 if (possibleBoolean instanceof Boolean ) 1385 { 1386 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1387 } 1388 } 1389 if (criteria.containsKey(HOME_PAGE)) 1391 { 1392 Object possibleBoolean = criteria.get(HOME_PAGE); 1393 if (possibleBoolean instanceof Boolean ) 1394 { 1395 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1396 } 1397 } 1398 1399 List rows = BasePeer.doSelect(criteria); 1400 List results = new ArrayList (); 1401 1402 for (int i = 0; i < rows.size(); i++) 1403 { 1404 Record row = (Record) rows.get(i); 1405 1406 Class omClass = QueryPeer.getOMClass(); 1407 Query obj1 = (Query) QueryPeer 1408 .row2Object(row, 1, omClass); 1409 omClass = MITListPeer.getOMClass(); 1410 MITList obj2 = (MITList)MITListPeer 1411 .row2Object(row, offset, omClass); 1412 1413 boolean newObject = true; 1414 for (int j = 0; j < results.size(); j++) 1415 { 1416 Query temp_obj1 = (Query)results.get(j); 1417 MITList temp_obj2 = (MITList)temp_obj1.getMITList(); 1418 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1419 { 1420 newObject = false; 1421 temp_obj2.addQuery(obj1); 1422 break; 1423 } 1424 } 1425 if (newObject) 1426 { 1427 obj2.initQuerys(); 1428 obj2.addQuery(obj1); 1429 } 1430 results.add(obj1); 1431 } 1432 return results; 1433 } 1434 1435 1436 1437 1438 1449 protected static List doSelectJoinFrequency(Criteria criteria) 1450 throws TorqueException 1451 { 1452 setDbName(criteria); 1453 1454 QueryPeer.addSelectColumns(criteria); 1455 int offset = numColumns + 1; 1456 FrequencyPeer.addSelectColumns(criteria); 1457 1458 1459 criteria.addJoin(QueryPeer.SUBSCRIPTION_FREQUENCY_ID, 1460 FrequencyPeer.FREQUENCY_ID); 1461 1462 1463 if (criteria.containsKey(DELETED)) 1465 { 1466 Object possibleBoolean = criteria.get(DELETED); 1467 if (possibleBoolean instanceof Boolean ) 1468 { 1469 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1470 } 1471 } 1472 if (criteria.containsKey(APPROVED)) 1474 { 1475 Object possibleBoolean = criteria.get(APPROVED); 1476 if (possibleBoolean instanceof Boolean ) 1477 { 1478 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1479 } 1480 } 1481 if (criteria.containsKey(HOME_PAGE)) 1483 { 1484 Object possibleBoolean = criteria.get(HOME_PAGE); 1485 if (possibleBoolean instanceof Boolean ) 1486 { 1487 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1488 } 1489 } 1490 1491 List rows = BasePeer.doSelect(criteria); 1492 List results = new ArrayList (); 1493 1494 for (int i = 0; i < rows.size(); i++) 1495 { 1496 Record row = (Record) rows.get(i); 1497 1498 Class omClass = QueryPeer.getOMClass(); 1499 Query obj1 = (Query) QueryPeer 1500 .row2Object(row, 1, omClass); 1501 omClass = FrequencyPeer.getOMClass(); 1502 Frequency obj2 = (Frequency)FrequencyPeer 1503 .row2Object(row, offset, omClass); 1504 1505 boolean newObject = true; 1506 for (int j = 0; j < results.size(); j++) 1507 { 1508 Query temp_obj1 = (Query)results.get(j); 1509 Frequency temp_obj2 = (Frequency)temp_obj1.getFrequency(); 1510 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1511 { 1512 newObject = false; 1513 temp_obj2.addQuery(obj1); 1514 break; 1515 } 1516 } 1517 if (newObject) 1518 { 1519 obj2.initQuerys(); 1520 obj2.addQuery(obj1); 1521 } 1522 results.add(obj1); 1523 } 1524 return results; 1525 } 1526 1527 1528 1529 1530 1531 1532 1533 1534 1545 protected static List doSelectJoinAllExceptScarabUserImpl(Criteria criteria) 1546 throws TorqueException 1547 { 1548 setDbName(criteria); 1549 1550 addSelectColumns(criteria); 1551 int offset2 = numColumns + 1; 1552 1553 1554 ScopePeer.addSelectColumns(criteria); 1555 int offset3 = offset2 + ScopePeer.numColumns; 1556 1557 ScarabModulePeer.addSelectColumns(criteria); 1558 int offset4 = offset3 + ScarabModulePeer.numColumns; 1559 1560 IssueTypePeer.addSelectColumns(criteria); 1561 int offset5 = offset4 + IssueTypePeer.numColumns; 1562 1563 MITListPeer.addSelectColumns(criteria); 1564 int offset6 = offset5 + MITListPeer.numColumns; 1565 1566 FrequencyPeer.addSelectColumns(criteria); 1567 int offset7 = offset6 + FrequencyPeer.numColumns; 1568 if (criteria.containsKey(DELETED)) 1570 { 1571 Object possibleBoolean = criteria.get(DELETED); 1572 if (possibleBoolean instanceof Boolean ) 1573 { 1574 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1575 } 1576 } 1577 if (criteria.containsKey(APPROVED)) 1579 { 1580 Object possibleBoolean = criteria.get(APPROVED); 1581 if (possibleBoolean instanceof Boolean ) 1582 { 1583 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1584 } 1585 } 1586 if (criteria.containsKey(HOME_PAGE)) 1588 { 1589 Object possibleBoolean = criteria.get(HOME_PAGE); 1590 if (possibleBoolean instanceof Boolean ) 1591 { 1592 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1593 } 1594 } 1595 1596 List rows = BasePeer.doSelect(criteria); 1597 List results = new ArrayList (); 1598 1599 for (int i = 0; i < rows.size(); i++) 1600 { 1601 Record row = (Record)rows.get(i); 1602 1603 Class omClass = QueryPeer.getOMClass(); 1604 Query obj1 = (Query)QueryPeer 1605 .row2Object(row, 1, omClass); 1606 1607 1608 1609 1610 1611 omClass = ScopePeer.getOMClass(); 1612 Scope obj2 = (Scope)ScopePeer 1613 .row2Object( row, offset2, omClass); 1614 1615 boolean newObject = true; 1616 for (int j = 0; j < results.size(); j++) 1617 { 1618 Query temp_obj1 = (Query)results.get(j); 1619 Scope temp_obj2 = (Scope)temp_obj1.getScope(); 1620 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1621 { 1622 newObject = false; 1623 temp_obj2.addQuery(obj1); 1624 break; 1625 } 1626 } 1627 if (newObject) 1628 { 1629 obj2.initQuerys(); 1630 obj2.addQuery(obj1); 1631 } 1632 1633 1634 1635 1636 omClass = ScarabModulePeer.getOMClass(row, offset3); 1637 ScarabModule obj3 = (ScarabModule)ScarabModulePeer 1638 .row2Object( row, offset3, omClass); 1639 1640 newObject = true; 1641 for (int j = 0; j < results.size(); j++) 1642 { 1643 Query temp_obj1 = (Query)results.get(j); 1644 ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule(); 1645 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1646 { 1647 newObject = false; 1648 temp_obj3.addQuery(obj1); 1649 break; 1650 } 1651 } 1652 if (newObject) 1653 { 1654 obj3.initQuerys(); 1655 obj3.addQuery(obj1); 1656 } 1657 1658 1659 1660 1661 omClass = IssueTypePeer.getOMClass(); 1662 IssueType obj4 = (IssueType)IssueTypePeer 1663 .row2Object( row, offset4, omClass); 1664 1665 newObject = true; 1666 for (int j = 0; j < results.size(); j++) 1667 { 1668 Query temp_obj1 = (Query)results.get(j); 1669 IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType(); 1670 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1671 { 1672 newObject = false; 1673 temp_obj4.addQuery(obj1); 1674 break; 1675 } 1676 } 1677 if (newObject) 1678 { 1679 obj4.initQuerys(); 1680 obj4.addQuery(obj1); 1681 } 1682 1683 1684 1685 1686 omClass = MITListPeer.getOMClass(); 1687 MITList obj5 = (MITList)MITListPeer 1688 .row2Object( row, offset5, omClass); 1689 1690 newObject = true; 1691 for (int j = 0; j < results.size(); j++) 1692 { 1693 Query temp_obj1 = (Query)results.get(j); 1694 MITList temp_obj5 = (MITList)temp_obj1.getMITList(); 1695 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1696 { 1697 newObject = false; 1698 temp_obj5.addQuery(obj1); 1699 break; 1700 } 1701 } 1702 if (newObject) 1703 { 1704 obj5.initQuerys(); 1705 obj5.addQuery(obj1); 1706 } 1707 1708 1709 1710 1711 omClass = FrequencyPeer.getOMClass(); 1712 Frequency obj6 = (Frequency)FrequencyPeer 1713 .row2Object( row, offset6, omClass); 1714 1715 newObject = true; 1716 for (int j = 0; j < results.size(); j++) 1717 { 1718 Query temp_obj1 = (Query)results.get(j); 1719 Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency(); 1720 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 1721 { 1722 newObject = false; 1723 temp_obj6.addQuery(obj1); 1724 break; 1725 } 1726 } 1727 if (newObject) 1728 { 1729 obj6.initQuerys(); 1730 obj6.addQuery(obj1); 1731 } 1732 results.add(obj1); 1733 } 1734 return results; 1735 } 1736 1737 1738 1739 1740 1741 1752 protected static List doSelectJoinAllExceptScope(Criteria criteria) 1753 throws TorqueException 1754 { 1755 setDbName(criteria); 1756 1757 addSelectColumns(criteria); 1758 int offset2 = numColumns + 1; 1759 1760 ScarabUserImplPeer.addSelectColumns(criteria); 1761 int offset3 = offset2 + ScarabUserImplPeer.numColumns; 1762 1763 1764 ScarabModulePeer.addSelectColumns(criteria); 1765 int offset4 = offset3 + ScarabModulePeer.numColumns; 1766 1767 IssueTypePeer.addSelectColumns(criteria); 1768 int offset5 = offset4 + IssueTypePeer.numColumns; 1769 1770 MITListPeer.addSelectColumns(criteria); 1771 int offset6 = offset5 + MITListPeer.numColumns; 1772 1773 FrequencyPeer.addSelectColumns(criteria); 1774 int offset7 = offset6 + FrequencyPeer.numColumns; 1775 if (criteria.containsKey(DELETED)) 1777 { 1778 Object possibleBoolean = criteria.get(DELETED); 1779 if (possibleBoolean instanceof Boolean ) 1780 { 1781 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1782 } 1783 } 1784 if (criteria.containsKey(APPROVED)) 1786 { 1787 Object possibleBoolean = criteria.get(APPROVED); 1788 if (possibleBoolean instanceof Boolean ) 1789 { 1790 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1791 } 1792 } 1793 if (criteria.containsKey(HOME_PAGE)) 1795 { 1796 Object possibleBoolean = criteria.get(HOME_PAGE); 1797 if (possibleBoolean instanceof Boolean ) 1798 { 1799 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1800 } 1801 } 1802 1803 List rows = BasePeer.doSelect(criteria); 1804 List results = new ArrayList (); 1805 1806 for (int i = 0; i < rows.size(); i++) 1807 { 1808 Record row = (Record)rows.get(i); 1809 1810 Class omClass = QueryPeer.getOMClass(); 1811 Query obj1 = (Query)QueryPeer 1812 .row2Object(row, 1, omClass); 1813 1814 1815 1816 1817 omClass = ScarabUserImplPeer.getOMClass(); 1818 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 1819 .row2Object( row, offset2, omClass); 1820 1821 boolean newObject = true; 1822 for (int j = 0; j < results.size(); j++) 1823 { 1824 Query temp_obj1 = (Query)results.get(j); 1825 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 1826 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1827 { 1828 newObject = false; 1829 temp_obj2.addQuery(obj1); 1830 break; 1831 } 1832 } 1833 if (newObject) 1834 { 1835 obj2.initQuerys(); 1836 obj2.addQuery(obj1); 1837 } 1838 1839 1840 1841 1842 1843 omClass = ScarabModulePeer.getOMClass(row, offset3); 1844 ScarabModule obj3 = (ScarabModule)ScarabModulePeer 1845 .row2Object( row, offset3, omClass); 1846 1847 newObject = true; 1848 for (int j = 0; j < results.size(); j++) 1849 { 1850 Query temp_obj1 = (Query)results.get(j); 1851 ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule(); 1852 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1853 { 1854 newObject = false; 1855 temp_obj3.addQuery(obj1); 1856 break; 1857 } 1858 } 1859 if (newObject) 1860 { 1861 obj3.initQuerys(); 1862 obj3.addQuery(obj1); 1863 } 1864 1865 1866 1867 1868 omClass = IssueTypePeer.getOMClass(); 1869 IssueType obj4 = (IssueType)IssueTypePeer 1870 .row2Object( row, offset4, omClass); 1871 1872 newObject = true; 1873 for (int j = 0; j < results.size(); j++) 1874 { 1875 Query temp_obj1 = (Query)results.get(j); 1876 IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType(); 1877 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1878 { 1879 newObject = false; 1880 temp_obj4.addQuery(obj1); 1881 break; 1882 } 1883 } 1884 if (newObject) 1885 { 1886 obj4.initQuerys(); 1887 obj4.addQuery(obj1); 1888 } 1889 1890 1891 1892 1893 omClass = MITListPeer.getOMClass(); 1894 MITList obj5 = (MITList)MITListPeer 1895 .row2Object( row, offset5, omClass); 1896 1897 newObject = true; 1898 for (int j = 0; j < results.size(); j++) 1899 { 1900 Query temp_obj1 = (Query)results.get(j); 1901 MITList temp_obj5 = (MITList)temp_obj1.getMITList(); 1902 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1903 { 1904 newObject = false; 1905 temp_obj5.addQuery(obj1); 1906 break; 1907 } 1908 } 1909 if (newObject) 1910 { 1911 obj5.initQuerys(); 1912 obj5.addQuery(obj1); 1913 } 1914 1915 1916 1917 1918 omClass = FrequencyPeer.getOMClass(); 1919 Frequency obj6 = (Frequency)FrequencyPeer 1920 .row2Object( row, offset6, omClass); 1921 1922 newObject = true; 1923 for (int j = 0; j < results.size(); j++) 1924 { 1925 Query temp_obj1 = (Query)results.get(j); 1926 Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency(); 1927 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 1928 { 1929 newObject = false; 1930 temp_obj6.addQuery(obj1); 1931 break; 1932 } 1933 } 1934 if (newObject) 1935 { 1936 obj6.initQuerys(); 1937 obj6.addQuery(obj1); 1938 } 1939 results.add(obj1); 1940 } 1941 return results; 1942 } 1943 1944 1945 1946 1947 1948 1959 protected static List doSelectJoinAllExceptScarabModule(Criteria criteria) 1960 throws TorqueException 1961 { 1962 setDbName(criteria); 1963 1964 addSelectColumns(criteria); 1965 int offset2 = numColumns + 1; 1966 1967 ScarabUserImplPeer.addSelectColumns(criteria); 1968 int offset3 = offset2 + ScarabUserImplPeer.numColumns; 1969 1970 ScopePeer.addSelectColumns(criteria); 1971 int offset4 = offset3 + ScopePeer.numColumns; 1972 1973 1974 IssueTypePeer.addSelectColumns(criteria); 1975 int offset5 = offset4 + IssueTypePeer.numColumns; 1976 1977 MITListPeer.addSelectColumns(criteria); 1978 int offset6 = offset5 + MITListPeer.numColumns; 1979 1980 FrequencyPeer.addSelectColumns(criteria); 1981 int offset7 = offset6 + FrequencyPeer.numColumns; 1982 if (criteria.containsKey(DELETED)) 1984 { 1985 Object possibleBoolean = criteria.get(DELETED); 1986 if (possibleBoolean instanceof Boolean ) 1987 { 1988 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1989 } 1990 } 1991 if (criteria.containsKey(APPROVED)) 1993 { 1994 Object possibleBoolean = criteria.get(APPROVED); 1995 if (possibleBoolean instanceof Boolean ) 1996 { 1997 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 1998 } 1999 } 2000 if (criteria.containsKey(HOME_PAGE)) 2002 { 2003 Object possibleBoolean = criteria.get(HOME_PAGE); 2004 if (possibleBoolean instanceof Boolean ) 2005 { 2006 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2007 } 2008 } 2009 2010 List rows = BasePeer.doSelect(criteria); 2011 List results = new ArrayList (); 2012 2013 for (int i = 0; i < rows.size(); i++) 2014 { 2015 Record row = (Record)rows.get(i); 2016 2017 Class omClass = QueryPeer.getOMClass(); 2018 Query obj1 = (Query)QueryPeer 2019 .row2Object(row, 1, omClass); 2020 2021 2022 2023 2024 omClass = ScarabUserImplPeer.getOMClass(); 2025 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 2026 .row2Object( row, offset2, omClass); 2027 2028 boolean newObject = true; 2029 for (int j = 0; j < results.size(); j++) 2030 { 2031 Query temp_obj1 = (Query)results.get(j); 2032 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 2033 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2034 { 2035 newObject = false; 2036 temp_obj2.addQuery(obj1); 2037 break; 2038 } 2039 } 2040 if (newObject) 2041 { 2042 obj2.initQuerys(); 2043 obj2.addQuery(obj1); 2044 } 2045 2046 2047 2048 2049 omClass = ScopePeer.getOMClass(); 2050 Scope obj3 = (Scope)ScopePeer 2051 .row2Object( row, offset3, omClass); 2052 2053 newObject = true; 2054 for (int j = 0; j < results.size(); j++) 2055 { 2056 Query temp_obj1 = (Query)results.get(j); 2057 Scope temp_obj3 = (Scope)temp_obj1.getScope(); 2058 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2059 { 2060 newObject = false; 2061 temp_obj3.addQuery(obj1); 2062 break; 2063 } 2064 } 2065 if (newObject) 2066 { 2067 obj3.initQuerys(); 2068 obj3.addQuery(obj1); 2069 } 2070 2071 2072 2073 2074 2075 omClass = IssueTypePeer.getOMClass(); 2076 IssueType obj4 = (IssueType)IssueTypePeer 2077 .row2Object( row, offset4, omClass); 2078 2079 newObject = true; 2080 for (int j = 0; j < results.size(); j++) 2081 { 2082 Query temp_obj1 = (Query)results.get(j); 2083 IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType(); 2084 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2085 { 2086 newObject = false; 2087 temp_obj4.addQuery(obj1); 2088 break; 2089 } 2090 } 2091 if (newObject) 2092 { 2093 obj4.initQuerys(); 2094 obj4.addQuery(obj1); 2095 } 2096 2097 2098 2099 2100 omClass = MITListPeer.getOMClass(); 2101 MITList obj5 = (MITList)MITListPeer 2102 .row2Object( row, offset5, omClass); 2103 2104 newObject = true; 2105 for (int j = 0; j < results.size(); j++) 2106 { 2107 Query temp_obj1 = (Query)results.get(j); 2108 MITList temp_obj5 = (MITList)temp_obj1.getMITList(); 2109 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2110 { 2111 newObject = false; 2112 temp_obj5.addQuery(obj1); 2113 break; 2114 } 2115 } 2116 if (newObject) 2117 { 2118 obj5.initQuerys(); 2119 obj5.addQuery(obj1); 2120 } 2121 2122 2123 2124 2125 omClass = FrequencyPeer.getOMClass(); 2126 Frequency obj6 = (Frequency)FrequencyPeer 2127 .row2Object( row, offset6, omClass); 2128 2129 newObject = true; 2130 for (int j = 0; j < results.size(); j++) 2131 { 2132 Query temp_obj1 = (Query)results.get(j); 2133 Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency(); 2134 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2135 { 2136 newObject = false; 2137 temp_obj6.addQuery(obj1); 2138 break; 2139 } 2140 } 2141 if (newObject) 2142 { 2143 obj6.initQuerys(); 2144 obj6.addQuery(obj1); 2145 } 2146 results.add(obj1); 2147 } 2148 return results; 2149 } 2150 2151 2152 2153 2154 2155 2166 protected static List doSelectJoinAllExceptIssueType(Criteria criteria) 2167 throws TorqueException 2168 { 2169 setDbName(criteria); 2170 2171 addSelectColumns(criteria); 2172 int offset2 = numColumns + 1; 2173 2174 ScarabUserImplPeer.addSelectColumns(criteria); 2175 int offset3 = offset2 + ScarabUserImplPeer.numColumns; 2176 2177 ScopePeer.addSelectColumns(criteria); 2178 int offset4 = offset3 + ScopePeer.numColumns; 2179 2180 ScarabModulePeer.addSelectColumns(criteria); 2181 int offset5 = offset4 + ScarabModulePeer.numColumns; 2182 2183 2184 MITListPeer.addSelectColumns(criteria); 2185 int offset6 = offset5 + MITListPeer.numColumns; 2186 2187 FrequencyPeer.addSelectColumns(criteria); 2188 int offset7 = offset6 + FrequencyPeer.numColumns; 2189 if (criteria.containsKey(DELETED)) 2191 { 2192 Object possibleBoolean = criteria.get(DELETED); 2193 if (possibleBoolean instanceof Boolean ) 2194 { 2195 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2196 } 2197 } 2198 if (criteria.containsKey(APPROVED)) 2200 { 2201 Object possibleBoolean = criteria.get(APPROVED); 2202 if (possibleBoolean instanceof Boolean ) 2203 { 2204 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2205 } 2206 } 2207 if (criteria.containsKey(HOME_PAGE)) 2209 { 2210 Object possibleBoolean = criteria.get(HOME_PAGE); 2211 if (possibleBoolean instanceof Boolean ) 2212 { 2213 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2214 } 2215 } 2216 2217 List rows = BasePeer.doSelect(criteria); 2218 List results = new ArrayList (); 2219 2220 for (int i = 0; i < rows.size(); i++) 2221 { 2222 Record row = (Record)rows.get(i); 2223 2224 Class omClass = QueryPeer.getOMClass(); 2225 Query obj1 = (Query)QueryPeer 2226 .row2Object(row, 1, omClass); 2227 2228 2229 2230 2231 omClass = ScarabUserImplPeer.getOMClass(); 2232 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 2233 .row2Object( row, offset2, omClass); 2234 2235 boolean newObject = true; 2236 for (int j = 0; j < results.size(); j++) 2237 { 2238 Query temp_obj1 = (Query)results.get(j); 2239 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 2240 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2241 { 2242 newObject = false; 2243 temp_obj2.addQuery(obj1); 2244 break; 2245 } 2246 } 2247 if (newObject) 2248 { 2249 obj2.initQuerys(); 2250 obj2.addQuery(obj1); 2251 } 2252 2253 2254 2255 2256 omClass = ScopePeer.getOMClass(); 2257 Scope obj3 = (Scope)ScopePeer 2258 .row2Object( row, offset3, omClass); 2259 2260 newObject = true; 2261 for (int j = 0; j < results.size(); j++) 2262 { 2263 Query temp_obj1 = (Query)results.get(j); 2264 Scope temp_obj3 = (Scope)temp_obj1.getScope(); 2265 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2266 { 2267 newObject = false; 2268 temp_obj3.addQuery(obj1); 2269 break; 2270 } 2271 } 2272 if (newObject) 2273 { 2274 obj3.initQuerys(); 2275 obj3.addQuery(obj1); 2276 } 2277 2278 2279 2280 2281 omClass = ScarabModulePeer.getOMClass(row, offset4); 2282 ScarabModule obj4 = (ScarabModule)ScarabModulePeer 2283 .row2Object( row, offset4, omClass); 2284 2285 newObject = true; 2286 for (int j = 0; j < results.size(); j++) 2287 { 2288 Query temp_obj1 = (Query)results.get(j); 2289 ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule(); 2290 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2291 { 2292 newObject = false; 2293 temp_obj4.addQuery(obj1); 2294 break; 2295 } 2296 } 2297 if (newObject) 2298 { 2299 obj4.initQuerys(); 2300 obj4.addQuery(obj1); 2301 } 2302 2303 2304 2305 2306 2307 omClass = MITListPeer.getOMClass(); 2308 MITList obj5 = (MITList)MITListPeer 2309 .row2Object( row, offset5, omClass); 2310 2311 newObject = true; 2312 for (int j = 0; j < results.size(); j++) 2313 { 2314 Query temp_obj1 = (Query)results.get(j); 2315 MITList temp_obj5 = (MITList)temp_obj1.getMITList(); 2316 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2317 { 2318 newObject = false; 2319 temp_obj5.addQuery(obj1); 2320 break; 2321 } 2322 } 2323 if (newObject) 2324 { 2325 obj5.initQuerys(); 2326 obj5.addQuery(obj1); 2327 } 2328 2329 2330 2331 2332 omClass = FrequencyPeer.getOMClass(); 2333 Frequency obj6 = (Frequency)FrequencyPeer 2334 .row2Object( row, offset6, omClass); 2335 2336 newObject = true; 2337 for (int j = 0; j < results.size(); j++) 2338 { 2339 Query temp_obj1 = (Query)results.get(j); 2340 Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency(); 2341 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2342 { 2343 newObject = false; 2344 temp_obj6.addQuery(obj1); 2345 break; 2346 } 2347 } 2348 if (newObject) 2349 { 2350 obj6.initQuerys(); 2351 obj6.addQuery(obj1); 2352 } 2353 results.add(obj1); 2354 } 2355 return results; 2356 } 2357 2358 2359 2360 2361 2362 2373 protected static List doSelectJoinAllExceptMITList(Criteria criteria) 2374 throws TorqueException 2375 { 2376 setDbName(criteria); 2377 2378 addSelectColumns(criteria); 2379 int offset2 = numColumns + 1; 2380 2381 ScarabUserImplPeer.addSelectColumns(criteria); 2382 int offset3 = offset2 + ScarabUserImplPeer.numColumns; 2383 2384 ScopePeer.addSelectColumns(criteria); 2385 int offset4 = offset3 + ScopePeer.numColumns; 2386 2387 ScarabModulePeer.addSelectColumns(criteria); 2388 int offset5 = offset4 + ScarabModulePeer.numColumns; 2389 2390 IssueTypePeer.addSelectColumns(criteria); 2391 int offset6 = offset5 + IssueTypePeer.numColumns; 2392 2393 2394 FrequencyPeer.addSelectColumns(criteria); 2395 int offset7 = offset6 + FrequencyPeer.numColumns; 2396 if (criteria.containsKey(DELETED)) 2398 { 2399 Object possibleBoolean = criteria.get(DELETED); 2400 if (possibleBoolean instanceof Boolean ) 2401 { 2402 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2403 } 2404 } 2405 if (criteria.containsKey(APPROVED)) 2407 { 2408 Object possibleBoolean = criteria.get(APPROVED); 2409 if (possibleBoolean instanceof Boolean ) 2410 { 2411 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2412 } 2413 } 2414 if (criteria.containsKey(HOME_PAGE)) 2416 { 2417 Object possibleBoolean = criteria.get(HOME_PAGE); 2418 if (possibleBoolean instanceof Boolean ) 2419 { 2420 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2421 } 2422 } 2423 2424 List rows = BasePeer.doSelect(criteria); 2425 List results = new ArrayList (); 2426 2427 for (int i = 0; i < rows.size(); i++) 2428 { 2429 Record row = (Record)rows.get(i); 2430 2431 Class omClass = QueryPeer.getOMClass(); 2432 Query obj1 = (Query)QueryPeer 2433 .row2Object(row, 1, omClass); 2434 2435 2436 2437 2438 omClass = ScarabUserImplPeer.getOMClass(); 2439 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 2440 .row2Object( row, offset2, omClass); 2441 2442 boolean newObject = true; 2443 for (int j = 0; j < results.size(); j++) 2444 { 2445 Query temp_obj1 = (Query)results.get(j); 2446 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 2447 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2448 { 2449 newObject = false; 2450 temp_obj2.addQuery(obj1); 2451 break; 2452 } 2453 } 2454 if (newObject) 2455 { 2456 obj2.initQuerys(); 2457 obj2.addQuery(obj1); 2458 } 2459 2460 2461 2462 2463 omClass = ScopePeer.getOMClass(); 2464 Scope obj3 = (Scope)ScopePeer 2465 .row2Object( row, offset3, omClass); 2466 2467 newObject = true; 2468 for (int j = 0; j < results.size(); j++) 2469 { 2470 Query temp_obj1 = (Query)results.get(j); 2471 Scope temp_obj3 = (Scope)temp_obj1.getScope(); 2472 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2473 { 2474 newObject = false; 2475 temp_obj3.addQuery(obj1); 2476 break; 2477 } 2478 } 2479 if (newObject) 2480 { 2481 obj3.initQuerys(); 2482 obj3.addQuery(obj1); 2483 } 2484 2485 2486 2487 2488 omClass = ScarabModulePeer.getOMClass(row, offset4); 2489 ScarabModule obj4 = (ScarabModule)ScarabModulePeer 2490 .row2Object( row, offset4, omClass); 2491 2492 newObject = true; 2493 for (int j = 0; j < results.size(); j++) 2494 { 2495 Query temp_obj1 = (Query)results.get(j); 2496 ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule(); 2497 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2498 { 2499 newObject = false; 2500 temp_obj4.addQuery(obj1); 2501 break; 2502 } 2503 } 2504 if (newObject) 2505 { 2506 obj4.initQuerys(); 2507 obj4.addQuery(obj1); 2508 } 2509 2510 2511 2512 2513 omClass = IssueTypePeer.getOMClass(); 2514 IssueType obj5 = (IssueType)IssueTypePeer 2515 .row2Object( row, offset5, omClass); 2516 2517 newObject = true; 2518 for (int j = 0; j < results.size(); j++) 2519 { 2520 Query temp_obj1 = (Query)results.get(j); 2521 IssueType temp_obj5 = (IssueType)temp_obj1.getIssueType(); 2522 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2523 { 2524 newObject = false; 2525 temp_obj5.addQuery(obj1); 2526 break; 2527 } 2528 } 2529 if (newObject) 2530 { 2531 obj5.initQuerys(); 2532 obj5.addQuery(obj1); 2533 } 2534 2535 2536 2537 2538 2539 omClass = FrequencyPeer.getOMClass(); 2540 Frequency obj6 = (Frequency)FrequencyPeer 2541 .row2Object( row, offset6, omClass); 2542 2543 newObject = true; 2544 for (int j = 0; j < results.size(); j++) 2545 { 2546 Query temp_obj1 = (Query)results.get(j); 2547 Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency(); 2548 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2549 { 2550 newObject = false; 2551 temp_obj6.addQuery(obj1); 2552 break; 2553 } 2554 } 2555 if (newObject) 2556 { 2557 obj6.initQuerys(); 2558 obj6.addQuery(obj1); 2559 } 2560 results.add(obj1); 2561 } 2562 return results; 2563 } 2564 2565 2566 2567 2568 2569 2580 protected static List doSelectJoinAllExceptFrequency(Criteria criteria) 2581 throws TorqueException 2582 { 2583 setDbName(criteria); 2584 2585 addSelectColumns(criteria); 2586 int offset2 = numColumns + 1; 2587 2588 ScarabUserImplPeer.addSelectColumns(criteria); 2589 int offset3 = offset2 + ScarabUserImplPeer.numColumns; 2590 2591 ScopePeer.addSelectColumns(criteria); 2592 int offset4 = offset3 + ScopePeer.numColumns; 2593 2594 ScarabModulePeer.addSelectColumns(criteria); 2595 int offset5 = offset4 + ScarabModulePeer.numColumns; 2596 2597 IssueTypePeer.addSelectColumns(criteria); 2598 int offset6 = offset5 + IssueTypePeer.numColumns; 2599 2600 MITListPeer.addSelectColumns(criteria); 2601 int offset7 = offset6 + MITListPeer.numColumns; 2602 2603 if (criteria.containsKey(DELETED)) 2605 { 2606 Object possibleBoolean = criteria.get(DELETED); 2607 if (possibleBoolean instanceof Boolean ) 2608 { 2609 criteria.add(DELETED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2610 } 2611 } 2612 if (criteria.containsKey(APPROVED)) 2614 { 2615 Object possibleBoolean = criteria.get(APPROVED); 2616 if (possibleBoolean instanceof Boolean ) 2617 { 2618 criteria.add(APPROVED, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2619 } 2620 } 2621 if (criteria.containsKey(HOME_PAGE)) 2623 { 2624 Object possibleBoolean = criteria.get(HOME_PAGE); 2625 if (possibleBoolean instanceof Boolean ) 2626 { 2627 criteria.add(HOME_PAGE, ((Boolean ) possibleBoolean).booleanValue() ? 1 : 0); 2628 } 2629 } 2630 2631 List rows = BasePeer.doSelect(criteria); 2632 List results = new ArrayList (); 2633 2634 for (int i = 0; i < rows.size(); i++) 2635 { 2636 Record row = (Record)rows.get(i); 2637 2638 Class omClass = QueryPeer.getOMClass(); 2639 Query obj1 = (Query)QueryPeer 2640 .row2Object(row, 1, omClass); 2641 2642 2643 2644 2645 omClass = ScarabUserImplPeer.getOMClass(); 2646 ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer 2647 .row2Object( row, offset2, omClass); 2648 2649 boolean newObject = true; 2650 for (int j = 0; j < results.size(); j++) 2651 { 2652 Query temp_obj1 = (Query)results.get(j); 2653 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser(); 2654 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2655 { 2656 newObject = false; 2657 temp_obj2.addQuery(obj1); 2658 break; 2659 } 2660 } 2661 if (newObject) 2662 { 2663 obj2.initQuerys(); 2664 obj2.addQuery(obj1); 2665 } 2666 2667 2668 2669 2670 omClass = ScopePeer.getOMClass(); 2671 Scope obj3 = (Scope)ScopePeer 2672 .row2Object( row, offset3, omClass); 2673 2674 newObject = true; 2675 for (int j = 0; j < results.size(); j++) 2676 { 2677 Query temp_obj1 = (Query)results.get(j); 2678 Scope temp_obj3 = (Scope)temp_obj1.getScope(); 2679 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2680 { 2681 newObject = false; 2682 temp_obj3.addQuery(obj1); 2683 break; 2684 } 2685 } 2686 if (newObject) 2687 { 2688 obj3.initQuerys(); 2689 obj3.addQuery(obj1); 2690 } 2691 2692 2693 2694 2695 omClass = ScarabModulePeer.getOMClass(row, offset4); 2696 ScarabModule obj4 = (ScarabModule)ScarabModulePeer 2697 .row2Object( row, offset4, omClass); 2698 2699 newObject = true; 2700 for (int j = 0; j < results.size(); j++) 2701 { 2702 Query temp_obj1 = (Query)results.get(j); 2703 ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule(); 2704 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2705 { 2706 newObject = false; 2707 temp_obj4.addQuery(obj1); 2708 break; 2709 } 2710 } 2711 if (newObject) 2712 { 2713 obj4.initQuerys(); 2714 obj4.addQuery(obj1); 2715 } 2716 2717 2718 2719 2720 omClass = IssueTypePeer.getOMClass(); 2721 IssueType obj5 = (IssueType)IssueTypePeer 2722 .row2Object( row, offset5, omClass); 2723 2724 newObject = true; 2725 for (int j = 0; j < results.size(); j++) 2726 { 2727 Query temp_obj1 = (Query)results.get(j); 2728 IssueType temp_obj5 = (IssueType)temp_obj1.getIssueType(); 2729 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2730 { 2731 newObject = false; 2732 temp_obj5.addQuery(obj1); 2733 break; 2734 } 2735 } 2736 if (newObject) 2737 { 2738 obj5.initQuerys(); 2739 obj5.addQuery(obj1); 2740 } 2741 2742 2743 2744 2745 omClass = MITListPeer.getOMClass(); 2746 MITList obj6 = (MITList)MITListPeer 2747 .row2Object( row, offset6, omClass); 2748 2749 newObject = true; 2750 for (int j = 0; j < results.size(); j++) 2751 { 2752 Query temp_obj1 = (Query)results.get(j); 2753 MITList temp_obj6 = (MITList)temp_obj1.getMITList(); 2754 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2755 { 2756 newObject = false; 2757 temp_obj6.addQuery(obj1); 2758 break; 2759 } 2760 } 2761 if (newObject) 2762 { 2763 obj6.initQuerys(); 2764 obj6.addQuery(obj1); 2765 } 2766 2767 results.add(obj1); 2768 } 2769 return results; 2770 } 2771 2772 2773 2780 protected static TableMap getTableMap() 2781 throws TorqueException 2782 { 2783 return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME); 2784 } 2785 2786 private static void setDbName(Criteria crit) 2787 { 2788 if (crit.getDbName() == Torque.getDefaultDB()) 2792 { 2793 crit.setDbName(DATABASE_NAME); 2794 } 2795 } 2796} 2797 | Popular Tags |