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 45 public abstract class BaseOnlineSubscriptionPeer 46 extends BasePeer 47 { 48 49 50 public static final String DATABASE_NAME = "cream"; 51 52 53 public static final String TABLE_NAME = "ONLINE_SUBSCRIPTION"; 54 55 60 public static MapBuilder getMapBuilder() 61 throws TorqueException 62 { 63 return getMapBuilder(OnlineSubscriptionMapBuilder.CLASS_NAME); 64 } 65 66 67 public static final String ONLINE_SUBS_ID; 68 69 public static final String ONLINE_SUBS_CODE; 70 71 public static final String STATUS; 72 73 public static final String PRIORITY; 74 75 public static final String ISSUED_DATE; 76 77 public static final String CLOSED_DATE; 78 79 public static final String SORDER_ID; 80 81 public static final String CUSTOMER_ID; 82 83 public static final String RECIPIENT_ID; 84 85 public static final String PROJECT_ID; 86 87 public static final String PRODUCT_ID; 88 89 public static final String QUANTITY; 90 91 public static final String START_DATE; 92 93 public static final String END_DATE; 94 95 public static final String SUBJECT; 96 97 public static final String NOTES; 98 99 public static final String CREATED; 100 101 public static final String MODIFIED; 102 103 public static final String CREATED_BY; 104 105 public static final String MODIFIED_BY; 106 107 static 108 { 109 ONLINE_SUBS_ID = "ONLINE_SUBSCRIPTION.ONLINE_SUBS_ID"; 110 ONLINE_SUBS_CODE = "ONLINE_SUBSCRIPTION.ONLINE_SUBS_CODE"; 111 STATUS = "ONLINE_SUBSCRIPTION.STATUS"; 112 PRIORITY = "ONLINE_SUBSCRIPTION.PRIORITY"; 113 ISSUED_DATE = "ONLINE_SUBSCRIPTION.ISSUED_DATE"; 114 CLOSED_DATE = "ONLINE_SUBSCRIPTION.CLOSED_DATE"; 115 SORDER_ID = "ONLINE_SUBSCRIPTION.SORDER_ID"; 116 CUSTOMER_ID = "ONLINE_SUBSCRIPTION.CUSTOMER_ID"; 117 RECIPIENT_ID = "ONLINE_SUBSCRIPTION.RECIPIENT_ID"; 118 PROJECT_ID = "ONLINE_SUBSCRIPTION.PROJECT_ID"; 119 PRODUCT_ID = "ONLINE_SUBSCRIPTION.PRODUCT_ID"; 120 QUANTITY = "ONLINE_SUBSCRIPTION.QUANTITY"; 121 START_DATE = "ONLINE_SUBSCRIPTION.START_DATE"; 122 END_DATE = "ONLINE_SUBSCRIPTION.END_DATE"; 123 SUBJECT = "ONLINE_SUBSCRIPTION.SUBJECT"; 124 NOTES = "ONLINE_SUBSCRIPTION.NOTES"; 125 CREATED = "ONLINE_SUBSCRIPTION.CREATED"; 126 MODIFIED = "ONLINE_SUBSCRIPTION.MODIFIED"; 127 CREATED_BY = "ONLINE_SUBSCRIPTION.CREATED_BY"; 128 MODIFIED_BY = "ONLINE_SUBSCRIPTION.MODIFIED_BY"; 129 if (Torque.isInit()) 130 { 131 try 132 { 133 getMapBuilder(OnlineSubscriptionMapBuilder.CLASS_NAME); 134 } 135 catch (Exception e) 136 { 137 log.error("Could not initialize Peer", e); 138 } 139 } 140 else 141 { 142 Torque.registerMapBuilder(OnlineSubscriptionMapBuilder.CLASS_NAME); 143 } 144 } 145 146 147 public static final int numColumns = 20; 148 149 150 protected static final String CLASSNAME_DEFAULT = 151 "org.campware.cream.om.OnlineSubscription"; 152 153 154 protected static final Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT); 155 156 162 private static Class initClass(String className) 163 { 164 Class c = null; 165 try 166 { 167 c = Class.forName(className); 168 } 169 catch (Throwable t) 170 { 171 log.error("A FATAL ERROR has occurred which should not " 172 + "have happened under any circumstance. Please notify " 173 + "the Torque developers <torque-dev@db.apache.org> " 174 + "and give as many details as possible (including the error " 175 + "stack trace).", t); 176 177 if (t instanceof Error ) 179 { 180 throw (Error ) t.fillInStackTrace(); 181 } 182 } 183 return c; 184 } 185 186 196 public static List resultSet2Objects(java.sql.ResultSet results) 197 throws TorqueException 198 { 199 try 200 { 201 QueryDataSet qds = null; 202 List rows = null; 203 try 204 { 205 qds = new QueryDataSet(results); 206 rows = getSelectResults(qds); 207 } 208 finally 209 { 210 if (qds != null) 211 { 212 qds.close(); 213 } 214 } 215 216 return populateObjects(rows); 217 } 218 catch (SQLException e) 219 { 220 throw new TorqueException(e); 221 } 222 catch (DataSetException e) 223 { 224 throw new TorqueException(e); 225 } 226 } 227 228 229 230 237 public static ObjectKey doInsert(Criteria criteria) 238 throws TorqueException 239 { 240 return BaseOnlineSubscriptionPeer 241 .doInsert(criteria, (Connection ) null); 242 } 243 244 254 public static ObjectKey doInsert(Criteria criteria, Connection con) 255 throws TorqueException 256 { 257 258 setDbName(criteria); 259 260 if (con == null) 261 { 262 return BasePeer.doInsert(criteria); 263 } 264 else 265 { 266 return BasePeer.doInsert(criteria, con); 267 } 268 } 269 270 277 public static void addSelectColumns(Criteria criteria) 278 throws TorqueException 279 { 280 criteria.addSelectColumn(ONLINE_SUBS_ID); 281 criteria.addSelectColumn(ONLINE_SUBS_CODE); 282 criteria.addSelectColumn(STATUS); 283 criteria.addSelectColumn(PRIORITY); 284 criteria.addSelectColumn(ISSUED_DATE); 285 criteria.addSelectColumn(CLOSED_DATE); 286 criteria.addSelectColumn(SORDER_ID); 287 criteria.addSelectColumn(CUSTOMER_ID); 288 criteria.addSelectColumn(RECIPIENT_ID); 289 criteria.addSelectColumn(PROJECT_ID); 290 criteria.addSelectColumn(PRODUCT_ID); 291 criteria.addSelectColumn(QUANTITY); 292 criteria.addSelectColumn(START_DATE); 293 criteria.addSelectColumn(END_DATE); 294 criteria.addSelectColumn(SUBJECT); 295 criteria.addSelectColumn(NOTES); 296 criteria.addSelectColumn(CREATED); 297 criteria.addSelectColumn(MODIFIED); 298 criteria.addSelectColumn(CREATED_BY); 299 criteria.addSelectColumn(MODIFIED_BY); 300 } 301 302 311 public static OnlineSubscription row2Object(Record row, 312 int offset, 313 Class cls) 314 throws TorqueException 315 { 316 try 317 { 318 OnlineSubscription obj = (OnlineSubscription) cls.newInstance(); 319 OnlineSubscriptionPeer.populateObject(row, offset, obj); 320 obj.setModified(false); 321 obj.setNew(false); 322 323 return obj; 324 } 325 catch (InstantiationException e) 326 { 327 throw new TorqueException(e); 328 } 329 catch (IllegalAccessException e) 330 { 331 throw new TorqueException(e); 332 } 333 } 334 335 344 public static void populateObject(Record row, 345 int offset, 346 OnlineSubscription obj) 347 throws TorqueException 348 { 349 try 350 { 351 obj.setOnlineSubsId(row.getValue(offset + 0).asInt()); 352 obj.setOnlineSubsCode(row.getValue(offset + 1).asString()); 353 obj.setStatus(row.getValue(offset + 2).asInt()); 354 obj.setPriority(row.getValue(offset + 3).asInt()); 355 obj.setIssuedDate(row.getValue(offset + 4).asUtilDate()); 356 obj.setClosedDate(row.getValue(offset + 5).asUtilDate()); 357 obj.setSorderId(row.getValue(offset + 6).asInt()); 358 obj.setCustomerId(row.getValue(offset + 7).asInt()); 359 obj.setRecipientId(row.getValue(offset + 8).asInt()); 360 obj.setProjectId(row.getValue(offset + 9).asInt()); 361 obj.setProductId(row.getValue(offset + 10).asInt()); 362 obj.setQuantity(row.getValue(offset + 11).asInt()); 363 obj.setStartDate(row.getValue(offset + 12).asUtilDate()); 364 obj.setEndDate(row.getValue(offset + 13).asUtilDate()); 365 obj.setSubject(row.getValue(offset + 14).asString()); 366 obj.setNotes(row.getValue(offset + 15).asString()); 367 obj.setCreated(row.getValue(offset + 16).asUtilDate()); 368 obj.setModified(row.getValue(offset + 17).asUtilDate()); 369 obj.setCreatedBy(row.getValue(offset + 18).asString()); 370 obj.setModifiedBy(row.getValue(offset + 19).asString()); 371 } 372 catch (DataSetException e) 373 { 374 throw new TorqueException(e); 375 } 376 } 377 378 386 public static List doSelect(Criteria criteria) throws TorqueException 387 { 388 return populateObjects(doSelectVillageRecords(criteria)); 389 } 390 391 400 public static List doSelect(Criteria criteria, Connection con) 401 throws TorqueException 402 { 403 return populateObjects(doSelectVillageRecords(criteria, con)); 404 } 405 406 416 public static List doSelectVillageRecords(Criteria criteria) 417 throws TorqueException 418 { 419 return BaseOnlineSubscriptionPeer 420 .doSelectVillageRecords(criteria, (Connection ) null); 421 } 422 423 432 public static List doSelectVillageRecords(Criteria criteria, Connection con) 433 throws TorqueException 434 { 435 if (criteria.getSelectColumns().size() == 0) 436 { 437 addSelectColumns(criteria); 438 } 439 440 441 setDbName(criteria); 442 443 if (con == null) 446 { 447 return BasePeer.doSelect(criteria); 448 } 449 else 450 { 451 return BasePeer.doSelect(criteria, con); 452 } 453 } 454 455 462 public static List populateObjects(List records) 463 throws TorqueException 464 { 465 List results = new ArrayList (records.size()); 466 467 for (int i = 0; i < records.size(); i++) 469 { 470 Record row = (Record) records.get(i); 471 results.add(OnlineSubscriptionPeer.row2Object(row, 1, 472 OnlineSubscriptionPeer.getOMClass())); 473 } 474 return results; 475 } 476 477 478 486 public static Class getOMClass() 487 throws TorqueException 488 { 489 return CLASS_DEFAULT; 490 } 491 492 500 public static void doUpdate(Criteria criteria) throws TorqueException 501 { 502 BaseOnlineSubscriptionPeer 503 .doUpdate(criteria, (Connection ) null); 504 } 505 506 517 public static void doUpdate(Criteria criteria, Connection con) 518 throws TorqueException 519 { 520 Criteria selectCriteria = new Criteria(DATABASE_NAME, 2); 521 selectCriteria.put(ONLINE_SUBS_ID, criteria.remove(ONLINE_SUBS_ID)); 522 523 setDbName(criteria); 524 525 if (con == null) 526 { 527 BasePeer.doUpdate(selectCriteria, criteria); 528 } 529 else 530 { 531 BasePeer.doUpdate(selectCriteria, criteria, con); 532 } 533 } 534 535 542 public static void doDelete(Criteria criteria) throws TorqueException 543 { 544 OnlineSubscriptionPeer 545 .doDelete(criteria, (Connection ) null); 546 } 547 548 558 public static void doDelete(Criteria criteria, Connection con) 559 throws TorqueException 560 { 561 562 setDbName(criteria); 563 564 if (con == null) 565 { 566 BasePeer.doDelete(criteria); 567 } 568 else 569 { 570 BasePeer.doDelete(criteria, con); 571 } 572 } 573 574 580 public static List doSelect(OnlineSubscription obj) throws TorqueException 581 { 582 return doSelect(buildSelectCriteria(obj)); 583 } 584 585 591 public static void doInsert(OnlineSubscription obj) throws TorqueException 592 { 593 obj.setPrimaryKey(doInsert(buildCriteria(obj))); 594 obj.setNew(false); 595 obj.setModified(false); 596 } 597 598 603 public static void doUpdate(OnlineSubscription obj) throws TorqueException 604 { 605 doUpdate(buildCriteria(obj)); 606 obj.setModified(false); 607 } 608 609 614 public static void doDelete(OnlineSubscription obj) throws TorqueException 615 { 616 doDelete(buildSelectCriteria(obj)); 617 } 618 619 629 public static void doInsert(OnlineSubscription obj, Connection con) 630 throws TorqueException 631 { 632 obj.setPrimaryKey(doInsert(buildCriteria(obj), con)); 633 obj.setNew(false); 634 obj.setModified(false); 635 } 636 637 647 public static void doUpdate(OnlineSubscription obj, Connection con) 648 throws TorqueException 649 { 650 doUpdate(buildCriteria(obj), con); 651 obj.setModified(false); 652 } 653 654 664 public static void doDelete(OnlineSubscription obj, Connection con) 665 throws TorqueException 666 { 667 doDelete(buildSelectCriteria(obj), con); 668 } 669 670 677 public static void doDelete(ObjectKey pk) throws TorqueException 678 { 679 BaseOnlineSubscriptionPeer 680 .doDelete(pk, (Connection ) null); 681 } 682 683 693 public static void doDelete(ObjectKey pk, Connection con) 694 throws TorqueException 695 { 696 doDelete(buildCriteria(pk), con); 697 } 698 699 700 public static Criteria buildCriteria( ObjectKey pk ) 701 { 702 Criteria criteria = new Criteria(); 703 criteria.add(ONLINE_SUBS_ID, pk); 704 return criteria; 705 } 706 707 708 public static Criteria buildCriteria( OnlineSubscription obj ) 709 { 710 Criteria criteria = new Criteria(DATABASE_NAME); 711 if (!obj.isNew()) 712 criteria.add(ONLINE_SUBS_ID, obj.getOnlineSubsId()); 713 criteria.add(ONLINE_SUBS_CODE, obj.getOnlineSubsCode()); 714 criteria.add(STATUS, obj.getStatus()); 715 criteria.add(PRIORITY, obj.getPriority()); 716 criteria.add(ISSUED_DATE, obj.getIssuedDate()); 717 criteria.add(CLOSED_DATE, obj.getClosedDate()); 718 criteria.add(SORDER_ID, obj.getSorderId()); 719 criteria.add(CUSTOMER_ID, obj.getCustomerId()); 720 criteria.add(RECIPIENT_ID, obj.getRecipientId()); 721 criteria.add(PROJECT_ID, obj.getProjectId()); 722 criteria.add(PRODUCT_ID, obj.getProductId()); 723 criteria.add(QUANTITY, obj.getQuantity()); 724 criteria.add(START_DATE, obj.getStartDate()); 725 criteria.add(END_DATE, obj.getEndDate()); 726 criteria.add(SUBJECT, obj.getSubject()); 727 criteria.add(NOTES, obj.getNotes()); 728 criteria.add(CREATED, obj.getCreated()); 729 criteria.add(MODIFIED, obj.getModified()); 730 criteria.add(CREATED_BY, obj.getCreatedBy()); 731 criteria.add(MODIFIED_BY, obj.getModifiedBy()); 732 return criteria; 733 } 734 735 736 public static Criteria buildSelectCriteria( OnlineSubscription obj ) 737 { 738 Criteria criteria = new Criteria(DATABASE_NAME); 739 if (!obj.isNew()) 740 criteria.add(ONLINE_SUBS_ID, obj.getOnlineSubsId()); 741 criteria.add(ONLINE_SUBS_CODE, obj.getOnlineSubsCode()); 742 criteria.add(STATUS, obj.getStatus()); 743 criteria.add(PRIORITY, obj.getPriority()); 744 criteria.add(ISSUED_DATE, obj.getIssuedDate()); 745 criteria.add(CLOSED_DATE, obj.getClosedDate()); 746 criteria.add(SORDER_ID, obj.getSorderId()); 747 criteria.add(CUSTOMER_ID, obj.getCustomerId()); 748 criteria.add(RECIPIENT_ID, obj.getRecipientId()); 749 criteria.add(PROJECT_ID, obj.getProjectId()); 750 criteria.add(PRODUCT_ID, obj.getProductId()); 751 criteria.add(QUANTITY, obj.getQuantity()); 752 criteria.add(START_DATE, obj.getStartDate()); 753 criteria.add(END_DATE, obj.getEndDate()); 754 criteria.add(SUBJECT, obj.getSubject()); 755 criteria.add(NOTES, obj.getNotes()); 756 criteria.add(CREATED, obj.getCreated()); 757 criteria.add(MODIFIED, obj.getModified()); 758 criteria.add(CREATED_BY, obj.getCreatedBy()); 759 criteria.add(MODIFIED_BY, obj.getModifiedBy()); 760 return criteria; 761 } 762 763 764 773 public static OnlineSubscription retrieveByPK(int pk) 774 throws TorqueException, NoRowsException, TooManyRowsException 775 { 776 return retrieveByPK(SimpleKey.keyFor(pk)); 777 } 778 779 789 public static OnlineSubscription retrieveByPK(int pk, Connection con) 790 throws TorqueException, NoRowsException, TooManyRowsException 791 { 792 return retrieveByPK(SimpleKey.keyFor(pk), con); 793 } 794 795 804 public static OnlineSubscription retrieveByPK(ObjectKey pk) 805 throws TorqueException, NoRowsException, TooManyRowsException 806 { 807 Connection db = null; 808 OnlineSubscription retVal = null; 809 try 810 { 811 db = Torque.getConnection(DATABASE_NAME); 812 retVal = retrieveByPK(pk, db); 813 } 814 finally 815 { 816 Torque.closeConnection(db); 817 } 818 return(retVal); 819 } 820 821 831 public static OnlineSubscription retrieveByPK(ObjectKey pk, Connection con) 832 throws TorqueException, NoRowsException, TooManyRowsException 833 { 834 Criteria criteria = buildCriteria(pk); 835 List v = doSelect(criteria, con); 836 if (v.size() == 0) 837 { 838 throw new NoRowsException("Failed to select a row."); 839 } 840 else if (v.size() > 1) 841 { 842 throw new TooManyRowsException("Failed to select only one row."); 843 } 844 else 845 { 846 return (OnlineSubscription)v.get(0); 847 } 848 } 849 850 857 public static List retrieveByPKs(List pks) 858 throws TorqueException 859 { 860 Connection db = null; 861 List retVal = null; 862 try 863 { 864 db = Torque.getConnection(DATABASE_NAME); 865 retVal = retrieveByPKs(pks, db); 866 } 867 finally 868 { 869 Torque.closeConnection(db); 870 } 871 return(retVal); 872 } 873 874 882 public static List retrieveByPKs( List pks, Connection dbcon ) 883 throws TorqueException 884 { 885 List objs = null; 886 if (pks == null || pks.size() == 0) 887 { 888 objs = new LinkedList (); 889 } 890 else 891 { 892 Criteria criteria = new Criteria(); 893 criteria.addIn( ONLINE_SUBS_ID, pks ); 894 objs = doSelect(criteria, dbcon); 895 } 896 return objs; 897 } 898 899 900 901 902 903 904 905 906 907 908 919 protected static List doSelectJoinCustomerRelatedByCustomerId(Criteria criteria) 920 throws TorqueException 921 { 922 setDbName(criteria); 923 924 OnlineSubscriptionPeer.addSelectColumns(criteria); 925 int offset = numColumns + 1; 926 CustomerPeer.addSelectColumns(criteria); 927 928 929 criteria.addJoin(OnlineSubscriptionPeer.CUSTOMER_ID, 930 CustomerPeer.CUSTOMER_ID); 931 932 933 934 List rows = BasePeer.doSelect(criteria); 935 List results = new ArrayList (); 936 937 for (int i = 0; i < rows.size(); i++) 938 { 939 Record row = (Record) rows.get(i); 940 941 Class omClass = OnlineSubscriptionPeer.getOMClass(); 942 OnlineSubscription obj1 = (OnlineSubscription) OnlineSubscriptionPeer 943 .row2Object(row, 1, omClass); 944 omClass = CustomerPeer.getOMClass(); 945 Customer obj2 = (Customer)CustomerPeer 946 .row2Object(row, offset, omClass); 947 948 boolean newObject = true; 949 for (int j = 0; j < results.size(); j++) 950 { 951 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 952 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 953 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 954 { 955 newObject = false; 956 temp_obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 957 break; 958 } 959 } 960 if (newObject) 961 { 962 obj2.initOnlineSubscriptionsRelatedByCustomerId(); 963 obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 964 } 965 results.add(obj1); 966 } 967 return results; 968 } 969 970 971 972 973 984 protected static List doSelectJoinCustomerRelatedByRecipientId(Criteria criteria) 985 throws TorqueException 986 { 987 setDbName(criteria); 988 989 OnlineSubscriptionPeer.addSelectColumns(criteria); 990 int offset = numColumns + 1; 991 CustomerPeer.addSelectColumns(criteria); 992 993 994 criteria.addJoin(OnlineSubscriptionPeer.RECIPIENT_ID, 995 CustomerPeer.CUSTOMER_ID); 996 997 998 999 List rows = BasePeer.doSelect(criteria); 1000 List results = new ArrayList (); 1001 1002 for (int i = 0; i < rows.size(); i++) 1003 { 1004 Record row = (Record) rows.get(i); 1005 1006 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1007 OnlineSubscription obj1 = (OnlineSubscription) OnlineSubscriptionPeer 1008 .row2Object(row, 1, omClass); 1009 omClass = CustomerPeer.getOMClass(); 1010 Customer obj2 = (Customer)CustomerPeer 1011 .row2Object(row, offset, omClass); 1012 1013 boolean newObject = true; 1014 for (int j = 0; j < results.size(); j++) 1015 { 1016 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1017 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1018 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1019 { 1020 newObject = false; 1021 temp_obj2.addOnlineSubscriptionRelatedByRecipientId(obj1); 1022 break; 1023 } 1024 } 1025 if (newObject) 1026 { 1027 obj2.initOnlineSubscriptionsRelatedByRecipientId(); 1028 obj2.addOnlineSubscriptionRelatedByRecipientId(obj1); 1029 } 1030 results.add(obj1); 1031 } 1032 return results; 1033 } 1034 1035 1036 1037 1038 1049 protected static List doSelectJoinProject(Criteria criteria) 1050 throws TorqueException 1051 { 1052 setDbName(criteria); 1053 1054 OnlineSubscriptionPeer.addSelectColumns(criteria); 1055 int offset = numColumns + 1; 1056 ProjectPeer.addSelectColumns(criteria); 1057 1058 1059 criteria.addJoin(OnlineSubscriptionPeer.PROJECT_ID, 1060 ProjectPeer.PROJECT_ID); 1061 1062 1063 1064 List rows = BasePeer.doSelect(criteria); 1065 List results = new ArrayList (); 1066 1067 for (int i = 0; i < rows.size(); i++) 1068 { 1069 Record row = (Record) rows.get(i); 1070 1071 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1072 OnlineSubscription obj1 = (OnlineSubscription) OnlineSubscriptionPeer 1073 .row2Object(row, 1, omClass); 1074 omClass = ProjectPeer.getOMClass(); 1075 Project obj2 = (Project)ProjectPeer 1076 .row2Object(row, offset, omClass); 1077 1078 boolean newObject = true; 1079 for (int j = 0; j < results.size(); j++) 1080 { 1081 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1082 Project temp_obj2 = (Project)temp_obj1.getProject(); 1083 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1084 { 1085 newObject = false; 1086 temp_obj2.addOnlineSubscription(obj1); 1087 break; 1088 } 1089 } 1090 if (newObject) 1091 { 1092 obj2.initOnlineSubscriptions(); 1093 obj2.addOnlineSubscription(obj1); 1094 } 1095 results.add(obj1); 1096 } 1097 return results; 1098 } 1099 1100 1101 1102 1103 1114 protected static List doSelectJoinProduct(Criteria criteria) 1115 throws TorqueException 1116 { 1117 setDbName(criteria); 1118 1119 OnlineSubscriptionPeer.addSelectColumns(criteria); 1120 int offset = numColumns + 1; 1121 ProductPeer.addSelectColumns(criteria); 1122 1123 1124 criteria.addJoin(OnlineSubscriptionPeer.PRODUCT_ID, 1125 ProductPeer.PRODUCT_ID); 1126 1127 1128 1129 List rows = BasePeer.doSelect(criteria); 1130 List results = new ArrayList (); 1131 1132 for (int i = 0; i < rows.size(); i++) 1133 { 1134 Record row = (Record) rows.get(i); 1135 1136 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1137 OnlineSubscription obj1 = (OnlineSubscription) OnlineSubscriptionPeer 1138 .row2Object(row, 1, omClass); 1139 omClass = ProductPeer.getOMClass(); 1140 Product obj2 = (Product)ProductPeer 1141 .row2Object(row, offset, omClass); 1142 1143 boolean newObject = true; 1144 for (int j = 0; j < results.size(); j++) 1145 { 1146 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1147 Product temp_obj2 = (Product)temp_obj1.getProduct(); 1148 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1149 { 1150 newObject = false; 1151 temp_obj2.addOnlineSubscription(obj1); 1152 break; 1153 } 1154 } 1155 if (newObject) 1156 { 1157 obj2.initOnlineSubscriptions(); 1158 obj2.addOnlineSubscription(obj1); 1159 } 1160 results.add(obj1); 1161 } 1162 return results; 1163 } 1164 1165 1166 1167 1168 1179 protected static List doSelectJoinSorder(Criteria criteria) 1180 throws TorqueException 1181 { 1182 setDbName(criteria); 1183 1184 OnlineSubscriptionPeer.addSelectColumns(criteria); 1185 int offset = numColumns + 1; 1186 SorderPeer.addSelectColumns(criteria); 1187 1188 1189 criteria.addJoin(OnlineSubscriptionPeer.SORDER_ID, 1190 SorderPeer.SORDER_ID); 1191 1192 1193 1194 List rows = BasePeer.doSelect(criteria); 1195 List results = new ArrayList (); 1196 1197 for (int i = 0; i < rows.size(); i++) 1198 { 1199 Record row = (Record) rows.get(i); 1200 1201 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1202 OnlineSubscription obj1 = (OnlineSubscription) OnlineSubscriptionPeer 1203 .row2Object(row, 1, omClass); 1204 omClass = SorderPeer.getOMClass(); 1205 Sorder obj2 = (Sorder)SorderPeer 1206 .row2Object(row, offset, omClass); 1207 1208 boolean newObject = true; 1209 for (int j = 0; j < results.size(); j++) 1210 { 1211 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1212 Sorder temp_obj2 = (Sorder)temp_obj1.getSorder(); 1213 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1214 { 1215 newObject = false; 1216 temp_obj2.addOnlineSubscription(obj1); 1217 break; 1218 } 1219 } 1220 if (newObject) 1221 { 1222 obj2.initOnlineSubscriptions(); 1223 obj2.addOnlineSubscription(obj1); 1224 } 1225 results.add(obj1); 1226 } 1227 return results; 1228 } 1229 1230 1231 1232 1233 1234 1235 1236 1237 1248 protected static List doSelectJoinAllExceptCustomerRelatedByCustomerId(Criteria criteria) 1249 throws TorqueException 1250 { 1251 setDbName(criteria); 1252 1253 addSelectColumns(criteria); 1254 int offset2 = numColumns + 1; 1255 1256 1257 1258 ProjectPeer.addSelectColumns(criteria); 1259 int offset3 = offset2 + ProjectPeer.numColumns; 1260 1261 ProductPeer.addSelectColumns(criteria); 1262 int offset4 = offset3 + ProductPeer.numColumns; 1263 1264 SorderPeer.addSelectColumns(criteria); 1265 int offset5 = offset4 + SorderPeer.numColumns; 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 = OnlineSubscriptionPeer.getOMClass(); 1275 OnlineSubscription obj1 = (OnlineSubscription)OnlineSubscriptionPeer 1276 .row2Object(row, 1, omClass); 1277 1278 1279 1280 1281 1282 1283 omClass = ProjectPeer.getOMClass(); 1284 Project obj2 = (Project)ProjectPeer 1285 .row2Object( row, offset2, omClass); 1286 1287 boolean newObject = true; 1288 for (int j = 0; j < results.size(); j++) 1289 { 1290 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1291 Project temp_obj2 = (Project)temp_obj1.getProject(); 1292 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1293 { 1294 newObject = false; 1295 temp_obj2.addOnlineSubscription(obj1); 1296 break; 1297 } 1298 } 1299 if (newObject) 1300 { 1301 obj2.initOnlineSubscriptions(); 1302 obj2.addOnlineSubscription(obj1); 1303 } 1304 1305 1306 1307 1308 omClass = ProductPeer.getOMClass(); 1309 Product obj3 = (Product)ProductPeer 1310 .row2Object( row, offset3, omClass); 1311 1312 newObject = true; 1313 for (int j = 0; j < results.size(); j++) 1314 { 1315 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1316 Product temp_obj3 = (Product)temp_obj1.getProduct(); 1317 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1318 { 1319 newObject = false; 1320 temp_obj3.addOnlineSubscription(obj1); 1321 break; 1322 } 1323 } 1324 if (newObject) 1325 { 1326 obj3.initOnlineSubscriptions(); 1327 obj3.addOnlineSubscription(obj1); 1328 } 1329 1330 1331 1332 1333 omClass = SorderPeer.getOMClass(); 1334 Sorder obj4 = (Sorder)SorderPeer 1335 .row2Object( row, offset4, omClass); 1336 1337 newObject = true; 1338 for (int j = 0; j < results.size(); j++) 1339 { 1340 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1341 Sorder temp_obj4 = (Sorder)temp_obj1.getSorder(); 1342 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1343 { 1344 newObject = false; 1345 temp_obj4.addOnlineSubscription(obj1); 1346 break; 1347 } 1348 } 1349 if (newObject) 1350 { 1351 obj4.initOnlineSubscriptions(); 1352 obj4.addOnlineSubscription(obj1); 1353 } 1354 results.add(obj1); 1355 } 1356 return results; 1357 } 1358 1359 1360 1361 1362 1363 1374 protected static List doSelectJoinAllExceptCustomerRelatedByRecipientId(Criteria criteria) 1375 throws TorqueException 1376 { 1377 setDbName(criteria); 1378 1379 addSelectColumns(criteria); 1380 int offset2 = numColumns + 1; 1381 1382 1383 1384 ProjectPeer.addSelectColumns(criteria); 1385 int offset3 = offset2 + ProjectPeer.numColumns; 1386 1387 ProductPeer.addSelectColumns(criteria); 1388 int offset4 = offset3 + ProductPeer.numColumns; 1389 1390 SorderPeer.addSelectColumns(criteria); 1391 int offset5 = offset4 + SorderPeer.numColumns; 1392 1393 List rows = BasePeer.doSelect(criteria); 1394 List results = new ArrayList (); 1395 1396 for (int i = 0; i < rows.size(); i++) 1397 { 1398 Record row = (Record)rows.get(i); 1399 1400 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1401 OnlineSubscription obj1 = (OnlineSubscription)OnlineSubscriptionPeer 1402 .row2Object(row, 1, omClass); 1403 1404 1405 1406 1407 1408 1409 omClass = ProjectPeer.getOMClass(); 1410 Project obj2 = (Project)ProjectPeer 1411 .row2Object( row, offset2, omClass); 1412 1413 boolean newObject = true; 1414 for (int j = 0; j < results.size(); j++) 1415 { 1416 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1417 Project temp_obj2 = (Project)temp_obj1.getProject(); 1418 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1419 { 1420 newObject = false; 1421 temp_obj2.addOnlineSubscription(obj1); 1422 break; 1423 } 1424 } 1425 if (newObject) 1426 { 1427 obj2.initOnlineSubscriptions(); 1428 obj2.addOnlineSubscription(obj1); 1429 } 1430 1431 1432 1433 1434 omClass = ProductPeer.getOMClass(); 1435 Product obj3 = (Product)ProductPeer 1436 .row2Object( row, offset3, omClass); 1437 1438 newObject = true; 1439 for (int j = 0; j < results.size(); j++) 1440 { 1441 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1442 Product temp_obj3 = (Product)temp_obj1.getProduct(); 1443 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1444 { 1445 newObject = false; 1446 temp_obj3.addOnlineSubscription(obj1); 1447 break; 1448 } 1449 } 1450 if (newObject) 1451 { 1452 obj3.initOnlineSubscriptions(); 1453 obj3.addOnlineSubscription(obj1); 1454 } 1455 1456 1457 1458 1459 omClass = SorderPeer.getOMClass(); 1460 Sorder obj4 = (Sorder)SorderPeer 1461 .row2Object( row, offset4, omClass); 1462 1463 newObject = true; 1464 for (int j = 0; j < results.size(); j++) 1465 { 1466 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1467 Sorder temp_obj4 = (Sorder)temp_obj1.getSorder(); 1468 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1469 { 1470 newObject = false; 1471 temp_obj4.addOnlineSubscription(obj1); 1472 break; 1473 } 1474 } 1475 if (newObject) 1476 { 1477 obj4.initOnlineSubscriptions(); 1478 obj4.addOnlineSubscription(obj1); 1479 } 1480 results.add(obj1); 1481 } 1482 return results; 1483 } 1484 1485 1486 1487 1488 1489 1500 protected static List doSelectJoinAllExceptProject(Criteria criteria) 1501 throws TorqueException 1502 { 1503 setDbName(criteria); 1504 1505 addSelectColumns(criteria); 1506 int offset2 = numColumns + 1; 1507 1508 CustomerPeer.addSelectColumns(criteria); 1509 int offset3 = offset2 + CustomerPeer.numColumns; 1510 1511 CustomerPeer.addSelectColumns(criteria); 1512 int offset4 = offset3 + CustomerPeer.numColumns; 1513 1514 1515 ProductPeer.addSelectColumns(criteria); 1516 int offset5 = offset4 + ProductPeer.numColumns; 1517 1518 SorderPeer.addSelectColumns(criteria); 1519 int offset6 = offset5 + SorderPeer.numColumns; 1520 1521 List rows = BasePeer.doSelect(criteria); 1522 List results = new ArrayList (); 1523 1524 for (int i = 0; i < rows.size(); i++) 1525 { 1526 Record row = (Record)rows.get(i); 1527 1528 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1529 OnlineSubscription obj1 = (OnlineSubscription)OnlineSubscriptionPeer 1530 .row2Object(row, 1, omClass); 1531 1532 1533 1534 1535 omClass = CustomerPeer.getOMClass(); 1536 Customer obj2 = (Customer)CustomerPeer 1537 .row2Object( row, offset2, omClass); 1538 1539 boolean newObject = true; 1540 for (int j = 0; j < results.size(); j++) 1541 { 1542 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1543 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 1544 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1545 { 1546 newObject = false; 1547 temp_obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1548 break; 1549 } 1550 } 1551 if (newObject) 1552 { 1553 obj2.initOnlineSubscriptionsRelatedByCustomerId(); 1554 obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1555 } 1556 1557 1558 1559 1560 omClass = CustomerPeer.getOMClass(); 1561 Customer obj3 = (Customer)CustomerPeer 1562 .row2Object( row, offset3, omClass); 1563 1564 newObject = true; 1565 for (int j = 0; j < results.size(); j++) 1566 { 1567 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1568 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1569 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1570 { 1571 newObject = false; 1572 temp_obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1573 break; 1574 } 1575 } 1576 if (newObject) 1577 { 1578 obj3.initOnlineSubscriptionsRelatedByRecipientId(); 1579 obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1580 } 1581 1582 1583 1584 1585 1586 omClass = ProductPeer.getOMClass(); 1587 Product obj4 = (Product)ProductPeer 1588 .row2Object( row, offset4, omClass); 1589 1590 newObject = true; 1591 for (int j = 0; j < results.size(); j++) 1592 { 1593 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1594 Product temp_obj4 = (Product)temp_obj1.getProduct(); 1595 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1596 { 1597 newObject = false; 1598 temp_obj4.addOnlineSubscription(obj1); 1599 break; 1600 } 1601 } 1602 if (newObject) 1603 { 1604 obj4.initOnlineSubscriptions(); 1605 obj4.addOnlineSubscription(obj1); 1606 } 1607 1608 1609 1610 1611 omClass = SorderPeer.getOMClass(); 1612 Sorder obj5 = (Sorder)SorderPeer 1613 .row2Object( row, offset5, omClass); 1614 1615 newObject = true; 1616 for (int j = 0; j < results.size(); j++) 1617 { 1618 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1619 Sorder temp_obj5 = (Sorder)temp_obj1.getSorder(); 1620 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1621 { 1622 newObject = false; 1623 temp_obj5.addOnlineSubscription(obj1); 1624 break; 1625 } 1626 } 1627 if (newObject) 1628 { 1629 obj5.initOnlineSubscriptions(); 1630 obj5.addOnlineSubscription(obj1); 1631 } 1632 results.add(obj1); 1633 } 1634 return results; 1635 } 1636 1637 1638 1639 1640 1641 1652 protected static List doSelectJoinAllExceptProduct(Criteria criteria) 1653 throws TorqueException 1654 { 1655 setDbName(criteria); 1656 1657 addSelectColumns(criteria); 1658 int offset2 = numColumns + 1; 1659 1660 CustomerPeer.addSelectColumns(criteria); 1661 int offset3 = offset2 + CustomerPeer.numColumns; 1662 1663 CustomerPeer.addSelectColumns(criteria); 1664 int offset4 = offset3 + CustomerPeer.numColumns; 1665 1666 ProjectPeer.addSelectColumns(criteria); 1667 int offset5 = offset4 + ProjectPeer.numColumns; 1668 1669 1670 SorderPeer.addSelectColumns(criteria); 1671 int offset6 = offset5 + SorderPeer.numColumns; 1672 1673 List rows = BasePeer.doSelect(criteria); 1674 List results = new ArrayList (); 1675 1676 for (int i = 0; i < rows.size(); i++) 1677 { 1678 Record row = (Record)rows.get(i); 1679 1680 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1681 OnlineSubscription obj1 = (OnlineSubscription)OnlineSubscriptionPeer 1682 .row2Object(row, 1, omClass); 1683 1684 1685 1686 1687 omClass = CustomerPeer.getOMClass(); 1688 Customer obj2 = (Customer)CustomerPeer 1689 .row2Object( row, offset2, omClass); 1690 1691 boolean newObject = true; 1692 for (int j = 0; j < results.size(); j++) 1693 { 1694 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1695 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 1696 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1697 { 1698 newObject = false; 1699 temp_obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1700 break; 1701 } 1702 } 1703 if (newObject) 1704 { 1705 obj2.initOnlineSubscriptionsRelatedByCustomerId(); 1706 obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1707 } 1708 1709 1710 1711 1712 omClass = CustomerPeer.getOMClass(); 1713 Customer obj3 = (Customer)CustomerPeer 1714 .row2Object( row, offset3, omClass); 1715 1716 newObject = true; 1717 for (int j = 0; j < results.size(); j++) 1718 { 1719 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1720 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1721 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1722 { 1723 newObject = false; 1724 temp_obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1725 break; 1726 } 1727 } 1728 if (newObject) 1729 { 1730 obj3.initOnlineSubscriptionsRelatedByRecipientId(); 1731 obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1732 } 1733 1734 1735 1736 1737 omClass = ProjectPeer.getOMClass(); 1738 Project obj4 = (Project)ProjectPeer 1739 .row2Object( row, offset4, omClass); 1740 1741 newObject = true; 1742 for (int j = 0; j < results.size(); j++) 1743 { 1744 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1745 Project temp_obj4 = (Project)temp_obj1.getProject(); 1746 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1747 { 1748 newObject = false; 1749 temp_obj4.addOnlineSubscription(obj1); 1750 break; 1751 } 1752 } 1753 if (newObject) 1754 { 1755 obj4.initOnlineSubscriptions(); 1756 obj4.addOnlineSubscription(obj1); 1757 } 1758 1759 1760 1761 1762 1763 omClass = SorderPeer.getOMClass(); 1764 Sorder obj5 = (Sorder)SorderPeer 1765 .row2Object( row, offset5, omClass); 1766 1767 newObject = true; 1768 for (int j = 0; j < results.size(); j++) 1769 { 1770 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1771 Sorder temp_obj5 = (Sorder)temp_obj1.getSorder(); 1772 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1773 { 1774 newObject = false; 1775 temp_obj5.addOnlineSubscription(obj1); 1776 break; 1777 } 1778 } 1779 if (newObject) 1780 { 1781 obj5.initOnlineSubscriptions(); 1782 obj5.addOnlineSubscription(obj1); 1783 } 1784 results.add(obj1); 1785 } 1786 return results; 1787 } 1788 1789 1790 1791 1792 1793 1804 protected static List doSelectJoinAllExceptSorder(Criteria criteria) 1805 throws TorqueException 1806 { 1807 setDbName(criteria); 1808 1809 addSelectColumns(criteria); 1810 int offset2 = numColumns + 1; 1811 1812 CustomerPeer.addSelectColumns(criteria); 1813 int offset3 = offset2 + CustomerPeer.numColumns; 1814 1815 CustomerPeer.addSelectColumns(criteria); 1816 int offset4 = offset3 + CustomerPeer.numColumns; 1817 1818 ProjectPeer.addSelectColumns(criteria); 1819 int offset5 = offset4 + ProjectPeer.numColumns; 1820 1821 ProductPeer.addSelectColumns(criteria); 1822 int offset6 = offset5 + ProductPeer.numColumns; 1823 1824 1825 List rows = BasePeer.doSelect(criteria); 1826 List results = new ArrayList (); 1827 1828 for (int i = 0; i < rows.size(); i++) 1829 { 1830 Record row = (Record)rows.get(i); 1831 1832 Class omClass = OnlineSubscriptionPeer.getOMClass(); 1833 OnlineSubscription obj1 = (OnlineSubscription)OnlineSubscriptionPeer 1834 .row2Object(row, 1, omClass); 1835 1836 1837 1838 1839 omClass = CustomerPeer.getOMClass(); 1840 Customer obj2 = (Customer)CustomerPeer 1841 .row2Object( row, offset2, omClass); 1842 1843 boolean newObject = true; 1844 for (int j = 0; j < results.size(); j++) 1845 { 1846 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1847 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId(); 1848 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey())) 1849 { 1850 newObject = false; 1851 temp_obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1852 break; 1853 } 1854 } 1855 if (newObject) 1856 { 1857 obj2.initOnlineSubscriptionsRelatedByCustomerId(); 1858 obj2.addOnlineSubscriptionRelatedByCustomerId(obj1); 1859 } 1860 1861 1862 1863 1864 omClass = CustomerPeer.getOMClass(); 1865 Customer obj3 = (Customer)CustomerPeer 1866 .row2Object( row, offset3, omClass); 1867 1868 newObject = true; 1869 for (int j = 0; j < results.size(); j++) 1870 { 1871 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1872 Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId(); 1873 if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey())) 1874 { 1875 newObject = false; 1876 temp_obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1877 break; 1878 } 1879 } 1880 if (newObject) 1881 { 1882 obj3.initOnlineSubscriptionsRelatedByRecipientId(); 1883 obj3.addOnlineSubscriptionRelatedByRecipientId(obj1); 1884 } 1885 1886 1887 1888 1889 omClass = ProjectPeer.getOMClass(); 1890 Project obj4 = (Project)ProjectPeer 1891 .row2Object( row, offset4, omClass); 1892 1893 newObject = true; 1894 for (int j = 0; j < results.size(); j++) 1895 { 1896 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1897 Project temp_obj4 = (Project)temp_obj1.getProject(); 1898 if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey())) 1899 { 1900 newObject = false; 1901 temp_obj4.addOnlineSubscription(obj1); 1902 break; 1903 } 1904 } 1905 if (newObject) 1906 { 1907 obj4.initOnlineSubscriptions(); 1908 obj4.addOnlineSubscription(obj1); 1909 } 1910 1911 1912 1913 1914 omClass = ProductPeer.getOMClass(); 1915 Product obj5 = (Product)ProductPeer 1916 .row2Object( row, offset5, omClass); 1917 1918 newObject = true; 1919 for (int j = 0; j < results.size(); j++) 1920 { 1921 OnlineSubscription temp_obj1 = (OnlineSubscription)results.get(j); 1922 Product temp_obj5 = (Product)temp_obj1.getProduct(); 1923 if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey())) 1924 { 1925 newObject = false; 1926 temp_obj5.addOnlineSubscription(obj1); 1927 break; 1928 } 1929 } 1930 if (newObject) 1931 { 1932 obj5.initOnlineSubscriptions(); 1933 obj5.addOnlineSubscription(obj1); 1934 } 1935 1936 results.add(obj1); 1937 } 1938 return results; 1939 } 1940 1941 1942 1949 protected static TableMap getTableMap() 1950 throws TorqueException 1951 { 1952 return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME); 1953 } 1954 1955 private static void setDbName(Criteria crit) 1956 { 1957 if (crit.getDbName() == Torque.getDefaultDB()) 1961 { 1962 crit.setDbName(DATABASE_NAME); 1963 } 1964 } 1965} 1966
| Popular Tags
|