1 package org.campware.cream.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.campware.cream.om.map.*; 32 33 34 35 36 37 38 39 40 46 public abstract class BasePrintSubscriptionPeer 47 extends BasePeer 48 { 49 50 51 public static final String DATABASE_NAME = "cream"; 52 53 54 public static final String TABLE_NAME = "PRINT_SUBSCRIPTION"; 55 56 61 public static MapBuilder getMapBuilder() 62 throws TorqueException 63 { 64 return getMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME); 65 } 66 67 68 public static final String PRINT_SUBS_ID; 69 70 public static final String PRINT_SUBS_CODE; 71 72 public static final String STATUS; 73 74 public static final String PRIORITY; 75 76 public static final String ISSUED_DATE; 77 78 public static final String CLOSED_DATE; 79 80 public static final String SORDER_ID; 81 82 public static final String CUSTOMER_ID; 83 84 public static final String RECIPIENT_ID; 85 86 public static final String CARRIER_ID; 87 88 public static final String PROJECT_ID; 89 90 public static final String PRODUCT_ID; 91 92 public static final String QUANTITY; 93 94 public static final String START_DATE; 95 96 public static final String END_DATE; 97 98 public static final String SUBJECT; 99 100 public static final String NOTES; 101 102 public static final String CREATED; 103 104 public static final String MODIFIED; 105 106 public static final String CREATED_BY; 107 108 public static final String MODIFIED_BY; 109 110 static 111 { 112 PRINT_SUBS_ID = "PRINT_SUBSCRIPTION.PRINT_SUBS_ID"; 113 PRINT_SUBS_CODE = "PRINT_SUBSCRIPTION.PRINT_SUBS_CODE"; 114 STATUS = "PRINT_SUBSCRIPTION.STATUS"; 115 PRIORITY = "PRINT_SUBSCRIPTION.PRIORITY"; 116 ISSUED_DATE = "PRINT_SUBSCRIPTION.ISSUED_DATE"; 117 CLOSED_DATE = "PRINT_SUBSCRIPTION.CLOSED_DATE"; 118 SORDER_ID = "PRINT_SUBSCRIPTION.SORDER_ID"; 119 CUSTOMER_ID = "PRINT_SUBSCRIPTION.CUSTOMER_ID"; 120 RECIPIENT_ID = "PRINT_SUBSCRIPTION.RECIPIENT_ID"; 121 CARRIER_ID = "PRINT_SUBSCRIPTION.CARRIER_ID"; 122 PROJECT_ID = "PRINT_SUBSCRIPTION.PROJECT_ID"; 123 PRODUCT_ID = "PRINT_SUBSCRIPTION.PRODUCT_ID"; 124 QUANTITY = "PRINT_SUBSCRIPTION.QUANTITY"; 125 START_DATE = "PRINT_SUBSCRIPTION.START_DATE"; 126 END_DATE = "PRINT_SUBSCRIPTION.END_DATE"; 127 SUBJECT = "PRINT_SUBSCRIPTION.SUBJECT"; 128 NOTES = "PRINT_SUBSCRIPTION.NOTES"; 129 CREATED = "PRINT_SUBSCRIPTION.CREATED"; 130 MODIFIED = "PRINT_SUBSCRIPTION.MODIFIED"; 131 CREATED_BY = "PRINT_SUBSCRIPTION.CREATED_BY"; 132 MODIFIED_BY = "PRINT_SUBSCRIPTION.MODIFIED_BY"; 133 if (Torque.isInit()) 134 { 135 try 136 { 137 getMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME); 138 } 139 catch (Exception e) 140 { 141 log.error("Could not initialize Peer", e); 142 } 143 } 144 else 145 { 146 Torque.registerMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME); 147 } 148 } 149 150 151 public static final int numColumns = 21; 152 153 154 protected static final String CLASSNAME_DEFAULT = 155 "org.campware.cream.om.PrintSubscription"; 156 157 158 protected static final Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT); 159 160 166 private static Class initClass(String className) 167 { 168 Class c = null; 169 try 170 { 171 c = Class.forName(className); 172 } 173 catch (Throwable t) 174 { 175 log.error("A FATAL ERROR has occurred which should not " 176 + "have happened under any circumstance. Please notify " 177 + "the Torque developers <torque-dev@db.apache.org> " 178 + "and give as many details as possible (including the error " 179 + "stack trace).", t); 180 181 if (t instanceof Error ) 183 { 184 throw (Error ) t.fillInStackTrace(); 185 } 186 } 187 return c; 188 } 189 190 200 public static List resultSet2Objects(java.sql.ResultSet results) 201 throws TorqueException 202 { 203 try 204 { 205 QueryDataSet qds = null; 206 List rows = null; 207 try 208 { 209 qds = new QueryDataSet(results); 210 rows = getSelectResults(qds); 211 } 212 finally 213 { 214 if (qds != null) 215 { 216 qds.close(); 217 } 218 } 219 220 return populateObjects(rows); 221 } 222 catch (SQLException e) 223 { 224 throw new TorqueException(e); 225 } 226 catch (DataSetException e) 227 { 228 throw new TorqueException(e); 229 } 230 } 231 232 233 234 241 public static ObjectKey doInsert(Criteria criteria) 242 throws TorqueException 243 { 244 return BasePrintSubscriptionPeer 245 .doInsert(criteria, (Connection ) null); 246 } 247 248 258 public static ObjectKey doInsert(Criteria criteria, Connection con) 259 throws TorqueException 260 { 261 262 setDbName(criteria); 263 264 if (con == null) 265 { 266 return BasePeer.doInsert(criteria); 267 } 268 else 269 { 270 return BasePeer.doInsert(criteria, con); 271 } 272 } 273 274 281 public static void addSelectColumns(Criteria criteria) 282 throws TorqueException 283 { 284 criteria.addSelectColumn(PRINT_SUBS_ID); 285 criteria.addSelectColumn(PRINT_SUBS_CODE); 286 criteria.addSelectColumn(STATUS); 287 criteria.addSelectColumn(PRIORITY); 288 criteria.addSelectColumn(ISSUED_DATE); 289 criteria.addSelectColumn(CLOSED_DATE); 290 criteria.addSelectColumn(SORDER_ID); 291 criteria.addSelectColumn(CUSTOMER_ID); 292 criteria.addSelectColumn(RECIPIENT_ID); 293 criteria.addSelectColumn(CARRIER_ID); 294 criteria.addSelectColumn(PROJECT_ID); 295 criteria.addSelectColumn(PRODUCT_ID); 296 criteria.addSelectColumn(QUANTITY); 297 criteria.addSelectColumn(START_DATE); 298 criteria.addSelectColumn(END_DATE); 299 criteria.addSelectColumn(SUBJECT); 300 criteria.addSelectColumn(NOTES); 301 criteria.addSelectColumn(CREATED); 302 criteria.addSelectColumn(MODIFIED); 303 criteria.addSelectColumn(CREATED_BY); 304 criteria.addSelectColumn(MODIFIED_BY); 305 } 306 307 316 public static PrintSubscription row2Object(Record row, 317 int offset, 318 Class cls) 319 throws TorqueException 320 { 321 try 322 { 323 PrintSubscription obj = (PrintSubscription) cls.newInstance(); 324 PrintSubscriptionPeer.populateObject(row, offset, obj); 325 obj.setModified(false); 326 obj.setNew(false); 327 328 return obj; 329 } 330 catch (InstantiationException e) 331 { 332 throw new TorqueException(e); 333 } 334 catch (IllegalAccessException e) 335 { 336 throw new TorqueException(e); 337 } 338 } 339 340 349 public static void populateObject(Record row, 350 int offset, 351 PrintSubscription obj) 352 throws TorqueException 353 { 354 try 355 { 356 obj.setPrintSubsId(row.getValue(offset + 0).asInt()); 357 obj.setPrintSubsCode(row.getValue(offset + 1).asString()); 358 obj.setStatus(row.getValue(offset + 2).asInt()); 359 obj.setPriority(row.getValue(offset + 3).asInt()); 360 obj.setIssuedDate(row.getValue(offset + 4).asUtilDate()); 361 obj.setClosedDate(row.getValue(offset + 5).asUtilDate()); 362 obj.setSorderId(row.getValue(offset + 6).asInt()); 363 obj.setCustomerId(row.getValue(offset + 7).asInt()); 364 obj.setRecipientId(row.getValue(offset + 8).asInt()); 365 obj.setCarrierId(row.getValue(offset + 9).asInt()); 366 obj.setProjectId(row.getValue(offset + 10).asInt()); 367 obj.setProductId(row.getValue(offset + 11).asInt()); 368 obj.setQuantity(row.getValue(offset + 12).asInt()); 369 obj.setStartDate(row.getValue(offset + 13).asUtilDate()); 370 obj.setEndDate(row.getValue(offset + 14).asUtilDate()); 371 obj.setSubject(row.getValue(offset + 15).asString()); 372 obj.setNotes(row.getValue(offset + 16).asString()); 373 obj.setCreated(row.getValue(offset + 17).asUtilDate()); 374 obj.setModified(row.getValue(offset + 18).asUtilDate()); 375 obj.setCreatedBy(row.getValue(offset + 19).asString()); 376 obj.setModifiedBy(row.getValue(offset + 20).asString()); 377 } 378 catch (DataSetException e) 379 { 380 throw new TorqueException(e); 381 } 382 } 383 384 392 public static List doSelect(Criteria criteria) throws TorqueException 393 { 394 return populateObjects(doSelectVillageRecords(criteria)); 395 } 396 397 406 public static List doSelect(Criteria criteria, Connection con) 407 throws TorqueException 408 { 409 return populateObjects(doSelectVillageRecords(criteria, con)); 410 } 411 412 422 public static List doSelectVillageRecords(Criteria criteria) 423 throws TorqueException 424 { 425 return BasePrintSubscriptionPeer 426 .doSelectVillageRecords(criteria, (Connection ) null); 427 } 428 429 438 public static List doSelectVillageRecords(Criteria criteria, Connection con) 439 throws TorqueException 440 { 441 if (criteria.getSelectColumns().size() == 0) 442 { 443 addSelectColumns(criteria); 444 } 445 446 447 setDbName(criteria); 448 449 if (con == null) 452 { 453 return BasePeer.doSelect(criteria); 454 } 455 else 456 { 457 return BasePeer.doSelect(criteria, con); 458 } 459 } 460 461 468 public static List populateObjects(List records) 469 throws TorqueException 470 { 471 List results = new ArrayList (records.size()); 472 473 for (int i = 0; i < records.size(); i++) 475 { 476 Record row = (Record) records.get(i); 477 results.add(PrintSubscriptionPeer.row2Object(row, 1, 478 PrintSubscriptionPeer.getOMClass())); 479 } 480 return results; 481 } 482 483 484 492 public static Class getOMClass() 493 throws TorqueException 494 { 495 return CLASS_DEFAULT; 496 } 497 498 506 public static void doUpdate(Criteria criteria) throws TorqueException 507 { 508 BasePrintSubscriptionPeer 509 .doUpdate(criteria, (Connection ) null); 510 } 511 512 523 public static void doUpdate(Criteria criteria, Connection con) 524 throws TorqueException 525 { 526 Criteria selectCriteria = new Criteria(DATABASE_NAME, 2); 527 selectCriteria.put(PRINT_SUBS_ID, criteria.remove(PRINT_SUBS_ID)); 528 529 setDbName(criteria); 530 531 if (con == null) 532 { 533 BasePeer.doUpdate(selectCriteria, criteria); 534 } 535 else 536 { 537 BasePeer.doUpdate(selectCriteria, criteria, con); 538 } 539 } 540 541 548 public static void doDelete(Criteria criteria) throws TorqueException 549 { 550 PrintSubscriptionPeer 551 .doDelete(criteria, (Connection ) null); 552 } 553 554 564 public static void doDelete(Criteria criteria, Connection con) 565 throws TorqueException 566 { 567 568 setDbName(criteria); 569 570 if (con == null) 571 { 572 BasePeer.doDelete(criteria); 573 } 574 else 575 { 576 BasePeer.doDelete(criteria, con); 577 } 578 } 579 580 586 public static List doSelect(PrintSubscription obj) throws TorqueException 587 { 588 return doSelect(buildSelectCriteria(obj)); 589 } 590 591 597 public static void doInsert(PrintSubscription obj) throws TorqueException 598 { 599 obj.setPrimaryKey(doInsert(buildCriteria(obj))); 600 obj.setNew(false); 601 obj.setModified(false); 602 } 603 604 609 public static void doUpdate(PrintSubscription obj) throws TorqueException 610 { 611 doUpdate(buildCriteria(obj)); 612 obj.setModified(false); 613 } 614 615 620 public static void doDelete(PrintSubscription obj) throws TorqueException 621 { 622 doDelete(buildSelectCriteria(obj)); 623 } 624 625 635 public static void doInsert(PrintSubscription obj, Connection con) 636 throws TorqueException 637 { 638 obj.setPrimaryKey(doInsert(buildCriteria(obj), con)); 639 obj.setNew(false); 640 obj.setModified(false); 641 } 642 643 653 public static void doUpdate(PrintSubscription obj, Connection con) 654 throws TorqueException 655 { 656 doUpdate(buildCriteria(obj), con); 657 obj.setModified(false); 658 } 659 660 670 public static void doDelete(PrintSubscription obj, Connection con) 671 throws TorqueException 672 { 673 doDelete(buildSelectCriteria(obj), con); 674 } 675 676 683 public static void doDelete(ObjectKey pk) throws TorqueException 684 { 685 BasePrintSubscriptionPeer 686 .doDelete(pk, (Connection ) null); 687 } 688 689 699 public static void doDelete(ObjectKey pk, Connection con) 700 throws TorqueException 701 { 702 doDelete(buildCriteria(pk), con); 703 } 704 705 706 public static Criteria buildCriteria( ObjectKey pk ) 707 { 708 Criteria criteria = new Criteria(); 709 criteria.add(PRINT_SUBS_ID, pk); 710 return criteria; 711 } 712 713 714 public static Criteria buildCriteria( PrintSubscription obj ) 715 { 716 Criteria criteria = new Criteria(DATABASE_NAME); 717 if (!obj.isNew()) 718 criteria.add(PRINT_SUBS_ID, obj.getPrintSubsId()); 719 criteria.add(PRINT_SUBS_CODE, obj.getPrintSubsCode()); 720 criteria.add(STATUS, obj.getStatus()); 721 criteria.add(PRIORITY, obj.getPriority()); 722 criteria.add(ISSUED_DATE, obj.getIssuedDate()); 723 criteria.add(CLOSED_DATE, obj.getClosedDate()); 724 criteria.add(SORDER_ID, obj.getSorderId()); 725 criteria.add(CUSTOMER_ID, obj.getCustomerId()); 726 criteria.add(RECIPIENT_ID, obj.getRecipientId()); 727 criteria.add(CARRIER_ID, obj.getCarrierId()); 728 criteria.add(PROJECT_ID, obj.getProjectId()); 729 criteria.add(PRODUCT_ID, obj.getProductId()); 730 criteria.add(QUANTITY, obj.getQuantity()); 731 criteria.add(START_DATE, obj.getStartDate()); 732 criteria.add(END_DATE, obj.getEndDate()); 733 criteria.add(SUBJECT, obj.getSubject()); 734 criteria.add(NOTES, obj.getNotes()); 735 criteria.add(CREATED, obj.getCreated()); 736 criteria.add(MODIFIED, obj.getModified()); 737 criteria.add(CREATED_BY, obj.getCreatedBy()); 738 criteria.add(MODIFIED_BY, obj.getModifiedBy()); 739 return criteria; 740 } 741 742 743 public static Criteria buildSelectCriteria( PrintSubscription obj ) 744 { 745 Criteria criteria = new Criteria(DATABASE_NAME); 746 if (!obj.isNew()) 747 criteria.add(PRINT_SUBS_ID, obj.getPrintSubsId()); 748 criteria.add(PRINT_SUBS_CODE, obj.getPrintSubsCode()); 749 criteria.add(STATUS, obj.getStatus()); 750 criteria.add(PRIORITY, obj.getPriority()); 751 criteria.add(ISSUED_DATE, obj.getIssuedDate()); 752 criteria.add(CLOSED_DATE, obj.getClosedDate()); 753 criteria.add(SORDER_ID, obj.getSorderId()); 754 criteria.add(CUSTOMER_ID, obj.getCustomerId()); 755 criteria.add(RECIPIENT_ID, obj.getRecipientId()); 756 criteria.add(CARRIER_ID, obj.getCarrierId()); 757 criteria.add(PROJECT_ID, obj.getProjectId()); 758 criteria.add(PRODUCT_ID, obj.getProductId()); 759 criteria.add(QUANTITY, obj.getQuantity()); 760 criteria.add(START_DATE, obj.getStartDate()); 761 criteria.add(END_DATE, obj.getEndDate()); 762 criteria.add(SUBJECT, obj.getSubject()); 763 criteria.add(NOTES, obj.getNotes()); 764 criteria.add(CREATED, obj.getCreated()); 765 criteria.add(MODIFIED, obj.getModified()); 766 criteria.add(CREATED_BY, obj.getCreatedBy()); 767 criteria.add(MODIFIED_BY, obj.getModifiedBy()); 768 return criteria; 769 } 770 771 772 781 public static PrintSubscription retrieveByPK(int pk) 782 throws TorqueException, NoRowsException, TooManyRowsException 783 { 784 return retrieveByPK(SimpleKey.keyFor(pk)); 785 } 786 787 797 public static PrintSubscription retrieveByPK(int pk, Connection con) 798 throws TorqueException, NoRowsException, TooManyRowsException 799 { 800 return retrieveByPK(SimpleKey.keyFor(pk), con); 801 } 802 803 812 public static PrintSubscription retrieveByPK(ObjectKey pk) 813 throws TorqueException, NoRowsException, TooManyRowsException 814 { 815 Connection db = null; 816 PrintSubscription retVal = null; 817 try 818 { 819 db = Torque.getConnection(DATABASE_NAME); 820 retVal = retrieveByPK(pk, db); 821 } 822 finally 823 { 824 Torque.closeConnection(db); 825 } 826 return(retVal); 827 } 828 829 839 public static PrintSubscription retrieveByPK(ObjectKey pk, Connection con) 840 throws TorqueException, NoRowsException, TooManyRowsException 841 { 842 Criteria criteria = buildCriteria(pk); 843 List v = doSelect(criteria, con); 844 if (v.size() == 0) 845 { 846 throw new NoRowsException("Failed to select a row."); 847 } 848 else if (v.size() > 1) 849 { 850 throw new TooManyRowsException("Failed to select only one row."); 851 } 852 else 853 { 854 return (PrintSubscription)v.get(0); 855 } 856 } 857 858 865 public static List retrieveByPKs(List pks) 866 throws TorqueException 867 { 868 Connection db = null; 869 List retVal = null; 870 try 871 { 872 db = Torque.getConnection(DATABASE_NAME); 873 retVal = retrieveByPKs(pks, db); 874 } 875 finally 876 { 877 Torque.closeConnection(db); 878 } 879 return(retVal); 880 } 881 882 890 public static List retrieveByPKs( List pks, Connection dbcon ) 891 throws TorqueException 892 { 893 List objs = null; 894 if (pks == null || pks.size() == 0) 895 { 896 objs = new LinkedList (); 897 } 898 else 899 { 900 Criteria criteria = new Criteria(); 901 criteria.addIn( PRINT_SUBS_ID, pks ); 902 objs = doSelect(criteria, dbcon); 903 } 904 return objs; 905 } 906 907 908 909 910 911 912 913 914 915 916 927 protected static List doSelectJoinCustomerRelatedByCustomerId(Criteria criteria) 928 throws TorqueException 929 { 930 setDbName(criteria); 931 932 PrintSubscriptionPeer.addSelectColumns(criteria); 933 int offset = numColumns + 1; 934 CustomerPeer.addSelectColumns(criteria); 935 936 937 criteria.addJoin(PrintSubscriptionPeer.CUSTOMER_ID, 938 CustomerPeer.CUSTOMER_ID); 939 940 941 942 List rows = BasePeer.doSelect(criteria); 943 List results = new ArrayList (); 944 945 for (int i = 0; i < rows.size(); i++) 946 { 947 Record row = (Record) rows.get(i); 948 949 Class omClass = PrintSubscriptionPeer.getOMClass(); 950 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 951 .row2Object(row, 1, omClass); 952 omClass = CustomerPeer.getOMClass(); 953 Customer obj2 = (Customer)CustomerPeer 954 .row2Object(row, offset, omClass); 955 956 boolean newObject = true; 957 for (int j = 0; j < results.size(); j++) 958 { 959 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 960 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 961 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 962 { 963 newObject = false; 964 temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 965 break; 966 } 967 } 968 if (newObject) 969 { 970 obj2.initPrintSubscriptionsRelatedByCustomerId(); 971 obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 972 } 973 results.add(obj1); 974 } 975 return results; 976 } 977 978 979 980 981 992 protected static List doSelectJoinCustomerRelatedByRecipientId(Criteria criteria) 993 throws TorqueException 994 { 995 setDbName(criteria); 996 997 PrintSubscriptionPeer.addSelectColumns(criteria); 998 int offset = numColumns + 1; 999 CustomerPeer.addSelectColumns(criteria); 1000 1001 1002 criteria.addJoin(PrintSubscriptionPeer.RECIPIENT_ID, 1003 CustomerPeer.CUSTOMER_ID); 1004 1005 1006 1007 List rows = BasePeer.doSelect(criteria); 1008 List results = new ArrayList (); 1009 1010 for (int i = 0; i < rows.size(); i++) 1011 { 1012 Record row = (Record) rows.get(i); 1013 1014 Class omClass = PrintSubscriptionPeer.getOMClass(); 1015 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 1016 .row2Object(row, 1, omClass); 1017 omClass = CustomerPeer.getOMClass(); 1018 Customer obj2 = (Customer)CustomerPeer 1019 .row2Object(row, offset, omClass); 1020 1021 boolean newObject = true; 1022 for (int j = 0; j < results.size(); j++) 1023 { 1024 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1025 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1026 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1027 { 1028 newObject = false; 1029 temp_obj2.addPrintSubscriptionRelatedByRecipientId(obj1); 1030 break; 1031 } 1032 } 1033 if (newObject) 1034 { 1035 obj2.initPrintSubscriptionsRelatedByRecipientId(); 1036 obj2.addPrintSubscriptionRelatedByRecipientId(obj1); 1037 } 1038 results.add(obj1); 1039 } 1040 return results; 1041 } 1042 1043 1044 1045 1046 1057 protected static List doSelectJoinCarrier(Criteria criteria) 1058 throws TorqueException 1059 { 1060 setDbName(criteria); 1061 1062 PrintSubscriptionPeer.addSelectColumns(criteria); 1063 int offset = numColumns + 1; 1064 CarrierPeer.addSelectColumns(criteria); 1065 1066 1067 criteria.addJoin(PrintSubscriptionPeer.CARRIER_ID, 1068 CarrierPeer.CARRIER_ID); 1069 1070 1071 1072 List rows = BasePeer.doSelect(criteria); 1073 List results = new ArrayList (); 1074 1075 for (int i = 0; i < rows.size(); i++) 1076 { 1077 Record row = (Record) rows.get(i); 1078 1079 Class omClass = PrintSubscriptionPeer.getOMClass(); 1080 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 1081 .row2Object(row, 1, omClass); 1082 omClass = CarrierPeer.getOMClass(); 1083 Carrier obj2 = (Carrier)CarrierPeer 1084 .row2Object(row, offset, omClass); 1085 1086 boolean newObject = true; 1087 for (int j = 0; j < results.size(); j++) 1088 { 1089 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1090 Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier(); 1091 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1092 { 1093 newObject = false; 1094 temp_obj2.addPrintSubscription(obj1); 1095 break; 1096 } 1097 } 1098 if (newObject) 1099 { 1100 obj2.initPrintSubscriptions(); 1101 obj2.addPrintSubscription(obj1); 1102 } 1103 results.add(obj1); 1104 } 1105 return results; 1106 } 1107 1108 1109 1110 1111 1122 protected static List doSelectJoinProject(Criteria criteria) 1123 throws TorqueException 1124 { 1125 setDbName(criteria); 1126 1127 PrintSubscriptionPeer.addSelectColumns(criteria); 1128 int offset = numColumns + 1; 1129 ProjectPeer.addSelectColumns(criteria); 1130 1131 1132 criteria.addJoin(PrintSubscriptionPeer.PROJECT_ID, 1133 ProjectPeer.PROJECT_ID); 1134 1135 1136 1137 List rows = BasePeer.doSelect(criteria); 1138 List results = new ArrayList (); 1139 1140 for (int i = 0; i < rows.size(); i++) 1141 { 1142 Record row = (Record) rows.get(i); 1143 1144 Class omClass = PrintSubscriptionPeer.getOMClass(); 1145 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 1146 .row2Object(row, 1, omClass); 1147 omClass = ProjectPeer.getOMClass(); 1148 Project obj2 = (Project)ProjectPeer 1149 .row2Object(row, offset, omClass); 1150 1151 boolean newObject = true; 1152 for (int j = 0; j < results.size(); j++) 1153 { 1154 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1155 Project temp_obj2 = (Project)temp_obj1.getProject(); 1156 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1157 { 1158 newObject = false; 1159 temp_obj2.addPrintSubscription(obj1); 1160 break; 1161 } 1162 } 1163 if (newObject) 1164 { 1165 obj2.initPrintSubscriptions(); 1166 obj2.addPrintSubscription(obj1); 1167 } 1168 results.add(obj1); 1169 } 1170 return results; 1171 } 1172 1173 1174 1175 1176 1187 protected static List doSelectJoinProduct(Criteria criteria) 1188 throws TorqueException 1189 { 1190 setDbName(criteria); 1191 1192 PrintSubscriptionPeer.addSelectColumns(criteria); 1193 int offset = numColumns + 1; 1194 ProductPeer.addSelectColumns(criteria); 1195 1196 1197 criteria.addJoin(PrintSubscriptionPeer.PRODUCT_ID, 1198 ProductPeer.PRODUCT_ID); 1199 1200 1201 1202 List rows = BasePeer.doSelect(criteria); 1203 List results = new ArrayList (); 1204 1205 for (int i = 0; i < rows.size(); i++) 1206 { 1207 Record row = (Record) rows.get(i); 1208 1209 Class omClass = PrintSubscriptionPeer.getOMClass(); 1210 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 1211 .row2Object(row, 1, omClass); 1212 omClass = ProductPeer.getOMClass(); 1213 Product obj2 = (Product)ProductPeer 1214 .row2Object(row, offset, omClass); 1215 1216 boolean newObject = true; 1217 for (int j = 0; j < results.size(); j++) 1218 { 1219 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1220 Product temp_obj2 = (Product)temp_obj1.getProduct(); 1221 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1222 { 1223 newObject = false; 1224 temp_obj2.addPrintSubscription(obj1); 1225 break; 1226 } 1227 } 1228 if (newObject) 1229 { 1230 obj2.initPrintSubscriptions(); 1231 obj2.addPrintSubscription(obj1); 1232 } 1233 results.add(obj1); 1234 } 1235 return results; 1236 } 1237 1238 1239 1240 1241 1252 protected static List doSelectJoinSorder(Criteria criteria) 1253 throws TorqueException 1254 { 1255 setDbName(criteria); 1256 1257 PrintSubscriptionPeer.addSelectColumns(criteria); 1258 int offset = numColumns + 1; 1259 SorderPeer.addSelectColumns(criteria); 1260 1261 1262 criteria.addJoin(PrintSubscriptionPeer.SORDER_ID, 1263 SorderPeer.SORDER_ID); 1264 1265 1266 1267 List rows = BasePeer.doSelect(criteria); 1268 List results = new ArrayList (); 1269 1270 for (int i = 0; i < rows.size(); i++) 1271 { 1272 Record row = (Record) rows.get(i); 1273 1274 Class omClass = PrintSubscriptionPeer.getOMClass(); 1275 PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer 1276 .row2Object(row, 1, omClass); 1277 omClass = SorderPeer.getOMClass(); 1278 Sorder obj2 = (Sorder)SorderPeer 1279 .row2Object(row, offset, omClass); 1280 1281 boolean newObject = true; 1282 for (int j = 0; j < results.size(); j++) 1283 { 1284 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1285 Sorder temp_obj2 = (Sorder)temp_obj1.getSorder(); 1286 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1287 { 1288 newObject = false; 1289 temp_obj2.addPrintSubscription(obj1); 1290 break; 1291 } 1292 } 1293 if (newObject) 1294 { 1295 obj2.initPrintSubscriptions(); 1296 obj2.addPrintSubscription(obj1); 1297 } 1298 results.add(obj1); 1299 } 1300 return results; 1301 } 1302 1303 1304 1305 1306 1307 1308 1309 1310 1321 protected static List doSelectJoinAllExceptCustomerRelatedByCustomerId(Criteria criteria) 1322 throws TorqueException 1323 { 1324 setDbName(criteria); 1325 1326 addSelectColumns(criteria); 1327 int offset2 = numColumns + 1; 1328 1329 1330 1331 CarrierPeer.addSelectColumns(criteria); 1332 int offset3 = offset2 + CarrierPeer.numColumns; 1333 1334 ProjectPeer.addSelectColumns(criteria); 1335 int offset4 = offset3 + ProjectPeer.numColumns; 1336 1337 ProductPeer.addSelectColumns(criteria); 1338 int offset5 = offset4 + ProductPeer.numColumns; 1339 1340 SorderPeer.addSelectColumns(criteria); 1341 int offset6 = offset5 + SorderPeer.numColumns; 1342 1343 List rows = BasePeer.doSelect(criteria); 1344 List results = new ArrayList (); 1345 1346 for (int i = 0; i < rows.size(); i++) 1347 { 1348 Record row = (Record)rows.get(i); 1349 1350 Class omClass = PrintSubscriptionPeer.getOMClass(); 1351 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 1352 .row2Object(row, 1, omClass); 1353 1354 1355 1356 1357 1358 1359 omClass = CarrierPeer.getOMClass(); 1360 Carrier obj2 = (Carrier)CarrierPeer 1361 .row2Object( row, offset2, omClass); 1362 1363 boolean newObject = true; 1364 for (int j = 0; j < results.size(); j++) 1365 { 1366 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1367 Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier(); 1368 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1369 { 1370 newObject = false; 1371 temp_obj2.addPrintSubscription(obj1); 1372 break; 1373 } 1374 } 1375 if (newObject) 1376 { 1377 obj2.initPrintSubscriptions(); 1378 obj2.addPrintSubscription(obj1); 1379 } 1380 1381 1382 1383 1384 omClass = ProjectPeer.getOMClass(); 1385 Project obj3 = (Project)ProjectPeer 1386 .row2Object( row, offset3, omClass); 1387 1388 newObject = true; 1389 for (int j = 0; j < results.size(); j++) 1390 { 1391 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1392 Project temp_obj3 = (Project)temp_obj1.getProject(); 1393 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1394 { 1395 newObject = false; 1396 temp_obj3.addPrintSubscription(obj1); 1397 break; 1398 } 1399 } 1400 if (newObject) 1401 { 1402 obj3.initPrintSubscriptions(); 1403 obj3.addPrintSubscription(obj1); 1404 } 1405 1406 1407 1408 1409 omClass = ProductPeer.getOMClass(); 1410 Product obj4 = (Product)ProductPeer 1411 .row2Object( row, offset4, omClass); 1412 1413 newObject = true; 1414 for (int j = 0; j < results.size(); j++) 1415 { 1416 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1417 Product temp_obj4 = (Product)temp_obj1.getProduct(); 1418 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1419 { 1420 newObject = false; 1421 temp_obj4.addPrintSubscription(obj1); 1422 break; 1423 } 1424 } 1425 if (newObject) 1426 { 1427 obj4.initPrintSubscriptions(); 1428 obj4.addPrintSubscription(obj1); 1429 } 1430 1431 1432 1433 1434 omClass = SorderPeer.getOMClass(); 1435 Sorder obj5 = (Sorder)SorderPeer 1436 .row2Object( row, offset5, omClass); 1437 1438 newObject = true; 1439 for (int j = 0; j < results.size(); j++) 1440 { 1441 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1442 Sorder temp_obj5 = (Sorder)temp_obj1.getSorder(); 1443 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1444 { 1445 newObject = false; 1446 temp_obj5.addPrintSubscription(obj1); 1447 break; 1448 } 1449 } 1450 if (newObject) 1451 { 1452 obj5.initPrintSubscriptions(); 1453 obj5.addPrintSubscription(obj1); 1454 } 1455 results.add(obj1); 1456 } 1457 return results; 1458 } 1459 1460 1461 1462 1463 1464 1475 protected static List doSelectJoinAllExceptCustomerRelatedByRecipientId(Criteria criteria) 1476 throws TorqueException 1477 { 1478 setDbName(criteria); 1479 1480 addSelectColumns(criteria); 1481 int offset2 = numColumns + 1; 1482 1483 1484 1485 CarrierPeer.addSelectColumns(criteria); 1486 int offset3 = offset2 + CarrierPeer.numColumns; 1487 1488 ProjectPeer.addSelectColumns(criteria); 1489 int offset4 = offset3 + ProjectPeer.numColumns; 1490 1491 ProductPeer.addSelectColumns(criteria); 1492 int offset5 = offset4 + ProductPeer.numColumns; 1493 1494 SorderPeer.addSelectColumns(criteria); 1495 int offset6 = offset5 + SorderPeer.numColumns; 1496 1497 List rows = BasePeer.doSelect(criteria); 1498 List results = new ArrayList (); 1499 1500 for (int i = 0; i < rows.size(); i++) 1501 { 1502 Record row = (Record)rows.get(i); 1503 1504 Class omClass = PrintSubscriptionPeer.getOMClass(); 1505 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 1506 .row2Object(row, 1, omClass); 1507 1508 1509 1510 1511 1512 1513 omClass = CarrierPeer.getOMClass(); 1514 Carrier obj2 = (Carrier)CarrierPeer 1515 .row2Object( row, offset2, omClass); 1516 1517 boolean newObject = true; 1518 for (int j = 0; j < results.size(); j++) 1519 { 1520 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1521 Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier(); 1522 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1523 { 1524 newObject = false; 1525 temp_obj2.addPrintSubscription(obj1); 1526 break; 1527 } 1528 } 1529 if (newObject) 1530 { 1531 obj2.initPrintSubscriptions(); 1532 obj2.addPrintSubscription(obj1); 1533 } 1534 1535 1536 1537 1538 omClass = ProjectPeer.getOMClass(); 1539 Project obj3 = (Project)ProjectPeer 1540 .row2Object( row, offset3, omClass); 1541 1542 newObject = true; 1543 for (int j = 0; j < results.size(); j++) 1544 { 1545 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1546 Project temp_obj3 = (Project)temp_obj1.getProject(); 1547 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1548 { 1549 newObject = false; 1550 temp_obj3.addPrintSubscription(obj1); 1551 break; 1552 } 1553 } 1554 if (newObject) 1555 { 1556 obj3.initPrintSubscriptions(); 1557 obj3.addPrintSubscription(obj1); 1558 } 1559 1560 1561 1562 1563 omClass = ProductPeer.getOMClass(); 1564 Product obj4 = (Product)ProductPeer 1565 .row2Object( row, offset4, omClass); 1566 1567 newObject = true; 1568 for (int j = 0; j < results.size(); j++) 1569 { 1570 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1571 Product temp_obj4 = (Product)temp_obj1.getProduct(); 1572 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1573 { 1574 newObject = false; 1575 temp_obj4.addPrintSubscription(obj1); 1576 break; 1577 } 1578 } 1579 if (newObject) 1580 { 1581 obj4.initPrintSubscriptions(); 1582 obj4.addPrintSubscription(obj1); 1583 } 1584 1585 1586 1587 1588 omClass = SorderPeer.getOMClass(); 1589 Sorder obj5 = (Sorder)SorderPeer 1590 .row2Object( row, offset5, omClass); 1591 1592 newObject = true; 1593 for (int j = 0; j < results.size(); j++) 1594 { 1595 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1596 Sorder temp_obj5 = (Sorder)temp_obj1.getSorder(); 1597 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1598 { 1599 newObject = false; 1600 temp_obj5.addPrintSubscription(obj1); 1601 break; 1602 } 1603 } 1604 if (newObject) 1605 { 1606 obj5.initPrintSubscriptions(); 1607 obj5.addPrintSubscription(obj1); 1608 } 1609 results.add(obj1); 1610 } 1611 return results; 1612 } 1613 1614 1615 1616 1617 1618 1629 protected static List doSelectJoinAllExceptCarrier(Criteria criteria) 1630 throws TorqueException 1631 { 1632 setDbName(criteria); 1633 1634 addSelectColumns(criteria); 1635 int offset2 = numColumns + 1; 1636 1637 CustomerPeer.addSelectColumns(criteria); 1638 int offset3 = offset2 + CustomerPeer.numColumns; 1639 1640 CustomerPeer.addSelectColumns(criteria); 1641 int offset4 = offset3 + CustomerPeer.numColumns; 1642 1643 1644 ProjectPeer.addSelectColumns(criteria); 1645 int offset5 = offset4 + ProjectPeer.numColumns; 1646 1647 ProductPeer.addSelectColumns(criteria); 1648 int offset6 = offset5 + ProductPeer.numColumns; 1649 1650 SorderPeer.addSelectColumns(criteria); 1651 int offset7 = offset6 + SorderPeer.numColumns; 1652 1653 List rows = BasePeer.doSelect(criteria); 1654 List results = new ArrayList (); 1655 1656 for (int i = 0; i < rows.size(); i++) 1657 { 1658 Record row = (Record)rows.get(i); 1659 1660 Class omClass = PrintSubscriptionPeer.getOMClass(); 1661 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 1662 .row2Object(row, 1, omClass); 1663 1664 1665 1666 1667 omClass = CustomerPeer.getOMClass(); 1668 Customer obj2 = (Customer)CustomerPeer 1669 .row2Object( row, offset2, omClass); 1670 1671 boolean newObject = true; 1672 for (int j = 0; j < results.size(); j++) 1673 { 1674 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1675 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 1676 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1677 { 1678 newObject = false; 1679 temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 1680 break; 1681 } 1682 } 1683 if (newObject) 1684 { 1685 obj2.initPrintSubscriptionsRelatedByCustomerId(); 1686 obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 1687 } 1688 1689 1690 1691 1692 omClass = CustomerPeer.getOMClass(); 1693 Customer obj3 = (Customer)CustomerPeer 1694 .row2Object( row, offset3, omClass); 1695 1696 newObject = true; 1697 for (int j = 0; j < results.size(); j++) 1698 { 1699 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1700 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1701 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1702 { 1703 newObject = false; 1704 temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 1705 break; 1706 } 1707 } 1708 if (newObject) 1709 { 1710 obj3.initPrintSubscriptionsRelatedByRecipientId(); 1711 obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 1712 } 1713 1714 1715 1716 1717 1718 omClass = ProjectPeer.getOMClass(); 1719 Project obj4 = (Project)ProjectPeer 1720 .row2Object( row, offset4, omClass); 1721 1722 newObject = true; 1723 for (int j = 0; j < results.size(); j++) 1724 { 1725 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1726 Project temp_obj4 = (Project)temp_obj1.getProject(); 1727 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1728 { 1729 newObject = false; 1730 temp_obj4.addPrintSubscription(obj1); 1731 break; 1732 } 1733 } 1734 if (newObject) 1735 { 1736 obj4.initPrintSubscriptions(); 1737 obj4.addPrintSubscription(obj1); 1738 } 1739 1740 1741 1742 1743 omClass = ProductPeer.getOMClass(); 1744 Product obj5 = (Product)ProductPeer 1745 .row2Object( row, offset5, omClass); 1746 1747 newObject = true; 1748 for (int j = 0; j < results.size(); j++) 1749 { 1750 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1751 Product temp_obj5 = (Product)temp_obj1.getProduct(); 1752 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1753 { 1754 newObject = false; 1755 temp_obj5.addPrintSubscription(obj1); 1756 break; 1757 } 1758 } 1759 if (newObject) 1760 { 1761 obj5.initPrintSubscriptions(); 1762 obj5.addPrintSubscription(obj1); 1763 } 1764 1765 1766 1767 1768 omClass = SorderPeer.getOMClass(); 1769 Sorder obj6 = (Sorder)SorderPeer 1770 .row2Object( row, offset6, omClass); 1771 1772 newObject = true; 1773 for (int j = 0; j < results.size(); j++) 1774 { 1775 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1776 Sorder temp_obj6 = (Sorder)temp_obj1.getSorder(); 1777 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 1778 { 1779 newObject = false; 1780 temp_obj6.addPrintSubscription(obj1); 1781 break; 1782 } 1783 } 1784 if (newObject) 1785 { 1786 obj6.initPrintSubscriptions(); 1787 obj6.addPrintSubscription(obj1); 1788 } 1789 results.add(obj1); 1790 } 1791 return results; 1792 } 1793 1794 1795 1796 1797 1798 1809 protected static List doSelectJoinAllExceptProject(Criteria criteria) 1810 throws TorqueException 1811 { 1812 setDbName(criteria); 1813 1814 addSelectColumns(criteria); 1815 int offset2 = numColumns + 1; 1816 1817 CustomerPeer.addSelectColumns(criteria); 1818 int offset3 = offset2 + CustomerPeer.numColumns; 1819 1820 CustomerPeer.addSelectColumns(criteria); 1821 int offset4 = offset3 + CustomerPeer.numColumns; 1822 1823 CarrierPeer.addSelectColumns(criteria); 1824 int offset5 = offset4 + CarrierPeer.numColumns; 1825 1826 1827 ProductPeer.addSelectColumns(criteria); 1828 int offset6 = offset5 + ProductPeer.numColumns; 1829 1830 SorderPeer.addSelectColumns(criteria); 1831 int offset7 = offset6 + SorderPeer.numColumns; 1832 1833 List rows = BasePeer.doSelect(criteria); 1834 List results = new ArrayList (); 1835 1836 for (int i = 0; i < rows.size(); i++) 1837 { 1838 Record row = (Record)rows.get(i); 1839 1840 Class omClass = PrintSubscriptionPeer.getOMClass(); 1841 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 1842 .row2Object(row, 1, omClass); 1843 1844 1845 1846 1847 omClass = CustomerPeer.getOMClass(); 1848 Customer obj2 = (Customer)CustomerPeer 1849 .row2Object( row, offset2, omClass); 1850 1851 boolean newObject = true; 1852 for (int j = 0; j < results.size(); j++) 1853 { 1854 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1855 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 1856 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1857 { 1858 newObject = false; 1859 temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 1860 break; 1861 } 1862 } 1863 if (newObject) 1864 { 1865 obj2.initPrintSubscriptionsRelatedByCustomerId(); 1866 obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 1867 } 1868 1869 1870 1871 1872 omClass = CustomerPeer.getOMClass(); 1873 Customer obj3 = (Customer)CustomerPeer 1874 .row2Object( row, offset3, omClass); 1875 1876 newObject = true; 1877 for (int j = 0; j < results.size(); j++) 1878 { 1879 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1880 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1881 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1882 { 1883 newObject = false; 1884 temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 1885 break; 1886 } 1887 } 1888 if (newObject) 1889 { 1890 obj3.initPrintSubscriptionsRelatedByRecipientId(); 1891 obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 1892 } 1893 1894 1895 1896 1897 omClass = CarrierPeer.getOMClass(); 1898 Carrier obj4 = (Carrier)CarrierPeer 1899 .row2Object( row, offset4, omClass); 1900 1901 newObject = true; 1902 for (int j = 0; j < results.size(); j++) 1903 { 1904 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1905 Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier(); 1906 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1907 { 1908 newObject = false; 1909 temp_obj4.addPrintSubscription(obj1); 1910 break; 1911 } 1912 } 1913 if (newObject) 1914 { 1915 obj4.initPrintSubscriptions(); 1916 obj4.addPrintSubscription(obj1); 1917 } 1918 1919 1920 1921 1922 1923 omClass = ProductPeer.getOMClass(); 1924 Product obj5 = (Product)ProductPeer 1925 .row2Object( row, offset5, omClass); 1926 1927 newObject = true; 1928 for (int j = 0; j < results.size(); j++) 1929 { 1930 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1931 Product temp_obj5 = (Product)temp_obj1.getProduct(); 1932 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1933 { 1934 newObject = false; 1935 temp_obj5.addPrintSubscription(obj1); 1936 break; 1937 } 1938 } 1939 if (newObject) 1940 { 1941 obj5.initPrintSubscriptions(); 1942 obj5.addPrintSubscription(obj1); 1943 } 1944 1945 1946 1947 1948 omClass = SorderPeer.getOMClass(); 1949 Sorder obj6 = (Sorder)SorderPeer 1950 .row2Object( row, offset6, omClass); 1951 1952 newObject = true; 1953 for (int j = 0; j < results.size(); j++) 1954 { 1955 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 1956 Sorder temp_obj6 = (Sorder)temp_obj1.getSorder(); 1957 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 1958 { 1959 newObject = false; 1960 temp_obj6.addPrintSubscription(obj1); 1961 break; 1962 } 1963 } 1964 if (newObject) 1965 { 1966 obj6.initPrintSubscriptions(); 1967 obj6.addPrintSubscription(obj1); 1968 } 1969 results.add(obj1); 1970 } 1971 return results; 1972 } 1973 1974 1975 1976 1977 1978 1989 protected static List doSelectJoinAllExceptProduct(Criteria criteria) 1990 throws TorqueException 1991 { 1992 setDbName(criteria); 1993 1994 addSelectColumns(criteria); 1995 int offset2 = numColumns + 1; 1996 1997 CustomerPeer.addSelectColumns(criteria); 1998 int offset3 = offset2 + CustomerPeer.numColumns; 1999 2000 CustomerPeer.addSelectColumns(criteria); 2001 int offset4 = offset3 + CustomerPeer.numColumns; 2002 2003 CarrierPeer.addSelectColumns(criteria); 2004 int offset5 = offset4 + CarrierPeer.numColumns; 2005 2006 ProjectPeer.addSelectColumns(criteria); 2007 int offset6 = offset5 + ProjectPeer.numColumns; 2008 2009 2010 SorderPeer.addSelectColumns(criteria); 2011 int offset7 = offset6 + SorderPeer.numColumns; 2012 2013 List rows = BasePeer.doSelect(criteria); 2014 List results = new ArrayList (); 2015 2016 for (int i = 0; i < rows.size(); i++) 2017 { 2018 Record row = (Record)rows.get(i); 2019 2020 Class omClass = PrintSubscriptionPeer.getOMClass(); 2021 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 2022 .row2Object(row, 1, omClass); 2023 2024 2025 2026 2027 omClass = CustomerPeer.getOMClass(); 2028 Customer obj2 = (Customer)CustomerPeer 2029 .row2Object( row, offset2, omClass); 2030 2031 boolean newObject = true; 2032 for (int j = 0; j < results.size(); j++) 2033 { 2034 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2035 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 2036 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2037 { 2038 newObject = false; 2039 temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 2040 break; 2041 } 2042 } 2043 if (newObject) 2044 { 2045 obj2.initPrintSubscriptionsRelatedByCustomerId(); 2046 obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 2047 } 2048 2049 2050 2051 2052 omClass = CustomerPeer.getOMClass(); 2053 Customer obj3 = (Customer)CustomerPeer 2054 .row2Object( row, offset3, omClass); 2055 2056 newObject = true; 2057 for (int j = 0; j < results.size(); j++) 2058 { 2059 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2060 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 2061 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2062 { 2063 newObject = false; 2064 temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 2065 break; 2066 } 2067 } 2068 if (newObject) 2069 { 2070 obj3.initPrintSubscriptionsRelatedByRecipientId(); 2071 obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 2072 } 2073 2074 2075 2076 2077 omClass = CarrierPeer.getOMClass(); 2078 Carrier obj4 = (Carrier)CarrierPeer 2079 .row2Object( row, offset4, omClass); 2080 2081 newObject = true; 2082 for (int j = 0; j < results.size(); j++) 2083 { 2084 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2085 Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier(); 2086 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2087 { 2088 newObject = false; 2089 temp_obj4.addPrintSubscription(obj1); 2090 break; 2091 } 2092 } 2093 if (newObject) 2094 { 2095 obj4.initPrintSubscriptions(); 2096 obj4.addPrintSubscription(obj1); 2097 } 2098 2099 2100 2101 2102 omClass = ProjectPeer.getOMClass(); 2103 Project obj5 = (Project)ProjectPeer 2104 .row2Object( row, offset5, omClass); 2105 2106 newObject = true; 2107 for (int j = 0; j < results.size(); j++) 2108 { 2109 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2110 Project temp_obj5 = (Project)temp_obj1.getProject(); 2111 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2112 { 2113 newObject = false; 2114 temp_obj5.addPrintSubscription(obj1); 2115 break; 2116 } 2117 } 2118 if (newObject) 2119 { 2120 obj5.initPrintSubscriptions(); 2121 obj5.addPrintSubscription(obj1); 2122 } 2123 2124 2125 2126 2127 2128 omClass = SorderPeer.getOMClass(); 2129 Sorder obj6 = (Sorder)SorderPeer 2130 .row2Object( row, offset6, omClass); 2131 2132 newObject = true; 2133 for (int j = 0; j < results.size(); j++) 2134 { 2135 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2136 Sorder temp_obj6 = (Sorder)temp_obj1.getSorder(); 2137 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2138 { 2139 newObject = false; 2140 temp_obj6.addPrintSubscription(obj1); 2141 break; 2142 } 2143 } 2144 if (newObject) 2145 { 2146 obj6.initPrintSubscriptions(); 2147 obj6.addPrintSubscription(obj1); 2148 } 2149 results.add(obj1); 2150 } 2151 return results; 2152 } 2153 2154 2155 2156 2157 2158 2169 protected static List doSelectJoinAllExceptSorder(Criteria criteria) 2170 throws TorqueException 2171 { 2172 setDbName(criteria); 2173 2174 addSelectColumns(criteria); 2175 int offset2 = numColumns + 1; 2176 2177 CustomerPeer.addSelectColumns(criteria); 2178 int offset3 = offset2 + CustomerPeer.numColumns; 2179 2180 CustomerPeer.addSelectColumns(criteria); 2181 int offset4 = offset3 + CustomerPeer.numColumns; 2182 2183 CarrierPeer.addSelectColumns(criteria); 2184 int offset5 = offset4 + CarrierPeer.numColumns; 2185 2186 ProjectPeer.addSelectColumns(criteria); 2187 int offset6 = offset5 + ProjectPeer.numColumns; 2188 2189 ProductPeer.addSelectColumns(criteria); 2190 int offset7 = offset6 + ProductPeer.numColumns; 2191 2192 2193 List rows = BasePeer.doSelect(criteria); 2194 List results = new ArrayList (); 2195 2196 for (int i = 0; i < rows.size(); i++) 2197 { 2198 Record row = (Record)rows.get(i); 2199 2200 Class omClass = PrintSubscriptionPeer.getOMClass(); 2201 PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer 2202 .row2Object(row, 1, omClass); 2203 2204 2205 2206 2207 omClass = CustomerPeer.getOMClass(); 2208 Customer obj2 = (Customer)CustomerPeer 2209 .row2Object( row, offset2, omClass); 2210 2211 boolean newObject = true; 2212 for (int j = 0; j < results.size(); j++) 2213 { 2214 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2215 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 2216 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 2217 { 2218 newObject = false; 2219 temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 2220 break; 2221 } 2222 } 2223 if (newObject) 2224 { 2225 obj2.initPrintSubscriptionsRelatedByCustomerId(); 2226 obj2.addPrintSubscriptionRelatedByCustomerId(obj1); 2227 } 2228 2229 2230 2231 2232 omClass = CustomerPeer.getOMClass(); 2233 Customer obj3 = (Customer)CustomerPeer 2234 .row2Object( row, offset3, omClass); 2235 2236 newObject = true; 2237 for (int j = 0; j < results.size(); j++) 2238 { 2239 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2240 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 2241 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 2242 { 2243 newObject = false; 2244 temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 2245 break; 2246 } 2247 } 2248 if (newObject) 2249 { 2250 obj3.initPrintSubscriptionsRelatedByRecipientId(); 2251 obj3.addPrintSubscriptionRelatedByRecipientId(obj1); 2252 } 2253 2254 2255 2256 2257 omClass = CarrierPeer.getOMClass(); 2258 Carrier obj4 = (Carrier)CarrierPeer 2259 .row2Object( row, offset4, omClass); 2260 2261 newObject = true; 2262 for (int j = 0; j < results.size(); j++) 2263 { 2264 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2265 Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier(); 2266 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 2267 { 2268 newObject = false; 2269 temp_obj4.addPrintSubscription(obj1); 2270 break; 2271 } 2272 } 2273 if (newObject) 2274 { 2275 obj4.initPrintSubscriptions(); 2276 obj4.addPrintSubscription(obj1); 2277 } 2278 2279 2280 2281 2282 omClass = ProjectPeer.getOMClass(); 2283 Project obj5 = (Project)ProjectPeer 2284 .row2Object( row, offset5, omClass); 2285 2286 newObject = true; 2287 for (int j = 0; j < results.size(); j++) 2288 { 2289 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2290 Project temp_obj5 = (Project)temp_obj1.getProject(); 2291 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 2292 { 2293 newObject = false; 2294 temp_obj5.addPrintSubscription(obj1); 2295 break; 2296 } 2297 } 2298 if (newObject) 2299 { 2300 obj5.initPrintSubscriptions(); 2301 obj5.addPrintSubscription(obj1); 2302 } 2303 2304 2305 2306 2307 omClass = ProductPeer.getOMClass(); 2308 Product obj6 = (Product)ProductPeer 2309 .row2Object( row, offset6, omClass); 2310 2311 newObject = true; 2312 for (int j = 0; j < results.size(); j++) 2313 { 2314 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j); 2315 Product temp_obj6 = (Product)temp_obj1.getProduct(); 2316 if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey())) 2317 { 2318 newObject = false; 2319 temp_obj6.addPrintSubscription(obj1); 2320 break; 2321 } 2322 } 2323 if (newObject) 2324 { 2325 obj6.initPrintSubscriptions(); 2326 obj6.addPrintSubscription(obj1); 2327 } 2328 2329 results.add(obj1); 2330 } 2331 return results; 2332 } 2333 2334 2335 2342 protected static TableMap getTableMap() 2343 throws TorqueException 2344 { 2345 return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME); 2346 } 2347 2348 private static void setDbName(Criteria crit) 2349 { 2350 if (crit.getDbName() == Torque.getDefaultDB()) 2354 { 2355 crit.setDbName(DATABASE_NAME); 2356 } 2357 } 2358} 2359
| Popular Tags
|