1 package org.campware.cream.om; 2 3 4 import java.math.BigDecimal ; 5 import java.sql.Connection ; 6 import java.util.ArrayList ; 7 import java.util.Collections ; 8 import java.util.Date ; 9 import java.util.List ; 10 11 import org.apache.commons.lang.ObjectUtils; 12 import org.apache.turbine.om.Retrievable; 13 import org.apache.torque.TorqueException; 14 import org.apache.torque.om.BaseObject; 15 import org.apache.torque.om.ComboKey; 16 import org.apache.torque.om.DateKey; 17 import org.apache.torque.om.NumberKey; 18 import org.apache.torque.om.ObjectKey; 19 import org.apache.torque.om.SimpleKey; 20 import org.apache.torque.om.StringKey; 21 import org.apache.torque.om.Persistent; 22 import org.apache.torque.util.Criteria; 23 import org.apache.torque.util.Transaction; 24 25 26 27 28 29 30 31 39 public abstract class BaseSorder extends BaseObject 40 implements org.apache.turbine.om.Retrievable 41 { 42 43 private static final SorderPeer peer = 44 new SorderPeer(); 45 46 47 48 private int sorderId; 49 50 51 private String sorderCode = "AUTO"; 52 53 54 private int status = 30; 55 56 57 private int priority = 30; 58 59 60 private Date issuedDate; 61 62 63 private Date closedDate; 64 65 66 private int customerId = 1000; 67 68 69 private int recipientId = 1000; 70 71 72 private int projectId = 1000; 73 74 75 private int carrierId = 1000; 76 77 78 private int payTerm = 10; 79 80 81 private int payMethod = 10; 82 83 84 private int currencyId = 1000; 85 86 87 private BigDecimal currencyAmount= new BigDecimal (0); 88 89 90 private String subject = "---"; 91 92 93 private String notes; 94 95 96 private Date created; 97 98 99 private Date modified; 100 101 102 private String createdBy; 103 104 105 private String modifiedBy; 106 107 108 113 public int getSorderId() 114 { 115 return sorderId; 116 } 117 118 119 124 public void setSorderId(int v) throws TorqueException 125 { 126 127 if (this.sorderId != v) 128 { 129 this.sorderId = v; 130 setModified(true); 131 } 132 133 134 135 if (collPayments != null) 137 { 138 for (int i = 0; i < collPayments.size(); i++) 139 { 140 ((Payment) collPayments.get(i)) 141 .setSorderId(v); 142 } 143 } 144 145 if (collServices != null) 147 { 148 for (int i = 0; i < collServices.size(); i++) 149 { 150 ((Service) collServices.get(i)) 151 .setSorderId(v); 152 } 153 } 154 155 if (collShipments != null) 157 { 158 for (int i = 0; i < collShipments.size(); i++) 159 { 160 ((Shipment) collShipments.get(i)) 161 .setSorderId(v); 162 } 163 } 164 165 if (collPrintSubscriptions != null) 167 { 168 for (int i = 0; i < collPrintSubscriptions.size(); i++) 169 { 170 ((PrintSubscription) collPrintSubscriptions.get(i)) 171 .setSorderId(v); 172 } 173 } 174 175 if (collOnlineSubscriptions != null) 177 { 178 for (int i = 0; i < collOnlineSubscriptions.size(); i++) 179 { 180 ((OnlineSubscription) collOnlineSubscriptions.get(i)) 181 .setSorderId(v); 182 } 183 } 184 185 if (collSorderItems != null) 187 { 188 for (int i = 0; i < collSorderItems.size(); i++) 189 { 190 ((SorderItem) collSorderItems.get(i)) 191 .setSorderId(v); 192 } 193 } 194 195 if (collPaymentItems != null) 197 { 198 for (int i = 0; i < collPaymentItems.size(); i++) 199 { 200 ((PaymentItem) collPaymentItems.get(i)) 201 .setSorderId(v); 202 } 203 } 204 205 if (collShipmentItems != null) 207 { 208 for (int i = 0; i < collShipmentItems.size(); i++) 209 { 210 ((ShipmentItem) collShipmentItems.get(i)) 211 .setSorderId(v); 212 } 213 } 214 215 if (collServiceItems != null) 217 { 218 for (int i = 0; i < collServiceItems.size(); i++) 219 { 220 ((ServiceItem) collServiceItems.get(i)) 221 .setSorderId(v); 222 } 223 } 224 } 225 226 231 public String getSorderCode() 232 { 233 return sorderCode; 234 } 235 236 237 242 public void setSorderCode(String v) 243 { 244 245 if (!ObjectUtils.equals(this.sorderCode, v)) 246 { 247 this.sorderCode = v; 248 setModified(true); 249 } 250 251 252 } 253 254 259 public int getStatus() 260 { 261 return status; 262 } 263 264 265 270 public void setStatus(int v) 271 { 272 273 if (this.status != v) 274 { 275 this.status = v; 276 setModified(true); 277 } 278 279 280 } 281 282 287 public int getPriority() 288 { 289 return priority; 290 } 291 292 293 298 public void setPriority(int v) 299 { 300 301 if (this.priority != v) 302 { 303 this.priority = v; 304 setModified(true); 305 } 306 307 308 } 309 310 315 public Date getIssuedDate() 316 { 317 return issuedDate; 318 } 319 320 321 326 public void setIssuedDate(Date v) 327 { 328 329 if (!ObjectUtils.equals(this.issuedDate, v)) 330 { 331 this.issuedDate = v; 332 setModified(true); 333 } 334 335 336 } 337 338 343 public Date getClosedDate() 344 { 345 return closedDate; 346 } 347 348 349 354 public void setClosedDate(Date v) 355 { 356 357 if (!ObjectUtils.equals(this.closedDate, v)) 358 { 359 this.closedDate = v; 360 setModified(true); 361 } 362 363 364 } 365 366 371 public int getCustomerId() 372 { 373 return customerId; 374 } 375 376 377 382 public void setCustomerId(int v) throws TorqueException 383 { 384 385 if (this.customerId != v) 386 { 387 this.customerId = v; 388 setModified(true); 389 } 390 391 392 if (aCustomerRelatedByCustomerId != null && !(aCustomerRelatedByCustomerId.getCustomerId() == v)) 393 { 394 aCustomerRelatedByCustomerId = null; 395 } 396 397 } 398 399 404 public int getRecipientId() 405 { 406 return recipientId; 407 } 408 409 410 415 public void setRecipientId(int v) throws TorqueException 416 { 417 418 if (this.recipientId != v) 419 { 420 this.recipientId = v; 421 setModified(true); 422 } 423 424 425 if (aCustomerRelatedByRecipientId != null && !(aCustomerRelatedByRecipientId.getCustomerId() == v)) 426 { 427 aCustomerRelatedByRecipientId = null; 428 } 429 430 } 431 432 437 public int getProjectId() 438 { 439 return projectId; 440 } 441 442 443 448 public void setProjectId(int v) throws TorqueException 449 { 450 451 if (this.projectId != v) 452 { 453 this.projectId = v; 454 setModified(true); 455 } 456 457 458 if (aProject != null && !(aProject.getProjectId() == v)) 459 { 460 aProject = null; 461 } 462 463 } 464 465 470 public int getCarrierId() 471 { 472 return carrierId; 473 } 474 475 476 481 public void setCarrierId(int v) throws TorqueException 482 { 483 484 if (this.carrierId != v) 485 { 486 this.carrierId = v; 487 setModified(true); 488 } 489 490 491 if (aCarrier != null && !(aCarrier.getCarrierId() == v)) 492 { 493 aCarrier = null; 494 } 495 496 } 497 498 503 public int getPayTerm() 504 { 505 return payTerm; 506 } 507 508 509 514 public void setPayTerm(int v) 515 { 516 517 if (this.payTerm != v) 518 { 519 this.payTerm = v; 520 setModified(true); 521 } 522 523 524 } 525 526 531 public int getPayMethod() 532 { 533 return payMethod; 534 } 535 536 537 542 public void setPayMethod(int v) 543 { 544 545 if (this.payMethod != v) 546 { 547 this.payMethod = v; 548 setModified(true); 549 } 550 551 552 } 553 554 559 public int getCurrencyId() 560 { 561 return currencyId; 562 } 563 564 565 570 public void setCurrencyId(int v) throws TorqueException 571 { 572 573 if (this.currencyId != v) 574 { 575 this.currencyId = v; 576 setModified(true); 577 } 578 579 580 if (aCurrency != null && !(aCurrency.getCurrencyId() == v)) 581 { 582 aCurrency = null; 583 } 584 585 } 586 587 592 public BigDecimal getCurrencyAmount() 593 { 594 return currencyAmount; 595 } 596 597 598 603 public void setCurrencyAmount(BigDecimal v) 604 { 605 606 if (!ObjectUtils.equals(this.currencyAmount, v)) 607 { 608 this.currencyAmount = v; 609 setModified(true); 610 } 611 612 613 } 614 615 620 public String getSubject() 621 { 622 return subject; 623 } 624 625 626 631 public void setSubject(String v) 632 { 633 634 if (!ObjectUtils.equals(this.subject, v)) 635 { 636 this.subject = v; 637 setModified(true); 638 } 639 640 641 } 642 643 648 public String getNotes() 649 { 650 return notes; 651 } 652 653 654 659 public void setNotes(String v) 660 { 661 662 if (!ObjectUtils.equals(this.notes, v)) 663 { 664 this.notes = v; 665 setModified(true); 666 } 667 668 669 } 670 671 676 public Date getCreated() 677 { 678 return created; 679 } 680 681 682 687 public void setCreated(Date v) 688 { 689 690 if (!ObjectUtils.equals(this.created, v)) 691 { 692 this.created = v; 693 setModified(true); 694 } 695 696 697 } 698 699 704 public Date getModified() 705 { 706 return modified; 707 } 708 709 710 715 public void setModified(Date v) 716 { 717 718 if (!ObjectUtils.equals(this.modified, v)) 719 { 720 this.modified = v; 721 setModified(true); 722 } 723 724 725 } 726 727 732 public String getCreatedBy() 733 { 734 return createdBy; 735 } 736 737 738 743 public void setCreatedBy(String v) 744 { 745 746 if (!ObjectUtils.equals(this.createdBy, v)) 747 { 748 this.createdBy = v; 749 setModified(true); 750 } 751 752 753 } 754 755 760 public String getModifiedBy() 761 { 762 return modifiedBy; 763 } 764 765 766 771 public void setModifiedBy(String v) 772 { 773 774 if (!ObjectUtils.equals(this.modifiedBy, v)) 775 { 776 this.modifiedBy = v; 777 setModified(true); 778 } 779 780 781 } 782 783 784 785 786 787 private Customer aCustomerRelatedByCustomerId; 788 789 795 public void setCustomerRelatedByCustomerId(Customer v) throws TorqueException 796 { 797 if (v == null) 798 { 799 setCustomerId( 1000); 800 } 801 else 802 { 803 setCustomerId(v.getCustomerId()); 804 } 805 aCustomerRelatedByCustomerId = v; 806 } 807 808 809 815 public Customer getCustomerRelatedByCustomerId() throws TorqueException 816 { 817 if (aCustomerRelatedByCustomerId == null && (this.customerId != 0)) 818 { 819 aCustomerRelatedByCustomerId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.customerId)); 820 821 830 } 831 return aCustomerRelatedByCustomerId; 832 } 833 834 840 public void setCustomerRelatedByCustomerIdKey(ObjectKey key) throws TorqueException 841 { 842 843 setCustomerId(((NumberKey) key).intValue()); 844 } 845 846 847 848 849 private Customer aCustomerRelatedByRecipientId; 850 851 857 public void setCustomerRelatedByRecipientId(Customer v) throws TorqueException 858 { 859 if (v == null) 860 { 861 setRecipientId( 1000); 862 } 863 else 864 { 865 setRecipientId(v.getCustomerId()); 866 } 867 aCustomerRelatedByRecipientId = v; 868 } 869 870 871 877 public Customer getCustomerRelatedByRecipientId() throws TorqueException 878 { 879 if (aCustomerRelatedByRecipientId == null && (this.recipientId != 0)) 880 { 881 aCustomerRelatedByRecipientId = CustomerPeer.retrieveByPK(SimpleKey.keyFor(this.recipientId)); 882 883 892 } 893 return aCustomerRelatedByRecipientId; 894 } 895 896 902 public void setCustomerRelatedByRecipientIdKey(ObjectKey key) throws TorqueException 903 { 904 905 setRecipientId(((NumberKey) key).intValue()); 906 } 907 908 909 910 911 private Project aProject; 912 913 919 public void setProject(Project v) throws TorqueException 920 { 921 if (v == null) 922 { 923 setProjectId( 1000); 924 } 925 else 926 { 927 setProjectId(v.getProjectId()); 928 } 929 aProject = v; 930 } 931 932 933 939 public Project getProject() throws TorqueException 940 { 941 if (aProject == null && (this.projectId != 0)) 942 { 943 aProject = ProjectPeer.retrieveByPK(SimpleKey.keyFor(this.projectId)); 944 945 954 } 955 return aProject; 956 } 957 958 964 public void setProjectKey(ObjectKey key) throws TorqueException 965 { 966 967 setProjectId(((NumberKey) key).intValue()); 968 } 969 970 971 972 973 private Carrier aCarrier; 974 975 981 public void setCarrier(Carrier v) throws TorqueException 982 { 983 if (v == null) 984 { 985 setCarrierId( 1000); 986 } 987 else 988 { 989 setCarrierId(v.getCarrierId()); 990 } 991 aCarrier = v; 992 } 993 994 995 1001 public Carrier getCarrier() throws TorqueException 1002 { 1003 if (aCarrier == null && (this.carrierId != 0)) 1004 { 1005 aCarrier = CarrierPeer.retrieveByPK(SimpleKey.keyFor(this.carrierId)); 1006 1007 1016 } 1017 return aCarrier; 1018 } 1019 1020 1026 public void setCarrierKey(ObjectKey key) throws TorqueException 1027 { 1028 1029 setCarrierId(((NumberKey) key).intValue()); 1030 } 1031 1032 1033 1034 1035 private Currency aCurrency; 1036 1037 1043 public void setCurrency(Currency v) throws TorqueException 1044 { 1045 if (v == null) 1046 { 1047 setCurrencyId( 1000); 1048 } 1049 else 1050 { 1051 setCurrencyId(v.getCurrencyId()); 1052 } 1053 aCurrency = v; 1054 } 1055 1056 1057 1063 public Currency getCurrency() throws TorqueException 1064 { 1065 if (aCurrency == null && (this.currencyId != 0)) 1066 { 1067 aCurrency = CurrencyPeer.retrieveByPK(SimpleKey.keyFor(this.currencyId)); 1068 1069 1078 } 1079 return aCurrency; 1080 } 1081 1082 1088 public void setCurrencyKey(ObjectKey key) throws TorqueException 1089 { 1090 1091 setCurrencyId(((NumberKey) key).intValue()); 1092 } 1093 1094 1095 1096 1099 protected List collPayments; 1100 1101 1106 protected void initPayments() 1107 { 1108 if (collPayments == null) 1109 { 1110 collPayments = new ArrayList (); 1111 } 1112 } 1113 1114 1121 public void addPayment(Payment l) throws TorqueException 1122 { 1123 getPayments().add(l); 1124 l.setSorder((Sorder) this); 1125 } 1126 1127 1130 private Criteria lastPaymentsCriteria = null; 1131 1132 1139 public List getPayments() throws TorqueException 1140 { 1141 if (collPayments == null) 1142 { 1143 collPayments = getPayments(new Criteria(10)); 1144 } 1145 return collPayments; 1146 } 1147 1148 1159 public List getPayments(Criteria criteria) throws TorqueException 1160 { 1161 if (collPayments == null) 1162 { 1163 if (isNew()) 1164 { 1165 collPayments = new ArrayList (); 1166 } 1167 else 1168 { 1169 criteria.add(PaymentPeer.SORDER_ID, getSorderId() ); 1170 collPayments = PaymentPeer.doSelect(criteria); 1171 } 1172 } 1173 else 1174 { 1175 if (!isNew()) 1177 { 1178 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1182 if (!lastPaymentsCriteria.equals(criteria)) 1183 { 1184 collPayments = PaymentPeer.doSelect(criteria); 1185 } 1186 } 1187 } 1188 lastPaymentsCriteria = criteria; 1189 1190 return collPayments; 1191 } 1192 1193 1201 public List getPayments(Connection con) throws TorqueException 1202 { 1203 if (collPayments == null) 1204 { 1205 collPayments = getPayments(new Criteria(10), con); 1206 } 1207 return collPayments; 1208 } 1209 1210 1222 public List getPayments(Criteria criteria, Connection con) 1223 throws TorqueException 1224 { 1225 if (collPayments == null) 1226 { 1227 if (isNew()) 1228 { 1229 collPayments = new ArrayList (); 1230 } 1231 else 1232 { 1233 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1234 collPayments = PaymentPeer.doSelect(criteria, con); 1235 } 1236 } 1237 else 1238 { 1239 if (!isNew()) 1241 { 1242 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1246 if (!lastPaymentsCriteria.equals(criteria)) 1247 { 1248 collPayments = PaymentPeer.doSelect(criteria, con); 1249 } 1250 } 1251 } 1252 lastPaymentsCriteria = criteria; 1253 1254 return collPayments; 1255 } 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1278 protected List getPaymentsJoinCustomer(Criteria criteria) 1279 throws TorqueException 1280 { 1281 if (collPayments == null) 1282 { 1283 if (isNew()) 1284 { 1285 collPayments = new ArrayList (); 1286 } 1287 else 1288 { 1289 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1290 collPayments = PaymentPeer.doSelectJoinCustomer(criteria); 1291 } 1292 } 1293 else 1294 { 1295 1299 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1300 if (!lastPaymentsCriteria.equals(criteria)) 1301 { 1302 collPayments = PaymentPeer.doSelectJoinCustomer(criteria); 1303 } 1304 } 1305 lastPaymentsCriteria = criteria; 1306 1307 return collPayments; 1308 } 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1329 protected List getPaymentsJoinProject(Criteria criteria) 1330 throws TorqueException 1331 { 1332 if (collPayments == null) 1333 { 1334 if (isNew()) 1335 { 1336 collPayments = new ArrayList (); 1337 } 1338 else 1339 { 1340 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1341 collPayments = PaymentPeer.doSelectJoinProject(criteria); 1342 } 1343 } 1344 else 1345 { 1346 1350 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1351 if (!lastPaymentsCriteria.equals(criteria)) 1352 { 1353 collPayments = PaymentPeer.doSelectJoinProject(criteria); 1354 } 1355 } 1356 lastPaymentsCriteria = criteria; 1357 1358 return collPayments; 1359 } 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1380 protected List getPaymentsJoinSorder(Criteria criteria) 1381 throws TorqueException 1382 { 1383 if (collPayments == null) 1384 { 1385 if (isNew()) 1386 { 1387 collPayments = new ArrayList (); 1388 } 1389 else 1390 { 1391 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1392 collPayments = PaymentPeer.doSelectJoinSorder(criteria); 1393 } 1394 } 1395 else 1396 { 1397 1401 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1402 if (!lastPaymentsCriteria.equals(criteria)) 1403 { 1404 collPayments = PaymentPeer.doSelectJoinSorder(criteria); 1405 } 1406 } 1407 lastPaymentsCriteria = criteria; 1408 1409 return collPayments; 1410 } 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1431 protected List getPaymentsJoinCurrency(Criteria criteria) 1432 throws TorqueException 1433 { 1434 if (collPayments == null) 1435 { 1436 if (isNew()) 1437 { 1438 collPayments = new ArrayList (); 1439 } 1440 else 1441 { 1442 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1443 collPayments = PaymentPeer.doSelectJoinCurrency(criteria); 1444 } 1445 } 1446 else 1447 { 1448 1452 criteria.add(PaymentPeer.SORDER_ID, getSorderId()); 1453 if (!lastPaymentsCriteria.equals(criteria)) 1454 { 1455 collPayments = PaymentPeer.doSelectJoinCurrency(criteria); 1456 } 1457 } 1458 lastPaymentsCriteria = criteria; 1459 1460 return collPayments; 1461 } 1462 1463 1464 1465 1466 1467 1470 protected List collServices; 1471 1472 1477 protected void initServices() 1478 { 1479 if (collServices == null) 1480 { 1481 collServices = new ArrayList (); 1482 } 1483 } 1484 1485 1492 public void addService(Service l) throws TorqueException 1493 { 1494 getServices().add(l); 1495 l.setSorder((Sorder) this); 1496 } 1497 1498 1501 private Criteria lastServicesCriteria = null; 1502 1503 1510 public List getServices() throws TorqueException 1511 { 1512 if (collServices == null) 1513 { 1514 collServices = getServices(new Criteria(10)); 1515 } 1516 return collServices; 1517 } 1518 1519 1530 public List getServices(Criteria criteria) throws TorqueException 1531 { 1532 if (collServices == null) 1533 { 1534 if (isNew()) 1535 { 1536 collServices = new ArrayList (); 1537 } 1538 else 1539 { 1540 criteria.add(ServicePeer.SORDER_ID, getSorderId() ); 1541 collServices = ServicePeer.doSelect(criteria); 1542 } 1543 } 1544 else 1545 { 1546 if (!isNew()) 1548 { 1549 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1553 if (!lastServicesCriteria.equals(criteria)) 1554 { 1555 collServices = ServicePeer.doSelect(criteria); 1556 } 1557 } 1558 } 1559 lastServicesCriteria = criteria; 1560 1561 return collServices; 1562 } 1563 1564 1572 public List getServices(Connection con) throws TorqueException 1573 { 1574 if (collServices == null) 1575 { 1576 collServices = getServices(new Criteria(10), con); 1577 } 1578 return collServices; 1579 } 1580 1581 1593 public List getServices(Criteria criteria, Connection con) 1594 throws TorqueException 1595 { 1596 if (collServices == null) 1597 { 1598 if (isNew()) 1599 { 1600 collServices = new ArrayList (); 1601 } 1602 else 1603 { 1604 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1605 collServices = ServicePeer.doSelect(criteria, con); 1606 } 1607 } 1608 else 1609 { 1610 if (!isNew()) 1612 { 1613 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1617 if (!lastServicesCriteria.equals(criteria)) 1618 { 1619 collServices = ServicePeer.doSelect(criteria, con); 1620 } 1621 } 1622 } 1623 lastServicesCriteria = criteria; 1624 1625 return collServices; 1626 } 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1649 protected List getServicesJoinCustomerRelatedByCustomerId(Criteria criteria) 1650 throws TorqueException 1651 { 1652 if (collServices == null) 1653 { 1654 if (isNew()) 1655 { 1656 collServices = new ArrayList (); 1657 } 1658 else 1659 { 1660 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1661 collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1662 } 1663 } 1664 else 1665 { 1666 1670 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1671 if (!lastServicesCriteria.equals(criteria)) 1672 { 1673 collServices = ServicePeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1674 } 1675 } 1676 lastServicesCriteria = criteria; 1677 1678 return collServices; 1679 } 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1700 protected List getServicesJoinCustomerRelatedByRecipientId(Criteria criteria) 1701 throws TorqueException 1702 { 1703 if (collServices == null) 1704 { 1705 if (isNew()) 1706 { 1707 collServices = new ArrayList (); 1708 } 1709 else 1710 { 1711 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1712 collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1713 } 1714 } 1715 else 1716 { 1717 1721 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1722 if (!lastServicesCriteria.equals(criteria)) 1723 { 1724 collServices = ServicePeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1725 } 1726 } 1727 lastServicesCriteria = criteria; 1728 1729 return collServices; 1730 } 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1751 protected List getServicesJoinProject(Criteria criteria) 1752 throws TorqueException 1753 { 1754 if (collServices == null) 1755 { 1756 if (isNew()) 1757 { 1758 collServices = new ArrayList (); 1759 } 1760 else 1761 { 1762 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1763 collServices = ServicePeer.doSelectJoinProject(criteria); 1764 } 1765 } 1766 else 1767 { 1768 1772 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1773 if (!lastServicesCriteria.equals(criteria)) 1774 { 1775 collServices = ServicePeer.doSelectJoinProject(criteria); 1776 } 1777 } 1778 lastServicesCriteria = criteria; 1779 1780 return collServices; 1781 } 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1802 protected List getServicesJoinSorder(Criteria criteria) 1803 throws TorqueException 1804 { 1805 if (collServices == null) 1806 { 1807 if (isNew()) 1808 { 1809 collServices = new ArrayList (); 1810 } 1811 else 1812 { 1813 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1814 collServices = ServicePeer.doSelectJoinSorder(criteria); 1815 } 1816 } 1817 else 1818 { 1819 1823 criteria.add(ServicePeer.SORDER_ID, getSorderId()); 1824 if (!lastServicesCriteria.equals(criteria)) 1825 { 1826 collServices = ServicePeer.doSelectJoinSorder(criteria); 1827 } 1828 } 1829 lastServicesCriteria = criteria; 1830 1831 return collServices; 1832 } 1833 1834 1835 1836 1837 1838 1841 protected List collShipments; 1842 1843 1848 protected void initShipments() 1849 { 1850 if (collShipments == null) 1851 { 1852 collShipments = new ArrayList (); 1853 } 1854 } 1855 1856 1863 public void addShipment(Shipment l) throws TorqueException 1864 { 1865 getShipments().add(l); 1866 l.setSorder((Sorder) this); 1867 } 1868 1869 1872 private Criteria lastShipmentsCriteria = null; 1873 1874 1881 public List getShipments() throws TorqueException 1882 { 1883 if (collShipments == null) 1884 { 1885 collShipments = getShipments(new Criteria(10)); 1886 } 1887 return collShipments; 1888 } 1889 1890 1901 public List getShipments(Criteria criteria) throws TorqueException 1902 { 1903 if (collShipments == null) 1904 { 1905 if (isNew()) 1906 { 1907 collShipments = new ArrayList (); 1908 } 1909 else 1910 { 1911 criteria.add(ShipmentPeer.SORDER_ID, getSorderId() ); 1912 collShipments = ShipmentPeer.doSelect(criteria); 1913 } 1914 } 1915 else 1916 { 1917 if (!isNew()) 1919 { 1920 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 1924 if (!lastShipmentsCriteria.equals(criteria)) 1925 { 1926 collShipments = ShipmentPeer.doSelect(criteria); 1927 } 1928 } 1929 } 1930 lastShipmentsCriteria = criteria; 1931 1932 return collShipments; 1933 } 1934 1935 1943 public List getShipments(Connection con) throws TorqueException 1944 { 1945 if (collShipments == null) 1946 { 1947 collShipments = getShipments(new Criteria(10), con); 1948 } 1949 return collShipments; 1950 } 1951 1952 1964 public List getShipments(Criteria criteria, Connection con) 1965 throws TorqueException 1966 { 1967 if (collShipments == null) 1968 { 1969 if (isNew()) 1970 { 1971 collShipments = new ArrayList (); 1972 } 1973 else 1974 { 1975 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 1976 collShipments = ShipmentPeer.doSelect(criteria, con); 1977 } 1978 } 1979 else 1980 { 1981 if (!isNew()) 1983 { 1984 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 1988 if (!lastShipmentsCriteria.equals(criteria)) 1989 { 1990 collShipments = ShipmentPeer.doSelect(criteria, con); 1991 } 1992 } 1993 } 1994 lastShipmentsCriteria = criteria; 1995 1996 return collShipments; 1997 } 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2020 protected List getShipmentsJoinCustomerRelatedByCustomerId(Criteria criteria) 2021 throws TorqueException 2022 { 2023 if (collShipments == null) 2024 { 2025 if (isNew()) 2026 { 2027 collShipments = new ArrayList (); 2028 } 2029 else 2030 { 2031 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2032 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2033 } 2034 } 2035 else 2036 { 2037 2041 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2042 if (!lastShipmentsCriteria.equals(criteria)) 2043 { 2044 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2045 } 2046 } 2047 lastShipmentsCriteria = criteria; 2048 2049 return collShipments; 2050 } 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2071 protected List getShipmentsJoinCustomerRelatedByRecipientId(Criteria criteria) 2072 throws TorqueException 2073 { 2074 if (collShipments == null) 2075 { 2076 if (isNew()) 2077 { 2078 collShipments = new ArrayList (); 2079 } 2080 else 2081 { 2082 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2083 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2084 } 2085 } 2086 else 2087 { 2088 2092 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2093 if (!lastShipmentsCriteria.equals(criteria)) 2094 { 2095 collShipments = ShipmentPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2096 } 2097 } 2098 lastShipmentsCriteria = criteria; 2099 2100 return collShipments; 2101 } 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2122 protected List getShipmentsJoinProject(Criteria criteria) 2123 throws TorqueException 2124 { 2125 if (collShipments == null) 2126 { 2127 if (isNew()) 2128 { 2129 collShipments = new ArrayList (); 2130 } 2131 else 2132 { 2133 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2134 collShipments = ShipmentPeer.doSelectJoinProject(criteria); 2135 } 2136 } 2137 else 2138 { 2139 2143 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2144 if (!lastShipmentsCriteria.equals(criteria)) 2145 { 2146 collShipments = ShipmentPeer.doSelectJoinProject(criteria); 2147 } 2148 } 2149 lastShipmentsCriteria = criteria; 2150 2151 return collShipments; 2152 } 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2173 protected List getShipmentsJoinSorder(Criteria criteria) 2174 throws TorqueException 2175 { 2176 if (collShipments == null) 2177 { 2178 if (isNew()) 2179 { 2180 collShipments = new ArrayList (); 2181 } 2182 else 2183 { 2184 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2185 collShipments = ShipmentPeer.doSelectJoinSorder(criteria); 2186 } 2187 } 2188 else 2189 { 2190 2194 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2195 if (!lastShipmentsCriteria.equals(criteria)) 2196 { 2197 collShipments = ShipmentPeer.doSelectJoinSorder(criteria); 2198 } 2199 } 2200 lastShipmentsCriteria = criteria; 2201 2202 return collShipments; 2203 } 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2224 protected List getShipmentsJoinCarrier(Criteria criteria) 2225 throws TorqueException 2226 { 2227 if (collShipments == null) 2228 { 2229 if (isNew()) 2230 { 2231 collShipments = new ArrayList (); 2232 } 2233 else 2234 { 2235 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2236 collShipments = ShipmentPeer.doSelectJoinCarrier(criteria); 2237 } 2238 } 2239 else 2240 { 2241 2245 criteria.add(ShipmentPeer.SORDER_ID, getSorderId()); 2246 if (!lastShipmentsCriteria.equals(criteria)) 2247 { 2248 collShipments = ShipmentPeer.doSelectJoinCarrier(criteria); 2249 } 2250 } 2251 lastShipmentsCriteria = criteria; 2252 2253 return collShipments; 2254 } 2255 2256 2257 2258 2259 2260 2263 protected List collPrintSubscriptions; 2264 2265 2270 protected void initPrintSubscriptions() 2271 { 2272 if (collPrintSubscriptions == null) 2273 { 2274 collPrintSubscriptions = new ArrayList (); 2275 } 2276 } 2277 2278 2285 public void addPrintSubscription(PrintSubscription l) throws TorqueException 2286 { 2287 getPrintSubscriptions().add(l); 2288 l.setSorder((Sorder) this); 2289 } 2290 2291 2294 private Criteria lastPrintSubscriptionsCriteria = null; 2295 2296 2303 public List getPrintSubscriptions() throws TorqueException 2304 { 2305 if (collPrintSubscriptions == null) 2306 { 2307 collPrintSubscriptions = getPrintSubscriptions(new Criteria(10)); 2308 } 2309 return collPrintSubscriptions; 2310 } 2311 2312 2323 public List getPrintSubscriptions(Criteria criteria) throws TorqueException 2324 { 2325 if (collPrintSubscriptions == null) 2326 { 2327 if (isNew()) 2328 { 2329 collPrintSubscriptions = new ArrayList (); 2330 } 2331 else 2332 { 2333 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId() ); 2334 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria); 2335 } 2336 } 2337 else 2338 { 2339 if (!isNew()) 2341 { 2342 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2346 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2347 { 2348 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria); 2349 } 2350 } 2351 } 2352 lastPrintSubscriptionsCriteria = criteria; 2353 2354 return collPrintSubscriptions; 2355 } 2356 2357 2365 public List getPrintSubscriptions(Connection con) throws TorqueException 2366 { 2367 if (collPrintSubscriptions == null) 2368 { 2369 collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con); 2370 } 2371 return collPrintSubscriptions; 2372 } 2373 2374 2386 public List getPrintSubscriptions(Criteria criteria, Connection con) 2387 throws TorqueException 2388 { 2389 if (collPrintSubscriptions == null) 2390 { 2391 if (isNew()) 2392 { 2393 collPrintSubscriptions = new ArrayList (); 2394 } 2395 else 2396 { 2397 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2398 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con); 2399 } 2400 } 2401 else 2402 { 2403 if (!isNew()) 2405 { 2406 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2410 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2411 { 2412 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con); 2413 } 2414 } 2415 } 2416 lastPrintSubscriptionsCriteria = criteria; 2417 2418 return collPrintSubscriptions; 2419 } 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2442 protected List getPrintSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria) 2443 throws TorqueException 2444 { 2445 if (collPrintSubscriptions == null) 2446 { 2447 if (isNew()) 2448 { 2449 collPrintSubscriptions = new ArrayList (); 2450 } 2451 else 2452 { 2453 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2454 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2455 } 2456 } 2457 else 2458 { 2459 2463 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2464 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2465 { 2466 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2467 } 2468 } 2469 lastPrintSubscriptionsCriteria = criteria; 2470 2471 return collPrintSubscriptions; 2472 } 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2493 protected List getPrintSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria) 2494 throws TorqueException 2495 { 2496 if (collPrintSubscriptions == null) 2497 { 2498 if (isNew()) 2499 { 2500 collPrintSubscriptions = new ArrayList (); 2501 } 2502 else 2503 { 2504 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2505 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2506 } 2507 } 2508 else 2509 { 2510 2514 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2515 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2516 { 2517 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2518 } 2519 } 2520 lastPrintSubscriptionsCriteria = criteria; 2521 2522 return collPrintSubscriptions; 2523 } 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2544 protected List getPrintSubscriptionsJoinCarrier(Criteria criteria) 2545 throws TorqueException 2546 { 2547 if (collPrintSubscriptions == null) 2548 { 2549 if (isNew()) 2550 { 2551 collPrintSubscriptions = new ArrayList (); 2552 } 2553 else 2554 { 2555 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2556 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria); 2557 } 2558 } 2559 else 2560 { 2561 2565 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2566 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2567 { 2568 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria); 2569 } 2570 } 2571 lastPrintSubscriptionsCriteria = criteria; 2572 2573 return collPrintSubscriptions; 2574 } 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2595 protected List getPrintSubscriptionsJoinProject(Criteria criteria) 2596 throws TorqueException 2597 { 2598 if (collPrintSubscriptions == null) 2599 { 2600 if (isNew()) 2601 { 2602 collPrintSubscriptions = new ArrayList (); 2603 } 2604 else 2605 { 2606 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2607 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria); 2608 } 2609 } 2610 else 2611 { 2612 2616 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2617 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2618 { 2619 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria); 2620 } 2621 } 2622 lastPrintSubscriptionsCriteria = criteria; 2623 2624 return collPrintSubscriptions; 2625 } 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2646 protected List getPrintSubscriptionsJoinProduct(Criteria criteria) 2647 throws TorqueException 2648 { 2649 if (collPrintSubscriptions == null) 2650 { 2651 if (isNew()) 2652 { 2653 collPrintSubscriptions = new ArrayList (); 2654 } 2655 else 2656 { 2657 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2658 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria); 2659 } 2660 } 2661 else 2662 { 2663 2667 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2668 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2669 { 2670 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria); 2671 } 2672 } 2673 lastPrintSubscriptionsCriteria = criteria; 2674 2675 return collPrintSubscriptions; 2676 } 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2697 protected List getPrintSubscriptionsJoinSorder(Criteria criteria) 2698 throws TorqueException 2699 { 2700 if (collPrintSubscriptions == null) 2701 { 2702 if (isNew()) 2703 { 2704 collPrintSubscriptions = new ArrayList (); 2705 } 2706 else 2707 { 2708 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2709 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria); 2710 } 2711 } 2712 else 2713 { 2714 2718 criteria.add(PrintSubscriptionPeer.SORDER_ID, getSorderId()); 2719 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 2720 { 2721 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria); 2722 } 2723 } 2724 lastPrintSubscriptionsCriteria = criteria; 2725 2726 return collPrintSubscriptions; 2727 } 2728 2729 2730 2731 2732 2733 2736 protected List collOnlineSubscriptions; 2737 2738 2743 protected void initOnlineSubscriptions() 2744 { 2745 if (collOnlineSubscriptions == null) 2746 { 2747 collOnlineSubscriptions = new ArrayList (); 2748 } 2749 } 2750 2751 2758 public void addOnlineSubscription(OnlineSubscription l) throws TorqueException 2759 { 2760 getOnlineSubscriptions().add(l); 2761 l.setSorder((Sorder) this); 2762 } 2763 2764 2767 private Criteria lastOnlineSubscriptionsCriteria = null; 2768 2769 2776 public List getOnlineSubscriptions() throws TorqueException 2777 { 2778 if (collOnlineSubscriptions == null) 2779 { 2780 collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10)); 2781 } 2782 return collOnlineSubscriptions; 2783 } 2784 2785 2796 public List getOnlineSubscriptions(Criteria criteria) throws TorqueException 2797 { 2798 if (collOnlineSubscriptions == null) 2799 { 2800 if (isNew()) 2801 { 2802 collOnlineSubscriptions = new ArrayList (); 2803 } 2804 else 2805 { 2806 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId() ); 2807 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria); 2808 } 2809 } 2810 else 2811 { 2812 if (!isNew()) 2814 { 2815 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2819 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2820 { 2821 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria); 2822 } 2823 } 2824 } 2825 lastOnlineSubscriptionsCriteria = criteria; 2826 2827 return collOnlineSubscriptions; 2828 } 2829 2830 2838 public List getOnlineSubscriptions(Connection con) throws TorqueException 2839 { 2840 if (collOnlineSubscriptions == null) 2841 { 2842 collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10), con); 2843 } 2844 return collOnlineSubscriptions; 2845 } 2846 2847 2859 public List getOnlineSubscriptions(Criteria criteria, Connection con) 2860 throws TorqueException 2861 { 2862 if (collOnlineSubscriptions == null) 2863 { 2864 if (isNew()) 2865 { 2866 collOnlineSubscriptions = new ArrayList (); 2867 } 2868 else 2869 { 2870 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2871 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con); 2872 } 2873 } 2874 else 2875 { 2876 if (!isNew()) 2878 { 2879 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2883 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2884 { 2885 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con); 2886 } 2887 } 2888 } 2889 lastOnlineSubscriptionsCriteria = criteria; 2890 2891 return collOnlineSubscriptions; 2892 } 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2915 protected List getOnlineSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria) 2916 throws TorqueException 2917 { 2918 if (collOnlineSubscriptions == null) 2919 { 2920 if (isNew()) 2921 { 2922 collOnlineSubscriptions = new ArrayList (); 2923 } 2924 else 2925 { 2926 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2927 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2928 } 2929 } 2930 else 2931 { 2932 2936 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2937 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2938 { 2939 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 2940 } 2941 } 2942 lastOnlineSubscriptionsCriteria = criteria; 2943 2944 return collOnlineSubscriptions; 2945 } 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2966 protected List getOnlineSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria) 2967 throws TorqueException 2968 { 2969 if (collOnlineSubscriptions == null) 2970 { 2971 if (isNew()) 2972 { 2973 collOnlineSubscriptions = new ArrayList (); 2974 } 2975 else 2976 { 2977 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2978 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2979 } 2980 } 2981 else 2982 { 2983 2987 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 2988 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2989 { 2990 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 2991 } 2992 } 2993 lastOnlineSubscriptionsCriteria = criteria; 2994 2995 return collOnlineSubscriptions; 2996 } 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3017 protected List getOnlineSubscriptionsJoinProject(Criteria criteria) 3018 throws TorqueException 3019 { 3020 if (collOnlineSubscriptions == null) 3021 { 3022 if (isNew()) 3023 { 3024 collOnlineSubscriptions = new ArrayList (); 3025 } 3026 else 3027 { 3028 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3029 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria); 3030 } 3031 } 3032 else 3033 { 3034 3038 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3039 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 3040 { 3041 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria); 3042 } 3043 } 3044 lastOnlineSubscriptionsCriteria = criteria; 3045 3046 return collOnlineSubscriptions; 3047 } 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3068 protected List getOnlineSubscriptionsJoinProduct(Criteria criteria) 3069 throws TorqueException 3070 { 3071 if (collOnlineSubscriptions == null) 3072 { 3073 if (isNew()) 3074 { 3075 collOnlineSubscriptions = new ArrayList (); 3076 } 3077 else 3078 { 3079 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3080 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria); 3081 } 3082 } 3083 else 3084 { 3085 3089 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3090 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 3091 { 3092 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria); 3093 } 3094 } 3095 lastOnlineSubscriptionsCriteria = criteria; 3096 3097 return collOnlineSubscriptions; 3098 } 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3119 protected List getOnlineSubscriptionsJoinSorder(Criteria criteria) 3120 throws TorqueException 3121 { 3122 if (collOnlineSubscriptions == null) 3123 { 3124 if (isNew()) 3125 { 3126 collOnlineSubscriptions = new ArrayList (); 3127 } 3128 else 3129 { 3130 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3131 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria); 3132 } 3133 } 3134 else 3135 { 3136 3140 criteria.add(OnlineSubscriptionPeer.SORDER_ID, getSorderId()); 3141 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 3142 { 3143 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria); 3144 } 3145 } 3146 lastOnlineSubscriptionsCriteria = criteria; 3147 3148 return collOnlineSubscriptions; 3149 } 3150 3151 3152 3153 3154 3155 3158 protected List collSorderItems; 3159 3160 3165 protected void initSorderItems() 3166 { 3167 if (collSorderItems == null) 3168 { 3169 collSorderItems = new ArrayList (); 3170 } 3171 } 3172 3173 3180 public void addSorderItem(SorderItem l) throws TorqueException 3181 { 3182 getSorderItems().add(l); 3183 l.setSorder((Sorder) this); 3184 } 3185 3186 3189 private Criteria lastSorderItemsCriteria = null; 3190 3191 3198 public List getSorderItems() throws TorqueException 3199 { 3200 if (collSorderItems == null) 3201 { 3202 collSorderItems = getSorderItems(new Criteria(10)); 3203 } 3204 return collSorderItems; 3205 } 3206 3207 3218 public List getSorderItems(Criteria criteria) throws TorqueException 3219 { 3220 if (collSorderItems == null) 3221 { 3222 if (isNew()) 3223 { 3224 collSorderItems = new ArrayList (); 3225 } 3226 else 3227 { 3228 criteria.add(SorderItemPeer.SORDER_ID, getSorderId() ); 3229 collSorderItems = SorderItemPeer.doSelect(criteria); 3230 } 3231 } 3232 else 3233 { 3234 if (!isNew()) 3236 { 3237 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3241 if (!lastSorderItemsCriteria.equals(criteria)) 3242 { 3243 collSorderItems = SorderItemPeer.doSelect(criteria); 3244 } 3245 } 3246 } 3247 lastSorderItemsCriteria = criteria; 3248 3249 return collSorderItems; 3250 } 3251 3252 3260 public List getSorderItems(Connection con) throws TorqueException 3261 { 3262 if (collSorderItems == null) 3263 { 3264 collSorderItems = getSorderItems(new Criteria(10), con); 3265 } 3266 return collSorderItems; 3267 } 3268 3269 3281 public List getSorderItems(Criteria criteria, Connection con) 3282 throws TorqueException 3283 { 3284 if (collSorderItems == null) 3285 { 3286 if (isNew()) 3287 { 3288 collSorderItems = new ArrayList (); 3289 } 3290 else 3291 { 3292 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3293 collSorderItems = SorderItemPeer.doSelect(criteria, con); 3294 } 3295 } 3296 else 3297 { 3298 if (!isNew()) 3300 { 3301 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3305 if (!lastSorderItemsCriteria.equals(criteria)) 3306 { 3307 collSorderItems = SorderItemPeer.doSelect(criteria, con); 3308 } 3309 } 3310 } 3311 lastSorderItemsCriteria = criteria; 3312 3313 return collSorderItems; 3314 } 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3337 protected List getSorderItemsJoinSorder(Criteria criteria) 3338 throws TorqueException 3339 { 3340 if (collSorderItems == null) 3341 { 3342 if (isNew()) 3343 { 3344 collSorderItems = new ArrayList (); 3345 } 3346 else 3347 { 3348 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3349 collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria); 3350 } 3351 } 3352 else 3353 { 3354 3358 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3359 if (!lastSorderItemsCriteria.equals(criteria)) 3360 { 3361 collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria); 3362 } 3363 } 3364 lastSorderItemsCriteria = criteria; 3365 3366 return collSorderItems; 3367 } 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3388 protected List getSorderItemsJoinProduct(Criteria criteria) 3389 throws TorqueException 3390 { 3391 if (collSorderItems == null) 3392 { 3393 if (isNew()) 3394 { 3395 collSorderItems = new ArrayList (); 3396 } 3397 else 3398 { 3399 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3400 collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria); 3401 } 3402 } 3403 else 3404 { 3405 3409 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3410 if (!lastSorderItemsCriteria.equals(criteria)) 3411 { 3412 collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria); 3413 } 3414 } 3415 lastSorderItemsCriteria = criteria; 3416 3417 return collSorderItems; 3418 } 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3439 protected List getSorderItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 3440 throws TorqueException 3441 { 3442 if (collSorderItems == null) 3443 { 3444 if (isNew()) 3445 { 3446 collSorderItems = new ArrayList (); 3447 } 3448 else 3449 { 3450 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3451 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 3452 } 3453 } 3454 else 3455 { 3456 3460 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3461 if (!lastSorderItemsCriteria.equals(criteria)) 3462 { 3463 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 3464 } 3465 } 3466 lastSorderItemsCriteria = criteria; 3467 3468 return collSorderItems; 3469 } 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3490 protected List getSorderItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 3491 throws TorqueException 3492 { 3493 if (collSorderItems == null) 3494 { 3495 if (isNew()) 3496 { 3497 collSorderItems = new ArrayList (); 3498 } 3499 else 3500 { 3501 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3502 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 3503 } 3504 } 3505 else 3506 { 3507 3511 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3512 if (!lastSorderItemsCriteria.equals(criteria)) 3513 { 3514 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 3515 } 3516 } 3517 lastSorderItemsCriteria = criteria; 3518 3519 return collSorderItems; 3520 } 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3541 protected List getSorderItemsJoinProject(Criteria criteria) 3542 throws TorqueException 3543 { 3544 if (collSorderItems == null) 3545 { 3546 if (isNew()) 3547 { 3548 collSorderItems = new ArrayList (); 3549 } 3550 else 3551 { 3552 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3553 collSorderItems = SorderItemPeer.doSelectJoinProject(criteria); 3554 } 3555 } 3556 else 3557 { 3558 3562 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3563 if (!lastSorderItemsCriteria.equals(criteria)) 3564 { 3565 collSorderItems = SorderItemPeer.doSelectJoinProject(criteria); 3566 } 3567 } 3568 lastSorderItemsCriteria = criteria; 3569 3570 return collSorderItems; 3571 } 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3592 protected List getSorderItemsJoinCurrency(Criteria criteria) 3593 throws TorqueException 3594 { 3595 if (collSorderItems == null) 3596 { 3597 if (isNew()) 3598 { 3599 collSorderItems = new ArrayList (); 3600 } 3601 else 3602 { 3603 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3604 collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria); 3605 } 3606 } 3607 else 3608 { 3609 3613 criteria.add(SorderItemPeer.SORDER_ID, getSorderId()); 3614 if (!lastSorderItemsCriteria.equals(criteria)) 3615 { 3616 collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria); 3617 } 3618 } 3619 lastSorderItemsCriteria = criteria; 3620 3621 return collSorderItems; 3622 } 3623 3624 3625 3626 3627 3628 3631 protected List collPaymentItems; 3632 3633 3638 protected void initPaymentItems() 3639 { 3640 if (collPaymentItems == null) 3641 { 3642 collPaymentItems = new ArrayList (); 3643 } 3644 } 3645 3646 3653 public void addPaymentItem(PaymentItem l) throws TorqueException 3654 { 3655 getPaymentItems().add(l); 3656 l.setSorder((Sorder) this); 3657 } 3658 3659 3662 private Criteria lastPaymentItemsCriteria = null; 3663 3664 3671 public List getPaymentItems() throws TorqueException 3672 { 3673 if (collPaymentItems == null) 3674 { 3675 collPaymentItems = getPaymentItems(new Criteria(10)); 3676 } 3677 return collPaymentItems; 3678 } 3679 3680 3691 public List getPaymentItems(Criteria criteria) throws TorqueException 3692 { 3693 if (collPaymentItems == null) 3694 { 3695 if (isNew()) 3696 { 3697 collPaymentItems = new ArrayList (); 3698 } 3699 else 3700 { 3701 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId() ); 3702 collPaymentItems = PaymentItemPeer.doSelect(criteria); 3703 } 3704 } 3705 else 3706 { 3707 if (!isNew()) 3709 { 3710 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3714 if (!lastPaymentItemsCriteria.equals(criteria)) 3715 { 3716 collPaymentItems = PaymentItemPeer.doSelect(criteria); 3717 } 3718 } 3719 } 3720 lastPaymentItemsCriteria = criteria; 3721 3722 return collPaymentItems; 3723 } 3724 3725 3733 public List getPaymentItems(Connection con) throws TorqueException 3734 { 3735 if (collPaymentItems == null) 3736 { 3737 collPaymentItems = getPaymentItems(new Criteria(10), con); 3738 } 3739 return collPaymentItems; 3740 } 3741 3742 3754 public List getPaymentItems(Criteria criteria, Connection con) 3755 throws TorqueException 3756 { 3757 if (collPaymentItems == null) 3758 { 3759 if (isNew()) 3760 { 3761 collPaymentItems = new ArrayList (); 3762 } 3763 else 3764 { 3765 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3766 collPaymentItems = PaymentItemPeer.doSelect(criteria, con); 3767 } 3768 } 3769 else 3770 { 3771 if (!isNew()) 3773 { 3774 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3778 if (!lastPaymentItemsCriteria.equals(criteria)) 3779 { 3780 collPaymentItems = PaymentItemPeer.doSelect(criteria, con); 3781 } 3782 } 3783 } 3784 lastPaymentItemsCriteria = criteria; 3785 3786 return collPaymentItems; 3787 } 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3810 protected List getPaymentItemsJoinPayment(Criteria criteria) 3811 throws TorqueException 3812 { 3813 if (collPaymentItems == null) 3814 { 3815 if (isNew()) 3816 { 3817 collPaymentItems = new ArrayList (); 3818 } 3819 else 3820 { 3821 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3822 collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria); 3823 } 3824 } 3825 else 3826 { 3827 3831 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3832 if (!lastPaymentItemsCriteria.equals(criteria)) 3833 { 3834 collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria); 3835 } 3836 } 3837 lastPaymentItemsCriteria = criteria; 3838 3839 return collPaymentItems; 3840 } 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3861 protected List getPaymentItemsJoinSorder(Criteria criteria) 3862 throws TorqueException 3863 { 3864 if (collPaymentItems == null) 3865 { 3866 if (isNew()) 3867 { 3868 collPaymentItems = new ArrayList (); 3869 } 3870 else 3871 { 3872 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3873 collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria); 3874 } 3875 } 3876 else 3877 { 3878 3882 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3883 if (!lastPaymentItemsCriteria.equals(criteria)) 3884 { 3885 collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria); 3886 } 3887 } 3888 lastPaymentItemsCriteria = criteria; 3889 3890 return collPaymentItems; 3891 } 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3912 protected List getPaymentItemsJoinProduct(Criteria criteria) 3913 throws TorqueException 3914 { 3915 if (collPaymentItems == null) 3916 { 3917 if (isNew()) 3918 { 3919 collPaymentItems = new ArrayList (); 3920 } 3921 else 3922 { 3923 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3924 collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria); 3925 } 3926 } 3927 else 3928 { 3929 3933 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3934 if (!lastPaymentItemsCriteria.equals(criteria)) 3935 { 3936 collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria); 3937 } 3938 } 3939 lastPaymentItemsCriteria = criteria; 3940 3941 return collPaymentItems; 3942 } 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3963 protected List getPaymentItemsJoinCurrency(Criteria criteria) 3964 throws TorqueException 3965 { 3966 if (collPaymentItems == null) 3967 { 3968 if (isNew()) 3969 { 3970 collPaymentItems = new ArrayList (); 3971 } 3972 else 3973 { 3974 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3975 collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria); 3976 } 3977 } 3978 else 3979 { 3980 3984 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 3985 if (!lastPaymentItemsCriteria.equals(criteria)) 3986 { 3987 collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria); 3988 } 3989 } 3990 lastPaymentItemsCriteria = criteria; 3991 3992 return collPaymentItems; 3993 } 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4014 protected List getPaymentItemsJoinCustomer(Criteria criteria) 4015 throws TorqueException 4016 { 4017 if (collPaymentItems == null) 4018 { 4019 if (isNew()) 4020 { 4021 collPaymentItems = new ArrayList (); 4022 } 4023 else 4024 { 4025 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 4026 collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria); 4027 } 4028 } 4029 else 4030 { 4031 4035 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 4036 if (!lastPaymentItemsCriteria.equals(criteria)) 4037 { 4038 collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria); 4039 } 4040 } 4041 lastPaymentItemsCriteria = criteria; 4042 4043 return collPaymentItems; 4044 } 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4065 protected List getPaymentItemsJoinProject(Criteria criteria) 4066 throws TorqueException 4067 { 4068 if (collPaymentItems == null) 4069 { 4070 if (isNew()) 4071 { 4072 collPaymentItems = new ArrayList (); 4073 } 4074 else 4075 { 4076 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 4077 collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria); 4078 } 4079 } 4080 else 4081 { 4082 4086 criteria.add(PaymentItemPeer.SORDER_ID, getSorderId()); 4087 if (!lastPaymentItemsCriteria.equals(criteria)) 4088 { 4089 collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria); 4090 } 4091 } 4092 lastPaymentItemsCriteria = criteria; 4093 4094 return collPaymentItems; 4095 } 4096 4097 4098 4099 4100 4101 4104 protected List collShipmentItems; 4105 4106 4111 protected void initShipmentItems() 4112 { 4113 if (collShipmentItems == null) 4114 { 4115 collShipmentItems = new ArrayList (); 4116 } 4117 } 4118 4119 4126 public void addShipmentItem(ShipmentItem l) throws TorqueException 4127 { 4128 getShipmentItems().add(l); 4129 l.setSorder((Sorder) this); 4130 } 4131 4132 4135 private Criteria lastShipmentItemsCriteria = null; 4136 4137 4144 public List getShipmentItems() throws TorqueException 4145 { 4146 if (collShipmentItems == null) 4147 { 4148 collShipmentItems = getShipmentItems(new Criteria(10)); 4149 } 4150 return collShipmentItems; 4151 } 4152 4153 4164 public List getShipmentItems(Criteria criteria) throws TorqueException 4165 { 4166 if (collShipmentItems == null) 4167 { 4168 if (isNew()) 4169 { 4170 collShipmentItems = new ArrayList (); 4171 } 4172 else 4173 { 4174 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId() ); 4175 collShipmentItems = ShipmentItemPeer.doSelect(criteria); 4176 } 4177 } 4178 else 4179 { 4180 if (!isNew()) 4182 { 4183 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4187 if (!lastShipmentItemsCriteria.equals(criteria)) 4188 { 4189 collShipmentItems = ShipmentItemPeer.doSelect(criteria); 4190 } 4191 } 4192 } 4193 lastShipmentItemsCriteria = criteria; 4194 4195 return collShipmentItems; 4196 } 4197 4198 4206 public List getShipmentItems(Connection con) throws TorqueException 4207 { 4208 if (collShipmentItems == null) 4209 { 4210 collShipmentItems = getShipmentItems(new Criteria(10), con); 4211 } 4212 return collShipmentItems; 4213 } 4214 4215 4227 public List getShipmentItems(Criteria criteria, Connection con) 4228 throws TorqueException 4229 { 4230 if (collShipmentItems == null) 4231 { 4232 if (isNew()) 4233 { 4234 collShipmentItems = new ArrayList (); 4235 } 4236 else 4237 { 4238 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4239 collShipmentItems = ShipmentItemPeer.doSelect(criteria, con); 4240 } 4241 } 4242 else 4243 { 4244 if (!isNew()) 4246 { 4247 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4251 if (!lastShipmentItemsCriteria.equals(criteria)) 4252 { 4253 collShipmentItems = ShipmentItemPeer.doSelect(criteria, con); 4254 } 4255 } 4256 } 4257 lastShipmentItemsCriteria = criteria; 4258 4259 return collShipmentItems; 4260 } 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4283 protected List getShipmentItemsJoinShipment(Criteria criteria) 4284 throws TorqueException 4285 { 4286 if (collShipmentItems == null) 4287 { 4288 if (isNew()) 4289 { 4290 collShipmentItems = new ArrayList (); 4291 } 4292 else 4293 { 4294 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4295 collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria); 4296 } 4297 } 4298 else 4299 { 4300 4304 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4305 if (!lastShipmentItemsCriteria.equals(criteria)) 4306 { 4307 collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria); 4308 } 4309 } 4310 lastShipmentItemsCriteria = criteria; 4311 4312 return collShipmentItems; 4313 } 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4334 protected List getShipmentItemsJoinSorder(Criteria criteria) 4335 throws TorqueException 4336 { 4337 if (collShipmentItems == null) 4338 { 4339 if (isNew()) 4340 { 4341 collShipmentItems = new ArrayList (); 4342 } 4343 else 4344 { 4345 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4346 collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria); 4347 } 4348 } 4349 else 4350 { 4351 4355 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4356 if (!lastShipmentItemsCriteria.equals(criteria)) 4357 { 4358 collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria); 4359 } 4360 } 4361 lastShipmentItemsCriteria = criteria; 4362 4363 return collShipmentItems; 4364 } 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4385 protected List getShipmentItemsJoinProduct(Criteria criteria) 4386 throws TorqueException 4387 { 4388 if (collShipmentItems == null) 4389 { 4390 if (isNew()) 4391 { 4392 collShipmentItems = new ArrayList (); 4393 } 4394 else 4395 { 4396 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4397 collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria); 4398 } 4399 } 4400 else 4401 { 4402 4406 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4407 if (!lastShipmentItemsCriteria.equals(criteria)) 4408 { 4409 collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria); 4410 } 4411 } 4412 lastShipmentItemsCriteria = criteria; 4413 4414 return collShipmentItems; 4415 } 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4436 protected List getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 4437 throws TorqueException 4438 { 4439 if (collShipmentItems == null) 4440 { 4441 if (isNew()) 4442 { 4443 collShipmentItems = new ArrayList (); 4444 } 4445 else 4446 { 4447 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4448 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4449 } 4450 } 4451 else 4452 { 4453 4457 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4458 if (!lastShipmentItemsCriteria.equals(criteria)) 4459 { 4460 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4461 } 4462 } 4463 lastShipmentItemsCriteria = criteria; 4464 4465 return collShipmentItems; 4466 } 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4487 protected List getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 4488 throws TorqueException 4489 { 4490 if (collShipmentItems == null) 4491 { 4492 if (isNew()) 4493 { 4494 collShipmentItems = new ArrayList (); 4495 } 4496 else 4497 { 4498 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4499 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4500 } 4501 } 4502 else 4503 { 4504 4508 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4509 if (!lastShipmentItemsCriteria.equals(criteria)) 4510 { 4511 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4512 } 4513 } 4514 lastShipmentItemsCriteria = criteria; 4515 4516 return collShipmentItems; 4517 } 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4538 protected List getShipmentItemsJoinProject(Criteria criteria) 4539 throws TorqueException 4540 { 4541 if (collShipmentItems == null) 4542 { 4543 if (isNew()) 4544 { 4545 collShipmentItems = new ArrayList (); 4546 } 4547 else 4548 { 4549 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4550 collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria); 4551 } 4552 } 4553 else 4554 { 4555 4559 criteria.add(ShipmentItemPeer.SORDER_ID, getSorderId()); 4560 if (!lastShipmentItemsCriteria.equals(criteria)) 4561 { 4562 collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria); 4563 } 4564 } 4565 lastShipmentItemsCriteria = criteria; 4566 4567 return collShipmentItems; 4568 } 4569 4570 4571 4572 4573 4574 4577 protected List collServiceItems; 4578 4579 4584 protected void initServiceItems() 4585 { 4586 if (collServiceItems == null) 4587 { 4588 collServiceItems = new ArrayList (); 4589 } 4590 } 4591 4592 4599 public void addServiceItem(ServiceItem l) throws TorqueException 4600 { 4601 getServiceItems().add(l); 4602 l.setSorder((Sorder) this); 4603 } 4604 4605 4608 private Criteria lastServiceItemsCriteria = null; 4609 4610 4617 public List getServiceItems() throws TorqueException 4618 { 4619 if (collServiceItems == null) 4620 { 4621 collServiceItems = getServiceItems(new Criteria(10)); 4622 } 4623 return collServiceItems; 4624 } 4625 4626 4637 public List getServiceItems(Criteria criteria) throws TorqueException 4638 { 4639 if (collServiceItems == null) 4640 { 4641 if (isNew()) 4642 { 4643 collServiceItems = new ArrayList (); 4644 } 4645 else 4646 { 4647 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId() ); 4648 collServiceItems = ServiceItemPeer.doSelect(criteria); 4649 } 4650 } 4651 else 4652 { 4653 if (!isNew()) 4655 { 4656 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4660 if (!lastServiceItemsCriteria.equals(criteria)) 4661 { 4662 collServiceItems = ServiceItemPeer.doSelect(criteria); 4663 } 4664 } 4665 } 4666 lastServiceItemsCriteria = criteria; 4667 4668 return collServiceItems; 4669 } 4670 4671 4679 public List getServiceItems(Connection con) throws TorqueException 4680 { 4681 if (collServiceItems == null) 4682 { 4683 collServiceItems = getServiceItems(new Criteria(10), con); 4684 } 4685 return collServiceItems; 4686 } 4687 4688 4700 public List getServiceItems(Criteria criteria, Connection con) 4701 throws TorqueException 4702 { 4703 if (collServiceItems == null) 4704 { 4705 if (isNew()) 4706 { 4707 collServiceItems = new ArrayList (); 4708 } 4709 else 4710 { 4711 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4712 collServiceItems = ServiceItemPeer.doSelect(criteria, con); 4713 } 4714 } 4715 else 4716 { 4717 if (!isNew()) 4719 { 4720 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4724 if (!lastServiceItemsCriteria.equals(criteria)) 4725 { 4726 collServiceItems = ServiceItemPeer.doSelect(criteria, con); 4727 } 4728 } 4729 } 4730 lastServiceItemsCriteria = criteria; 4731 4732 return collServiceItems; 4733 } 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4756 protected List getServiceItemsJoinService(Criteria criteria) 4757 throws TorqueException 4758 { 4759 if (collServiceItems == null) 4760 { 4761 if (isNew()) 4762 { 4763 collServiceItems = new ArrayList (); 4764 } 4765 else 4766 { 4767 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4768 collServiceItems = ServiceItemPeer.doSelectJoinService(criteria); 4769 } 4770 } 4771 else 4772 { 4773 4777 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4778 if (!lastServiceItemsCriteria.equals(criteria)) 4779 { 4780 collServiceItems = ServiceItemPeer.doSelectJoinService(criteria); 4781 } 4782 } 4783 lastServiceItemsCriteria = criteria; 4784 4785 return collServiceItems; 4786 } 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4807 protected List getServiceItemsJoinSorder(Criteria criteria) 4808 throws TorqueException 4809 { 4810 if (collServiceItems == null) 4811 { 4812 if (isNew()) 4813 { 4814 collServiceItems = new ArrayList (); 4815 } 4816 else 4817 { 4818 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4819 collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria); 4820 } 4821 } 4822 else 4823 { 4824 4828 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4829 if (!lastServiceItemsCriteria.equals(criteria)) 4830 { 4831 collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria); 4832 } 4833 } 4834 lastServiceItemsCriteria = criteria; 4835 4836 return collServiceItems; 4837 } 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4858 protected List getServiceItemsJoinProduct(Criteria criteria) 4859 throws TorqueException 4860 { 4861 if (collServiceItems == null) 4862 { 4863 if (isNew()) 4864 { 4865 collServiceItems = new ArrayList (); 4866 } 4867 else 4868 { 4869 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4870 collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria); 4871 } 4872 } 4873 else 4874 { 4875 4879 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4880 if (!lastServiceItemsCriteria.equals(criteria)) 4881 { 4882 collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria); 4883 } 4884 } 4885 lastServiceItemsCriteria = criteria; 4886 4887 return collServiceItems; 4888 } 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4909 protected List getServiceItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 4910 throws TorqueException 4911 { 4912 if (collServiceItems == null) 4913 { 4914 if (isNew()) 4915 { 4916 collServiceItems = new ArrayList (); 4917 } 4918 else 4919 { 4920 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4921 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4922 } 4923 } 4924 else 4925 { 4926 4930 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4931 if (!lastServiceItemsCriteria.equals(criteria)) 4932 { 4933 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4934 } 4935 } 4936 lastServiceItemsCriteria = criteria; 4937 4938 return collServiceItems; 4939 } 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4960 protected List getServiceItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 4961 throws TorqueException 4962 { 4963 if (collServiceItems == null) 4964 { 4965 if (isNew()) 4966 { 4967 collServiceItems = new ArrayList (); 4968 } 4969 else 4970 { 4971 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4972 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4973 } 4974 } 4975 else 4976 { 4977 4981 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 4982 if (!lastServiceItemsCriteria.equals(criteria)) 4983 { 4984 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4985 } 4986 } 4987 lastServiceItemsCriteria = criteria; 4988 4989 return collServiceItems; 4990 } 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5011 protected List getServiceItemsJoinProject(Criteria criteria) 5012 throws TorqueException 5013 { 5014 if (collServiceItems == null) 5015 { 5016 if (isNew()) 5017 { 5018 collServiceItems = new ArrayList (); 5019 } 5020 else 5021 { 5022 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 5023 collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria); 5024 } 5025 } 5026 else 5027 { 5028 5032 criteria.add(ServiceItemPeer.SORDER_ID, getSorderId()); 5033 if (!lastServiceItemsCriteria.equals(criteria)) 5034 { 5035 collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria); 5036 } 5037 } 5038 lastServiceItemsCriteria = criteria; 5039 5040 return collServiceItems; 5041 } 5042 5043 5044 5045 5046 private static List fieldNames = null; 5047 5048 5053 public static synchronized List getFieldNames() 5054 { 5055 if (fieldNames == null) 5056 { 5057 fieldNames = new ArrayList (); 5058 fieldNames.add("SorderId"); 5059 fieldNames.add("SorderCode"); 5060 fieldNames.add("Status"); 5061 fieldNames.add("Priority"); 5062 fieldNames.add("IssuedDate"); 5063 fieldNames.add("ClosedDate"); 5064 fieldNames.add("CustomerId"); 5065 fieldNames.add("RecipientId"); 5066 fieldNames.add("ProjectId"); 5067 fieldNames.add("CarrierId"); 5068 fieldNames.add("PayTerm"); 5069 fieldNames.add("PayMethod"); 5070 fieldNames.add("CurrencyId"); 5071 fieldNames.add("CurrencyAmount"); 5072 fieldNames.add("Subject"); 5073 fieldNames.add("Notes"); 5074 fieldNames.add("Created"); 5075 fieldNames.add("Modified"); 5076 fieldNames.add("CreatedBy"); 5077 fieldNames.add("ModifiedBy"); 5078 fieldNames = Collections.unmodifiableList(fieldNames); 5079 } 5080 return fieldNames; 5081 } 5082 5083 5089 public Object getByName(String name) 5090 { 5091 if (name.equals("SorderId")) 5092 { 5093 return new Integer (getSorderId()); 5094 } 5095 if (name.equals("SorderCode")) 5096 { 5097 return getSorderCode(); 5098 } 5099 if (name.equals("Status")) 5100 { 5101 return new Integer (getStatus()); 5102 } 5103 if (name.equals("Priority")) 5104 { 5105 return new Integer (getPriority()); 5106 } 5107 if (name.equals("IssuedDate")) 5108 { 5109 return getIssuedDate(); 5110 } 5111 if (name.equals("ClosedDate")) 5112 { 5113 return getClosedDate(); 5114 } 5115 if (name.equals("CustomerId")) 5116 { 5117 return new Integer (getCustomerId()); 5118 } 5119 if (name.equals("RecipientId")) 5120 { 5121 return new Integer (getRecipientId()); 5122 } 5123 if (name.equals("ProjectId")) 5124 { 5125 return new Integer (getProjectId()); 5126 } 5127 if (name.equals("CarrierId")) 5128 { 5129 return new Integer (getCarrierId()); 5130 } 5131 if (name.equals("PayTerm")) 5132 { 5133 return new Integer (getPayTerm()); 5134 } 5135 if (name.equals("PayMethod")) 5136 { 5137 return new Integer (getPayMethod()); 5138 } 5139 if (name.equals("CurrencyId")) 5140 { 5141 return new Integer (getCurrencyId()); 5142 } 5143 if (name.equals("CurrencyAmount")) 5144 { 5145 return getCurrencyAmount(); 5146 } 5147 if (name.equals("Subject")) 5148 { 5149 return getSubject(); 5150 } 5151 if (name.equals("Notes")) 5152 { 5153 return getNotes(); 5154 } 5155 if (name.equals("Created")) 5156 { 5157 return getCreated(); 5158 } 5159 if (name.equals("Modified")) 5160 { 5161 return getModified(); 5162 } 5163 if (name.equals("CreatedBy")) 5164 { 5165 return getCreatedBy(); 5166 } 5167 if (name.equals("ModifiedBy")) 5168 { 5169 return getModifiedBy(); 5170 } 5171 return null; 5172 } 5173 5174 5182 public Object getByPeerName(String name) 5183 { 5184 if (name.equals(SorderPeer.SORDER_ID)) 5185 { 5186 return new Integer (getSorderId()); 5187 } 5188 if (name.equals(SorderPeer.SORDER_CODE)) 5189 { 5190 return getSorderCode(); 5191 } 5192 if (name.equals(SorderPeer.STATUS)) 5193 { 5194 return new Integer (getStatus()); 5195 } 5196 if (name.equals(SorderPeer.PRIORITY)) 5197 { 5198 return new Integer (getPriority()); 5199 } 5200 if (name.equals(SorderPeer.ISSUED_DATE)) 5201 { 5202 return getIssuedDate(); 5203 } 5204 if (name.equals(SorderPeer.CLOSED_DATE)) 5205 { 5206 return getClosedDate(); 5207 } 5208 if (name.equals(SorderPeer.CUSTOMER_ID)) 5209 { 5210 return new Integer (getCustomerId()); 5211 } 5212 if (name.equals(SorderPeer.RECIPIENT_ID)) 5213 { 5214 return new Integer (getRecipientId()); 5215 } 5216 if (name.equals(SorderPeer.PROJECT_ID)) 5217 { 5218 return new Integer (getProjectId()); 5219 } 5220 if (name.equals(SorderPeer.CARRIER_ID)) 5221 { 5222 return new Integer (getCarrierId()); 5223 } 5224 if (name.equals(SorderPeer.PAY_TERM)) 5225 { 5226 return new Integer (getPayTerm()); 5227 } 5228 if (name.equals(SorderPeer.PAY_METHOD)) 5229 { 5230 return new Integer (getPayMethod()); 5231 } 5232 if (name.equals(SorderPeer.CURRENCY_ID)) 5233 { 5234 return new Integer (getCurrencyId()); 5235 } 5236 if (name.equals(SorderPeer.CURRENCY_AMOUNT)) 5237 { 5238 return getCurrencyAmount(); 5239 } 5240 if (name.equals(SorderPeer.SUBJECT)) 5241 { 5242 return getSubject(); 5243 } 5244 if (name.equals(SorderPeer.NOTES)) 5245 { 5246 return getNotes(); 5247 } 5248 if (name.equals(SorderPeer.CREATED)) 5249 { 5250 return getCreated(); 5251 } 5252 if (name.equals(SorderPeer.MODIFIED)) 5253 { 5254 return getModified(); 5255 } 5256 if (name.equals(SorderPeer.CREATED_BY)) 5257 { 5258 return getCreatedBy(); 5259 } 5260 if (name.equals(SorderPeer.MODIFIED_BY)) 5261 { 5262 return getModifiedBy(); 5263 } 5264 return null; 5265 } 5266 5267 5274 public Object getByPosition(int pos) 5275 { 5276 if (pos == 0) 5277 { 5278 return new Integer (getSorderId()); 5279 } 5280 if (pos == 1) 5281 { 5282 return getSorderCode(); 5283 } 5284 if (pos == 2) 5285 { 5286 return new Integer (getStatus()); 5287 } 5288 if (pos == 3) 5289 { 5290 return new Integer (getPriority()); 5291 } 5292 if (pos == 4) 5293 { 5294 return getIssuedDate(); 5295 } 5296 if (pos == 5) 5297 { 5298 return getClosedDate(); 5299 } 5300 if (pos == 6) 5301 { 5302 return new Integer (getCustomerId()); 5303 } 5304 if (pos == 7) 5305 { 5306 return new Integer (getRecipientId()); 5307 } 5308 if (pos == 8) 5309 { 5310 return new Integer (getProjectId()); 5311 } 5312 if (pos == 9) 5313 { 5314 return new Integer (getCarrierId()); 5315 } 5316 if (pos == 10) 5317 { 5318 return new Integer (getPayTerm()); 5319 } 5320 if (pos == 11) 5321 { 5322 return new Integer (getPayMethod()); 5323 } 5324 if (pos == 12) 5325 { 5326 return new Integer (getCurrencyId()); 5327 } 5328 if (pos == 13) 5329 { 5330 return getCurrencyAmount(); 5331 } 5332 if (pos == 14) 5333 { 5334 return getSubject(); 5335 } 5336 if (pos == 15) 5337 { 5338 return getNotes(); 5339 } 5340 if (pos == 16) 5341 { 5342 return getCreated(); 5343 } 5344 if (pos == 17) 5345 { 5346 return getModified(); 5347 } 5348 if (pos == 18) 5349 { 5350 return getCreatedBy(); 5351 } 5352 if (pos == 19) 5353 { 5354 return getModifiedBy(); 5355 } 5356 return null; 5357 } 5358 5359 5365 public void save() throws Exception  5366 { 5367 save(SorderPeer.getMapBuilder() 5368 .getDatabaseMap().getName()); 5369 } 5370 5371 5381 public void save(String dbName) throws TorqueException 5382 { 5383 Connection con = null; 5384 try 5385 { 5386 con = Transaction.begin(dbName); 5387 save(con); 5388 Transaction.commit(con); 5389 } 5390 catch(TorqueException e) 5391 { 5392 Transaction.safeRollback(con); 5393 throw e; 5394 } 5395 } 5396 5397 5399 private boolean alreadyInSave = false; 5400 5410 public void save(Connection con) throws TorqueException 5411 { 5412 if (!alreadyInSave) 5413 { 5414 alreadyInSave = true; 5415 5416 5417 5418 if (isModified()) 5420 { 5421 if (isNew()) 5422 { 5423 SorderPeer.doInsert((Sorder) this, con); 5424 setNew(false); 5425 } 5426 else 5427 { 5428 SorderPeer.doUpdate((Sorder) this, con); 5429 } 5430 } 5431 5432 5433 5434 if (collPayments != null) 5435 { 5436 for (int i = 0; i < collPayments.size(); i++) 5437 { 5438 ((Payment) collPayments.get(i)).save(con); 5439 } 5440 } 5441 5442 5443 if (collServices != null) 5444 { 5445 for (int i = 0; i < collServices.size(); i++) 5446 { 5447 ((Service) collServices.get(i)).save(con); 5448 } 5449 } 5450 5451 5452 if (collShipments != null) 5453 { 5454 for (int i = 0; i < collShipments.size(); i++) 5455 { 5456 ((Shipment) collShipments.get(i)).save(con); 5457 } 5458 } 5459 5460 5461 if (collPrintSubscriptions != null) 5462 { 5463 for (int i = 0; i < collPrintSubscriptions.size(); i++) 5464 { 5465 ((PrintSubscription) collPrintSubscriptions.get(i)).save(con); 5466 } 5467 } 5468 5469 5470 if (collOnlineSubscriptions != null) 5471 { 5472 for (int i = 0; i < collOnlineSubscriptions.size(); i++) 5473 { 5474 ((OnlineSubscription) collOnlineSubscriptions.get(i)).save(con); 5475 } 5476 } 5477 5478 5479 if (collSorderItems != null) 5480 { 5481 for (int i = 0; i < collSorderItems.size(); i++) 5482 { 5483 ((SorderItem) collSorderItems.get(i)).save(con); 5484 } 5485 } 5486 5487 5488 if (collPaymentItems != null) 5489 { 5490 for (int i = 0; i < collPaymentItems.size(); i++) 5491 { 5492 ((PaymentItem) collPaymentItems.get(i)).save(con); 5493 } 5494 } 5495 5496 5497 if (collShipmentItems != null) 5498 { 5499 for (int i = 0; i < collShipmentItems.size(); i++) 5500 { 5501 ((ShipmentItem) collShipmentItems.get(i)).save(con); 5502 } 5503 } 5504 5505 5506 if (collServiceItems != null) 5507 { 5508 for (int i = 0; i < collServiceItems.size(); i++) 5509 { 5510 ((ServiceItem) collServiceItems.get(i)).save(con); 5511 } 5512 } 5513 alreadyInSave = false; 5514 } 5515 } 5516 5517 5518 5523 public void setPrimaryKey(ObjectKey key) 5524 throws TorqueException 5525 { 5526 setSorderId(((NumberKey) key).intValue()); 5527 } 5528 5529 5534 public void setPrimaryKey(String key) throws TorqueException 5535 { 5536 setSorderId(Integer.parseInt(key)); 5537 } 5538 5539 5540 5544 public ObjectKey getPrimaryKey() 5545 { 5546 return SimpleKey.keyFor(getSorderId()); 5547 } 5548 5549 5553 public String getQueryKey() 5554 { 5555 if (getPrimaryKey() == null) 5556 { 5557 return ""; 5558 } 5559 else 5560 { 5561 return getPrimaryKey().toString(); 5562 } 5563 } 5564 5565 5569 public void setQueryKey(String key) 5570 throws TorqueException 5571 { 5572 setPrimaryKey(key); 5573 } 5574 5575 5581 public Sorder copy() throws TorqueException 5582 { 5583 return copyInto(new Sorder()); 5584 } 5585 5586 protected Sorder copyInto(Sorder copyObj) throws TorqueException 5587 { 5588 copyObj.setSorderId(sorderId); 5589 copyObj.setSorderCode(sorderCode); 5590 copyObj.setStatus(status); 5591 copyObj.setPriority(priority); 5592 copyObj.setIssuedDate(issuedDate); 5593 copyObj.setClosedDate(closedDate); 5594 copyObj.setCustomerId(customerId); 5595 copyObj.setRecipientId(recipientId); 5596 copyObj.setProjectId(projectId); 5597 copyObj.setCarrierId(carrierId); 5598 copyObj.setPayTerm(payTerm); 5599 copyObj.setPayMethod(payMethod); 5600 copyObj.setCurrencyId(currencyId); 5601 copyObj.setCurrencyAmount(currencyAmount); 5602 copyObj.setSubject(subject); 5603 copyObj.setNotes(notes); 5604 copyObj.setCreated(created); 5605 copyObj.setModified(modified); 5606 copyObj.setCreatedBy(createdBy); 5607 copyObj.setModifiedBy(modifiedBy); 5608 5609 copyObj.setSorderId( 0); 5610 5611 5612 5613 List v = getPayments(); 5614 for (int i = 0; i < v.size(); i++) 5615 { 5616 Payment obj = (Payment) v.get(i); 5617 copyObj.addPayment(obj.copy()); 5618 } 5619 5620 5621 v = getServices(); 5622 for (int i = 0; i < v.size(); i++) 5623 { 5624 Service obj = (Service) v.get(i); 5625 copyObj.addService(obj.copy()); 5626 } 5627 5628 5629 v = getShipments(); 5630 for (int i = 0; i < v.size(); i++) 5631 { 5632 Shipment obj = (Shipment) v.get(i); 5633 copyObj.addShipment(obj.copy()); 5634 } 5635 5636 5637 v = getPrintSubscriptions(); 5638 for (int i = 0; i < v.size(); i++) 5639 { 5640 PrintSubscription obj = (PrintSubscription) v.get(i); 5641 copyObj.addPrintSubscription(obj.copy()); 5642 } 5643 5644 5645 v = getOnlineSubscriptions(); 5646 for (int i = 0; i < v.size(); i++) 5647 { 5648 OnlineSubscription obj = (OnlineSubscription) v.get(i); 5649 copyObj.addOnlineSubscription(obj.copy()); 5650 } 5651 5652 5653 v = getSorderItems(); 5654 for (int i = 0; i < v.size(); i++) 5655 { 5656 SorderItem obj = (SorderItem) v.get(i); 5657 copyObj.addSorderItem(obj.copy()); 5658 } 5659 5660 5661 v = getPaymentItems(); 5662 for (int i = 0; i < v.size(); i++) 5663 { 5664 PaymentItem obj = (PaymentItem) v.get(i); 5665 copyObj.addPaymentItem(obj.copy()); 5666 } 5667 5668 5669 v = getShipmentItems(); 5670 for (int i = 0; i < v.size(); i++) 5671 { 5672 ShipmentItem obj = (ShipmentItem) v.get(i); 5673 copyObj.addShipmentItem(obj.copy()); 5674 } 5675 5676 5677 v = getServiceItems(); 5678 for (int i = 0; i < v.size(); i++) 5679 { 5680 ServiceItem obj = (ServiceItem) v.get(i); 5681 copyObj.addServiceItem(obj.copy()); 5682 } 5683 return copyObj; 5684 } 5685 5686 5692 public SorderPeer getPeer() 5693 { 5694 return peer; 5695 } 5696 5697 public String toString() 5698 { 5699 StringBuffer str = new StringBuffer (); 5700 str.append("Sorder:\n"); 5701 str.append("SorderId = ") 5702 .append(getSorderId()) 5703 .append("\n"); 5704 str.append("SorderCode = ") 5705 .append(getSorderCode()) 5706 .append("\n"); 5707 str.append("Status = ") 5708 .append(getStatus()) 5709 .append("\n"); 5710 str.append("Priority = ") 5711 .append(getPriority()) 5712 .append("\n"); 5713 str.append("IssuedDate = ") 5714 .append(getIssuedDate()) 5715 .append("\n"); 5716 str.append("ClosedDate = ") 5717 .append(getClosedDate()) 5718 .append("\n"); 5719 str.append("CustomerId = ") 5720 .append(getCustomerId()) 5721 .append("\n"); 5722 str.append("RecipientId = ") 5723 .append(getRecipientId()) 5724 .append("\n"); 5725 str.append("ProjectId = ") 5726 .append(getProjectId()) 5727 .append("\n"); 5728 str.append("CarrierId = ") 5729 .append(getCarrierId()) 5730 .append("\n"); 5731 str.append("PayTerm = ") 5732 .append(getPayTerm()) 5733 .append("\n"); 5734 str.append("PayMethod = ") 5735 .append(getPayMethod()) 5736 .append("\n"); 5737 str.append("CurrencyId = ") 5738 .append(getCurrencyId()) 5739 .append("\n"); 5740 str.append("CurrencyAmount = ") 5741 .append(getCurrencyAmount()) 5742 .append("\n"); 5743 str.append("Subject = ") 5744 .append(getSubject()) 5745 .append("\n"); 5746 str.append("Notes = ") 5747 .append(getNotes()) 5748 .append("\n"); 5749 str.append("Created = ") 5750 .append(getCreated()) 5751 .append("\n"); 5752 str.append("Modified = ") 5753 .append(getModified()) 5754 .append("\n"); 5755 str.append("CreatedBy = ") 5756 .append(getCreatedBy()) 5757 .append("\n"); 5758 str.append("ModifiedBy = ") 5759 .append(getModifiedBy()) 5760 .append("\n"); 5761 return(str.toString()); 5762 } 5763} 5764
| Popular Tags
|