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 37 public abstract class BaseProduct extends BaseObject 38 implements org.apache.turbine.om.Retrievable 39 { 40 41 private static final ProductPeer peer = 42 new ProductPeer(); 43 44 45 46 private int productId; 47 48 49 private String productCode = "AUTO"; 50 51 52 private int status = 30; 53 54 55 private int priority = 30; 56 57 58 private int productType = 10; 59 60 61 private int productCatId = 1000; 62 63 64 private String productDescription; 65 66 67 private String productDisplay; 68 69 70 private double basePrice = 0; 71 72 73 private int uomId = 1000; 74 75 76 private String webUrl; 77 78 79 private int showOnPricelist = 20; 80 81 82 private int vendorId = 1000; 83 84 85 private String vendorsCode; 86 87 88 private String eanUpcCode; 89 90 91 private String location; 92 93 94 private String custom1; 95 96 97 private String custom2; 98 99 100 private String custom3; 101 102 103 private String custom4; 104 105 106 private String custom5; 107 108 109 private String custom6; 110 111 112 private String notes; 113 114 115 private Date created; 116 117 118 private Date modified; 119 120 121 private String createdBy; 122 123 124 private String modifiedBy; 125 126 127 132 public int getProductId() 133 { 134 return productId; 135 } 136 137 138 143 public void setProductId(int v) throws TorqueException 144 { 145 146 if (this.productId != v) 147 { 148 this.productId = v; 149 setModified(true); 150 } 151 152 153 154 if (collPrintSubscriptions != null) 156 { 157 for (int i = 0; i < collPrintSubscriptions.size(); i++) 158 { 159 ((PrintSubscription) collPrintSubscriptions.get(i)) 160 .setProductId(v); 161 } 162 } 163 164 if (collOnlineSubscriptions != null) 166 { 167 for (int i = 0; i < collOnlineSubscriptions.size(); i++) 168 { 169 ((OnlineSubscription) collOnlineSubscriptions.get(i)) 170 .setProductId(v); 171 } 172 } 173 174 if (collInboxEvents != null) 176 { 177 for (int i = 0; i < collInboxEvents.size(); i++) 178 { 179 ((InboxEvent) collInboxEvents.get(i)) 180 .setProductId(v); 181 } 182 } 183 184 if (collOutboxEvents != null) 186 { 187 for (int i = 0; i < collOutboxEvents.size(); i++) 188 { 189 ((OutboxEvent) collOutboxEvents.get(i)) 190 .setProductId(v); 191 } 192 } 193 194 if (collNewsSubscriptions != null) 196 { 197 for (int i = 0; i < collNewsSubscriptions.size(); i++) 198 { 199 ((NewsSubscription) collNewsSubscriptions.get(i)) 200 .setProductId(v); 201 } 202 } 203 204 if (collNewslettersRelatedByProductId != null) 206 { 207 for (int i = 0; i < collNewslettersRelatedByProductId.size(); i++) 208 { 209 ((Newsletter) collNewslettersRelatedByProductId.get(i)) 210 .setProductId(v); 211 } 212 } 213 214 if (collNewslettersRelatedByRelProductId != null) 216 { 217 for (int i = 0; i < collNewslettersRelatedByRelProductId.size(); i++) 218 { 219 ((Newsletter) collNewslettersRelatedByRelProductId.get(i)) 220 .setRelProductId(v); 221 } 222 } 223 224 if (collSorderItems != null) 226 { 227 for (int i = 0; i < collSorderItems.size(); i++) 228 { 229 ((SorderItem) collSorderItems.get(i)) 230 .setProductId(v); 231 } 232 } 233 234 if (collPaymentItems != null) 236 { 237 for (int i = 0; i < collPaymentItems.size(); i++) 238 { 239 ((PaymentItem) collPaymentItems.get(i)) 240 .setProductId(v); 241 } 242 } 243 244 if (collShipmentItems != null) 246 { 247 for (int i = 0; i < collShipmentItems.size(); i++) 248 { 249 ((ShipmentItem) collShipmentItems.get(i)) 250 .setProductId(v); 251 } 252 } 253 254 if (collServiceItems != null) 256 { 257 for (int i = 0; i < collServiceItems.size(); i++) 258 { 259 ((ServiceItem) collServiceItems.get(i)) 260 .setProductId(v); 261 } 262 } 263 } 264 265 270 public String getProductCode() 271 { 272 return productCode; 273 } 274 275 276 281 public void setProductCode(String v) 282 { 283 284 if (!ObjectUtils.equals(this.productCode, v)) 285 { 286 this.productCode = v; 287 setModified(true); 288 } 289 290 291 } 292 293 298 public int getStatus() 299 { 300 return status; 301 } 302 303 304 309 public void setStatus(int v) 310 { 311 312 if (this.status != v) 313 { 314 this.status = v; 315 setModified(true); 316 } 317 318 319 } 320 321 326 public int getPriority() 327 { 328 return priority; 329 } 330 331 332 337 public void setPriority(int v) 338 { 339 340 if (this.priority != v) 341 { 342 this.priority = v; 343 setModified(true); 344 } 345 346 347 } 348 349 354 public int getProductType() 355 { 356 return productType; 357 } 358 359 360 365 public void setProductType(int v) 366 { 367 368 if (this.productType != v) 369 { 370 this.productType = v; 371 setModified(true); 372 } 373 374 375 } 376 377 382 public int getProductCatId() 383 { 384 return productCatId; 385 } 386 387 388 393 public void setProductCatId(int v) throws TorqueException 394 { 395 396 if (this.productCatId != v) 397 { 398 this.productCatId = v; 399 setModified(true); 400 } 401 402 403 if (aProductCategory != null && !(aProductCategory.getProductCatId() == v)) 404 { 405 aProductCategory = null; 406 } 407 408 } 409 410 415 public String getProductDescription() 416 { 417 return productDescription; 418 } 419 420 421 426 public void setProductDescription(String v) 427 { 428 429 if (!ObjectUtils.equals(this.productDescription, v)) 430 { 431 this.productDescription = v; 432 setModified(true); 433 } 434 435 436 } 437 438 443 public String getProductDisplay() 444 { 445 return productDisplay; 446 } 447 448 449 454 public void setProductDisplay(String v) 455 { 456 457 if (!ObjectUtils.equals(this.productDisplay, v)) 458 { 459 this.productDisplay = v; 460 setModified(true); 461 } 462 463 464 } 465 466 471 public double getBasePrice() 472 { 473 return basePrice; 474 } 475 476 477 482 public void setBasePrice(double v) 483 { 484 485 if (this.basePrice != v) 486 { 487 this.basePrice = v; 488 setModified(true); 489 } 490 491 492 } 493 494 499 public int getUomId() 500 { 501 return uomId; 502 } 503 504 505 510 public void setUomId(int v) throws TorqueException 511 { 512 513 if (this.uomId != v) 514 { 515 this.uomId = v; 516 setModified(true); 517 } 518 519 520 if (aUom != null && !(aUom.getUomId() == v)) 521 { 522 aUom = null; 523 } 524 525 } 526 527 532 public String getWebUrl() 533 { 534 return webUrl; 535 } 536 537 538 543 public void setWebUrl(String v) 544 { 545 546 if (!ObjectUtils.equals(this.webUrl, v)) 547 { 548 this.webUrl = v; 549 setModified(true); 550 } 551 552 553 } 554 555 560 public int getShowOnPricelist() 561 { 562 return showOnPricelist; 563 } 564 565 566 571 public void setShowOnPricelist(int v) 572 { 573 574 if (this.showOnPricelist != v) 575 { 576 this.showOnPricelist = v; 577 setModified(true); 578 } 579 580 581 } 582 583 588 public int getVendorId() 589 { 590 return vendorId; 591 } 592 593 594 599 public void setVendorId(int v) throws TorqueException 600 { 601 602 if (this.vendorId != v) 603 { 604 this.vendorId = v; 605 setModified(true); 606 } 607 608 609 if (aVendor != null && !(aVendor.getVendorId() == v)) 610 { 611 aVendor = null; 612 } 613 614 } 615 616 621 public String getVendorsCode() 622 { 623 return vendorsCode; 624 } 625 626 627 632 public void setVendorsCode(String v) 633 { 634 635 if (!ObjectUtils.equals(this.vendorsCode, v)) 636 { 637 this.vendorsCode = v; 638 setModified(true); 639 } 640 641 642 } 643 644 649 public String getEanUpcCode() 650 { 651 return eanUpcCode; 652 } 653 654 655 660 public void setEanUpcCode(String v) 661 { 662 663 if (!ObjectUtils.equals(this.eanUpcCode, v)) 664 { 665 this.eanUpcCode = v; 666 setModified(true); 667 } 668 669 670 } 671 672 677 public String getLocation() 678 { 679 return location; 680 } 681 682 683 688 public void setLocation(String v) 689 { 690 691 if (!ObjectUtils.equals(this.location, v)) 692 { 693 this.location = v; 694 setModified(true); 695 } 696 697 698 } 699 700 705 public String getCustom1() 706 { 707 return custom1; 708 } 709 710 711 716 public void setCustom1(String v) 717 { 718 719 if (!ObjectUtils.equals(this.custom1, v)) 720 { 721 this.custom1 = v; 722 setModified(true); 723 } 724 725 726 } 727 728 733 public String getCustom2() 734 { 735 return custom2; 736 } 737 738 739 744 public void setCustom2(String v) 745 { 746 747 if (!ObjectUtils.equals(this.custom2, v)) 748 { 749 this.custom2 = v; 750 setModified(true); 751 } 752 753 754 } 755 756 761 public String getCustom3() 762 { 763 return custom3; 764 } 765 766 767 772 public void setCustom3(String v) 773 { 774 775 if (!ObjectUtils.equals(this.custom3, v)) 776 { 777 this.custom3 = v; 778 setModified(true); 779 } 780 781 782 } 783 784 789 public String getCustom4() 790 { 791 return custom4; 792 } 793 794 795 800 public void setCustom4(String v) 801 { 802 803 if (!ObjectUtils.equals(this.custom4, v)) 804 { 805 this.custom4 = v; 806 setModified(true); 807 } 808 809 810 } 811 812 817 public String getCustom5() 818 { 819 return custom5; 820 } 821 822 823 828 public void setCustom5(String v) 829 { 830 831 if (!ObjectUtils.equals(this.custom5, v)) 832 { 833 this.custom5 = v; 834 setModified(true); 835 } 836 837 838 } 839 840 845 public String getCustom6() 846 { 847 return custom6; 848 } 849 850 851 856 public void setCustom6(String v) 857 { 858 859 if (!ObjectUtils.equals(this.custom6, v)) 860 { 861 this.custom6 = v; 862 setModified(true); 863 } 864 865 866 } 867 868 873 public String getNotes() 874 { 875 return notes; 876 } 877 878 879 884 public void setNotes(String v) 885 { 886 887 if (!ObjectUtils.equals(this.notes, v)) 888 { 889 this.notes = v; 890 setModified(true); 891 } 892 893 894 } 895 896 901 public Date getCreated() 902 { 903 return created; 904 } 905 906 907 912 public void setCreated(Date v) 913 { 914 915 if (!ObjectUtils.equals(this.created, v)) 916 { 917 this.created = v; 918 setModified(true); 919 } 920 921 922 } 923 924 929 public Date getModified() 930 { 931 return modified; 932 } 933 934 935 940 public void setModified(Date v) 941 { 942 943 if (!ObjectUtils.equals(this.modified, v)) 944 { 945 this.modified = v; 946 setModified(true); 947 } 948 949 950 } 951 952 957 public String getCreatedBy() 958 { 959 return createdBy; 960 } 961 962 963 968 public void setCreatedBy(String v) 969 { 970 971 if (!ObjectUtils.equals(this.createdBy, v)) 972 { 973 this.createdBy = v; 974 setModified(true); 975 } 976 977 978 } 979 980 985 public String getModifiedBy() 986 { 987 return modifiedBy; 988 } 989 990 991 996 public void setModifiedBy(String v) 997 { 998 999 if (!ObjectUtils.equals(this.modifiedBy, v)) 1000 { 1001 this.modifiedBy = v; 1002 setModified(true); 1003 } 1004 1005 1006 } 1007 1008 1009 1010 1011 1012 private ProductCategory aProductCategory; 1013 1014 1020 public void setProductCategory(ProductCategory v) throws TorqueException 1021 { 1022 if (v == null) 1023 { 1024 setProductCatId( 1000); 1025 } 1026 else 1027 { 1028 setProductCatId(v.getProductCatId()); 1029 } 1030 aProductCategory = v; 1031 } 1032 1033 1034 1040 public ProductCategory getProductCategory() throws TorqueException 1041 { 1042 if (aProductCategory == null && (this.productCatId != 0)) 1043 { 1044 aProductCategory = ProductCategoryPeer.retrieveByPK(SimpleKey.keyFor(this.productCatId)); 1045 1046 1055 } 1056 return aProductCategory; 1057 } 1058 1059 1065 public void setProductCategoryKey(ObjectKey key) throws TorqueException 1066 { 1067 1068 setProductCatId(((NumberKey) key).intValue()); 1069 } 1070 1071 1072 1073 1074 private Uom aUom; 1075 1076 1082 public void setUom(Uom v) throws TorqueException 1083 { 1084 if (v == null) 1085 { 1086 setUomId( 1000); 1087 } 1088 else 1089 { 1090 setUomId(v.getUomId()); 1091 } 1092 aUom = v; 1093 } 1094 1095 1096 1102 public Uom getUom() throws TorqueException 1103 { 1104 if (aUom == null && (this.uomId != 0)) 1105 { 1106 aUom = UomPeer.retrieveByPK(SimpleKey.keyFor(this.uomId)); 1107 1108 1117 } 1118 return aUom; 1119 } 1120 1121 1127 public void setUomKey(ObjectKey key) throws TorqueException 1128 { 1129 1130 setUomId(((NumberKey) key).intValue()); 1131 } 1132 1133 1134 1135 1136 private Vendor aVendor; 1137 1138 1144 public void setVendor(Vendor v) throws TorqueException 1145 { 1146 if (v == null) 1147 { 1148 setVendorId( 1000); 1149 } 1150 else 1151 { 1152 setVendorId(v.getVendorId()); 1153 } 1154 aVendor = v; 1155 } 1156 1157 1158 1164 public Vendor getVendor() throws TorqueException 1165 { 1166 if (aVendor == null && (this.vendorId != 0)) 1167 { 1168 aVendor = VendorPeer.retrieveByPK(SimpleKey.keyFor(this.vendorId)); 1169 1170 1179 } 1180 return aVendor; 1181 } 1182 1183 1189 public void setVendorKey(ObjectKey key) throws TorqueException 1190 { 1191 1192 setVendorId(((NumberKey) key).intValue()); 1193 } 1194 1195 1196 1197 1200 protected List collPrintSubscriptions; 1201 1202 1207 protected void initPrintSubscriptions() 1208 { 1209 if (collPrintSubscriptions == null) 1210 { 1211 collPrintSubscriptions = new ArrayList (); 1212 } 1213 } 1214 1215 1222 public void addPrintSubscription(PrintSubscription l) throws TorqueException 1223 { 1224 getPrintSubscriptions().add(l); 1225 l.setProduct((Product) this); 1226 } 1227 1228 1231 private Criteria lastPrintSubscriptionsCriteria = null; 1232 1233 1240 public List getPrintSubscriptions() throws TorqueException 1241 { 1242 if (collPrintSubscriptions == null) 1243 { 1244 collPrintSubscriptions = getPrintSubscriptions(new Criteria(10)); 1245 } 1246 return collPrintSubscriptions; 1247 } 1248 1249 1260 public List getPrintSubscriptions(Criteria criteria) throws TorqueException 1261 { 1262 if (collPrintSubscriptions == null) 1263 { 1264 if (isNew()) 1265 { 1266 collPrintSubscriptions = new ArrayList (); 1267 } 1268 else 1269 { 1270 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId() ); 1271 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria); 1272 } 1273 } 1274 else 1275 { 1276 if (!isNew()) 1278 { 1279 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1283 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1284 { 1285 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria); 1286 } 1287 } 1288 } 1289 lastPrintSubscriptionsCriteria = criteria; 1290 1291 return collPrintSubscriptions; 1292 } 1293 1294 1302 public List getPrintSubscriptions(Connection con) throws TorqueException 1303 { 1304 if (collPrintSubscriptions == null) 1305 { 1306 collPrintSubscriptions = getPrintSubscriptions(new Criteria(10), con); 1307 } 1308 return collPrintSubscriptions; 1309 } 1310 1311 1323 public List getPrintSubscriptions(Criteria criteria, Connection con) 1324 throws TorqueException 1325 { 1326 if (collPrintSubscriptions == null) 1327 { 1328 if (isNew()) 1329 { 1330 collPrintSubscriptions = new ArrayList (); 1331 } 1332 else 1333 { 1334 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1335 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con); 1336 } 1337 } 1338 else 1339 { 1340 if (!isNew()) 1342 { 1343 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1347 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1348 { 1349 collPrintSubscriptions = PrintSubscriptionPeer.doSelect(criteria, con); 1350 } 1351 } 1352 } 1353 lastPrintSubscriptionsCriteria = criteria; 1354 1355 return collPrintSubscriptions; 1356 } 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1379 protected List getPrintSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria) 1380 throws TorqueException 1381 { 1382 if (collPrintSubscriptions == null) 1383 { 1384 if (isNew()) 1385 { 1386 collPrintSubscriptions = new ArrayList (); 1387 } 1388 else 1389 { 1390 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1391 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1392 } 1393 } 1394 else 1395 { 1396 1400 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1401 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1402 { 1403 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1404 } 1405 } 1406 lastPrintSubscriptionsCriteria = criteria; 1407 1408 return collPrintSubscriptions; 1409 } 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1430 protected List getPrintSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria) 1431 throws TorqueException 1432 { 1433 if (collPrintSubscriptions == null) 1434 { 1435 if (isNew()) 1436 { 1437 collPrintSubscriptions = new ArrayList (); 1438 } 1439 else 1440 { 1441 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1442 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1443 } 1444 } 1445 else 1446 { 1447 1451 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1452 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1453 { 1454 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1455 } 1456 } 1457 lastPrintSubscriptionsCriteria = criteria; 1458 1459 return collPrintSubscriptions; 1460 } 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1481 protected List getPrintSubscriptionsJoinCarrier(Criteria criteria) 1482 throws TorqueException 1483 { 1484 if (collPrintSubscriptions == null) 1485 { 1486 if (isNew()) 1487 { 1488 collPrintSubscriptions = new ArrayList (); 1489 } 1490 else 1491 { 1492 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1493 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria); 1494 } 1495 } 1496 else 1497 { 1498 1502 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1503 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1504 { 1505 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinCarrier(criteria); 1506 } 1507 } 1508 lastPrintSubscriptionsCriteria = criteria; 1509 1510 return collPrintSubscriptions; 1511 } 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1532 protected List getPrintSubscriptionsJoinProject(Criteria criteria) 1533 throws TorqueException 1534 { 1535 if (collPrintSubscriptions == null) 1536 { 1537 if (isNew()) 1538 { 1539 collPrintSubscriptions = new ArrayList (); 1540 } 1541 else 1542 { 1543 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1544 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria); 1545 } 1546 } 1547 else 1548 { 1549 1553 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1554 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1555 { 1556 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProject(criteria); 1557 } 1558 } 1559 lastPrintSubscriptionsCriteria = criteria; 1560 1561 return collPrintSubscriptions; 1562 } 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1583 protected List getPrintSubscriptionsJoinProduct(Criteria criteria) 1584 throws TorqueException 1585 { 1586 if (collPrintSubscriptions == null) 1587 { 1588 if (isNew()) 1589 { 1590 collPrintSubscriptions = new ArrayList (); 1591 } 1592 else 1593 { 1594 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1595 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria); 1596 } 1597 } 1598 else 1599 { 1600 1604 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1605 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1606 { 1607 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinProduct(criteria); 1608 } 1609 } 1610 lastPrintSubscriptionsCriteria = criteria; 1611 1612 return collPrintSubscriptions; 1613 } 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1634 protected List getPrintSubscriptionsJoinSorder(Criteria criteria) 1635 throws TorqueException 1636 { 1637 if (collPrintSubscriptions == null) 1638 { 1639 if (isNew()) 1640 { 1641 collPrintSubscriptions = new ArrayList (); 1642 } 1643 else 1644 { 1645 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1646 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria); 1647 } 1648 } 1649 else 1650 { 1651 1655 criteria.add(PrintSubscriptionPeer.PRODUCT_ID, getProductId()); 1656 if (!lastPrintSubscriptionsCriteria.equals(criteria)) 1657 { 1658 collPrintSubscriptions = PrintSubscriptionPeer.doSelectJoinSorder(criteria); 1659 } 1660 } 1661 lastPrintSubscriptionsCriteria = criteria; 1662 1663 return collPrintSubscriptions; 1664 } 1665 1666 1667 1668 1669 1670 1673 protected List collOnlineSubscriptions; 1674 1675 1680 protected void initOnlineSubscriptions() 1681 { 1682 if (collOnlineSubscriptions == null) 1683 { 1684 collOnlineSubscriptions = new ArrayList (); 1685 } 1686 } 1687 1688 1695 public void addOnlineSubscription(OnlineSubscription l) throws TorqueException 1696 { 1697 getOnlineSubscriptions().add(l); 1698 l.setProduct((Product) this); 1699 } 1700 1701 1704 private Criteria lastOnlineSubscriptionsCriteria = null; 1705 1706 1713 public List getOnlineSubscriptions() throws TorqueException 1714 { 1715 if (collOnlineSubscriptions == null) 1716 { 1717 collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10)); 1718 } 1719 return collOnlineSubscriptions; 1720 } 1721 1722 1733 public List getOnlineSubscriptions(Criteria criteria) throws TorqueException 1734 { 1735 if (collOnlineSubscriptions == null) 1736 { 1737 if (isNew()) 1738 { 1739 collOnlineSubscriptions = new ArrayList (); 1740 } 1741 else 1742 { 1743 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId() ); 1744 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria); 1745 } 1746 } 1747 else 1748 { 1749 if (!isNew()) 1751 { 1752 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1756 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 1757 { 1758 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria); 1759 } 1760 } 1761 } 1762 lastOnlineSubscriptionsCriteria = criteria; 1763 1764 return collOnlineSubscriptions; 1765 } 1766 1767 1775 public List getOnlineSubscriptions(Connection con) throws TorqueException 1776 { 1777 if (collOnlineSubscriptions == null) 1778 { 1779 collOnlineSubscriptions = getOnlineSubscriptions(new Criteria(10), con); 1780 } 1781 return collOnlineSubscriptions; 1782 } 1783 1784 1796 public List getOnlineSubscriptions(Criteria criteria, Connection con) 1797 throws TorqueException 1798 { 1799 if (collOnlineSubscriptions == null) 1800 { 1801 if (isNew()) 1802 { 1803 collOnlineSubscriptions = new ArrayList (); 1804 } 1805 else 1806 { 1807 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1808 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con); 1809 } 1810 } 1811 else 1812 { 1813 if (!isNew()) 1815 { 1816 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1820 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 1821 { 1822 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelect(criteria, con); 1823 } 1824 } 1825 } 1826 lastOnlineSubscriptionsCriteria = criteria; 1827 1828 return collOnlineSubscriptions; 1829 } 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1852 protected List getOnlineSubscriptionsJoinCustomerRelatedByCustomerId(Criteria criteria) 1853 throws TorqueException 1854 { 1855 if (collOnlineSubscriptions == null) 1856 { 1857 if (isNew()) 1858 { 1859 collOnlineSubscriptions = new ArrayList (); 1860 } 1861 else 1862 { 1863 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1864 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1865 } 1866 } 1867 else 1868 { 1869 1873 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1874 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 1875 { 1876 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 1877 } 1878 } 1879 lastOnlineSubscriptionsCriteria = criteria; 1880 1881 return collOnlineSubscriptions; 1882 } 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1903 protected List getOnlineSubscriptionsJoinCustomerRelatedByRecipientId(Criteria criteria) 1904 throws TorqueException 1905 { 1906 if (collOnlineSubscriptions == null) 1907 { 1908 if (isNew()) 1909 { 1910 collOnlineSubscriptions = new ArrayList (); 1911 } 1912 else 1913 { 1914 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1915 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1916 } 1917 } 1918 else 1919 { 1920 1924 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1925 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 1926 { 1927 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 1928 } 1929 } 1930 lastOnlineSubscriptionsCriteria = criteria; 1931 1932 return collOnlineSubscriptions; 1933 } 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1954 protected List getOnlineSubscriptionsJoinProject(Criteria criteria) 1955 throws TorqueException 1956 { 1957 if (collOnlineSubscriptions == null) 1958 { 1959 if (isNew()) 1960 { 1961 collOnlineSubscriptions = new ArrayList (); 1962 } 1963 else 1964 { 1965 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1966 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria); 1967 } 1968 } 1969 else 1970 { 1971 1975 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 1976 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 1977 { 1978 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProject(criteria); 1979 } 1980 } 1981 lastOnlineSubscriptionsCriteria = criteria; 1982 1983 return collOnlineSubscriptions; 1984 } 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 2005 protected List getOnlineSubscriptionsJoinProduct(Criteria criteria) 2006 throws TorqueException 2007 { 2008 if (collOnlineSubscriptions == null) 2009 { 2010 if (isNew()) 2011 { 2012 collOnlineSubscriptions = new ArrayList (); 2013 } 2014 else 2015 { 2016 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 2017 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria); 2018 } 2019 } 2020 else 2021 { 2022 2026 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 2027 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2028 { 2029 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinProduct(criteria); 2030 } 2031 } 2032 lastOnlineSubscriptionsCriteria = criteria; 2033 2034 return collOnlineSubscriptions; 2035 } 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2056 protected List getOnlineSubscriptionsJoinSorder(Criteria criteria) 2057 throws TorqueException 2058 { 2059 if (collOnlineSubscriptions == null) 2060 { 2061 if (isNew()) 2062 { 2063 collOnlineSubscriptions = new ArrayList (); 2064 } 2065 else 2066 { 2067 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 2068 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria); 2069 } 2070 } 2071 else 2072 { 2073 2077 criteria.add(OnlineSubscriptionPeer.PRODUCT_ID, getProductId()); 2078 if (!lastOnlineSubscriptionsCriteria.equals(criteria)) 2079 { 2080 collOnlineSubscriptions = OnlineSubscriptionPeer.doSelectJoinSorder(criteria); 2081 } 2082 } 2083 lastOnlineSubscriptionsCriteria = criteria; 2084 2085 return collOnlineSubscriptions; 2086 } 2087 2088 2089 2090 2091 2092 2095 protected List collInboxEvents; 2096 2097 2102 protected void initInboxEvents() 2103 { 2104 if (collInboxEvents == null) 2105 { 2106 collInboxEvents = new ArrayList (); 2107 } 2108 } 2109 2110 2117 public void addInboxEvent(InboxEvent l) throws TorqueException 2118 { 2119 getInboxEvents().add(l); 2120 l.setProduct((Product) this); 2121 } 2122 2123 2126 private Criteria lastInboxEventsCriteria = null; 2127 2128 2135 public List getInboxEvents() throws TorqueException 2136 { 2137 if (collInboxEvents == null) 2138 { 2139 collInboxEvents = getInboxEvents(new Criteria(10)); 2140 } 2141 return collInboxEvents; 2142 } 2143 2144 2155 public List getInboxEvents(Criteria criteria) throws TorqueException 2156 { 2157 if (collInboxEvents == null) 2158 { 2159 if (isNew()) 2160 { 2161 collInboxEvents = new ArrayList (); 2162 } 2163 else 2164 { 2165 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId() ); 2166 collInboxEvents = InboxEventPeer.doSelect(criteria); 2167 } 2168 } 2169 else 2170 { 2171 if (!isNew()) 2173 { 2174 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2178 if (!lastInboxEventsCriteria.equals(criteria)) 2179 { 2180 collInboxEvents = InboxEventPeer.doSelect(criteria); 2181 } 2182 } 2183 } 2184 lastInboxEventsCriteria = criteria; 2185 2186 return collInboxEvents; 2187 } 2188 2189 2197 public List getInboxEvents(Connection con) throws TorqueException 2198 { 2199 if (collInboxEvents == null) 2200 { 2201 collInboxEvents = getInboxEvents(new Criteria(10), con); 2202 } 2203 return collInboxEvents; 2204 } 2205 2206 2218 public List getInboxEvents(Criteria criteria, Connection con) 2219 throws TorqueException 2220 { 2221 if (collInboxEvents == null) 2222 { 2223 if (isNew()) 2224 { 2225 collInboxEvents = new ArrayList (); 2226 } 2227 else 2228 { 2229 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2230 collInboxEvents = InboxEventPeer.doSelect(criteria, con); 2231 } 2232 } 2233 else 2234 { 2235 if (!isNew()) 2237 { 2238 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2242 if (!lastInboxEventsCriteria.equals(criteria)) 2243 { 2244 collInboxEvents = InboxEventPeer.doSelect(criteria, con); 2245 } 2246 } 2247 } 2248 lastInboxEventsCriteria = criteria; 2249 2250 return collInboxEvents; 2251 } 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2274 protected List getInboxEventsJoinCustomer(Criteria criteria) 2275 throws TorqueException 2276 { 2277 if (collInboxEvents == null) 2278 { 2279 if (isNew()) 2280 { 2281 collInboxEvents = new ArrayList (); 2282 } 2283 else 2284 { 2285 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2286 collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria); 2287 } 2288 } 2289 else 2290 { 2291 2295 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2296 if (!lastInboxEventsCriteria.equals(criteria)) 2297 { 2298 collInboxEvents = InboxEventPeer.doSelectJoinCustomer(criteria); 2299 } 2300 } 2301 lastInboxEventsCriteria = criteria; 2302 2303 return collInboxEvents; 2304 } 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2325 protected List getInboxEventsJoinProject(Criteria criteria) 2326 throws TorqueException 2327 { 2328 if (collInboxEvents == null) 2329 { 2330 if (isNew()) 2331 { 2332 collInboxEvents = new ArrayList (); 2333 } 2334 else 2335 { 2336 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2337 collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria); 2338 } 2339 } 2340 else 2341 { 2342 2346 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2347 if (!lastInboxEventsCriteria.equals(criteria)) 2348 { 2349 collInboxEvents = InboxEventPeer.doSelectJoinProject(criteria); 2350 } 2351 } 2352 lastInboxEventsCriteria = criteria; 2353 2354 return collInboxEvents; 2355 } 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2376 protected List getInboxEventsJoinProduct(Criteria criteria) 2377 throws TorqueException 2378 { 2379 if (collInboxEvents == null) 2380 { 2381 if (isNew()) 2382 { 2383 collInboxEvents = new ArrayList (); 2384 } 2385 else 2386 { 2387 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2388 collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria); 2389 } 2390 } 2391 else 2392 { 2393 2397 criteria.add(InboxEventPeer.PRODUCT_ID, getProductId()); 2398 if (!lastInboxEventsCriteria.equals(criteria)) 2399 { 2400 collInboxEvents = InboxEventPeer.doSelectJoinProduct(criteria); 2401 } 2402 } 2403 lastInboxEventsCriteria = criteria; 2404 2405 return collInboxEvents; 2406 } 2407 2408 2409 2410 2411 2412 2415 protected List collOutboxEvents; 2416 2417 2422 protected void initOutboxEvents() 2423 { 2424 if (collOutboxEvents == null) 2425 { 2426 collOutboxEvents = new ArrayList (); 2427 } 2428 } 2429 2430 2437 public void addOutboxEvent(OutboxEvent l) throws TorqueException 2438 { 2439 getOutboxEvents().add(l); 2440 l.setProduct((Product) this); 2441 } 2442 2443 2446 private Criteria lastOutboxEventsCriteria = null; 2447 2448 2455 public List getOutboxEvents() throws TorqueException 2456 { 2457 if (collOutboxEvents == null) 2458 { 2459 collOutboxEvents = getOutboxEvents(new Criteria(10)); 2460 } 2461 return collOutboxEvents; 2462 } 2463 2464 2475 public List getOutboxEvents(Criteria criteria) throws TorqueException 2476 { 2477 if (collOutboxEvents == null) 2478 { 2479 if (isNew()) 2480 { 2481 collOutboxEvents = new ArrayList (); 2482 } 2483 else 2484 { 2485 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId() ); 2486 collOutboxEvents = OutboxEventPeer.doSelect(criteria); 2487 } 2488 } 2489 else 2490 { 2491 if (!isNew()) 2493 { 2494 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2498 if (!lastOutboxEventsCriteria.equals(criteria)) 2499 { 2500 collOutboxEvents = OutboxEventPeer.doSelect(criteria); 2501 } 2502 } 2503 } 2504 lastOutboxEventsCriteria = criteria; 2505 2506 return collOutboxEvents; 2507 } 2508 2509 2517 public List getOutboxEvents(Connection con) throws TorqueException 2518 { 2519 if (collOutboxEvents == null) 2520 { 2521 collOutboxEvents = getOutboxEvents(new Criteria(10), con); 2522 } 2523 return collOutboxEvents; 2524 } 2525 2526 2538 public List getOutboxEvents(Criteria criteria, Connection con) 2539 throws TorqueException 2540 { 2541 if (collOutboxEvents == null) 2542 { 2543 if (isNew()) 2544 { 2545 collOutboxEvents = new ArrayList (); 2546 } 2547 else 2548 { 2549 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2550 collOutboxEvents = OutboxEventPeer.doSelect(criteria, con); 2551 } 2552 } 2553 else 2554 { 2555 if (!isNew()) 2557 { 2558 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2562 if (!lastOutboxEventsCriteria.equals(criteria)) 2563 { 2564 collOutboxEvents = OutboxEventPeer.doSelect(criteria, con); 2565 } 2566 } 2567 } 2568 lastOutboxEventsCriteria = criteria; 2569 2570 return collOutboxEvents; 2571 } 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2594 protected List getOutboxEventsJoinCustomer(Criteria criteria) 2595 throws TorqueException 2596 { 2597 if (collOutboxEvents == null) 2598 { 2599 if (isNew()) 2600 { 2601 collOutboxEvents = new ArrayList (); 2602 } 2603 else 2604 { 2605 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2606 collOutboxEvents = OutboxEventPeer.doSelectJoinCustomer(criteria); 2607 } 2608 } 2609 else 2610 { 2611 2615 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2616 if (!lastOutboxEventsCriteria.equals(criteria)) 2617 { 2618 collOutboxEvents = OutboxEventPeer.doSelectJoinCustomer(criteria); 2619 } 2620 } 2621 lastOutboxEventsCriteria = criteria; 2622 2623 return collOutboxEvents; 2624 } 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2645 protected List getOutboxEventsJoinProject(Criteria criteria) 2646 throws TorqueException 2647 { 2648 if (collOutboxEvents == null) 2649 { 2650 if (isNew()) 2651 { 2652 collOutboxEvents = new ArrayList (); 2653 } 2654 else 2655 { 2656 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2657 collOutboxEvents = OutboxEventPeer.doSelectJoinProject(criteria); 2658 } 2659 } 2660 else 2661 { 2662 2666 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2667 if (!lastOutboxEventsCriteria.equals(criteria)) 2668 { 2669 collOutboxEvents = OutboxEventPeer.doSelectJoinProject(criteria); 2670 } 2671 } 2672 lastOutboxEventsCriteria = criteria; 2673 2674 return collOutboxEvents; 2675 } 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2696 protected List getOutboxEventsJoinProduct(Criteria criteria) 2697 throws TorqueException 2698 { 2699 if (collOutboxEvents == null) 2700 { 2701 if (isNew()) 2702 { 2703 collOutboxEvents = new ArrayList (); 2704 } 2705 else 2706 { 2707 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2708 collOutboxEvents = OutboxEventPeer.doSelectJoinProduct(criteria); 2709 } 2710 } 2711 else 2712 { 2713 2717 criteria.add(OutboxEventPeer.PRODUCT_ID, getProductId()); 2718 if (!lastOutboxEventsCriteria.equals(criteria)) 2719 { 2720 collOutboxEvents = OutboxEventPeer.doSelectJoinProduct(criteria); 2721 } 2722 } 2723 lastOutboxEventsCriteria = criteria; 2724 2725 return collOutboxEvents; 2726 } 2727 2728 2729 2730 2731 2732 2735 protected List collNewsSubscriptions; 2736 2737 2742 protected void initNewsSubscriptions() 2743 { 2744 if (collNewsSubscriptions == null) 2745 { 2746 collNewsSubscriptions = new ArrayList (); 2747 } 2748 } 2749 2750 2757 public void addNewsSubscription(NewsSubscription l) throws TorqueException 2758 { 2759 getNewsSubscriptions().add(l); 2760 l.setProduct((Product) this); 2761 } 2762 2763 2766 private Criteria lastNewsSubscriptionsCriteria = null; 2767 2768 2775 public List getNewsSubscriptions() throws TorqueException 2776 { 2777 if (collNewsSubscriptions == null) 2778 { 2779 collNewsSubscriptions = getNewsSubscriptions(new Criteria(10)); 2780 } 2781 return collNewsSubscriptions; 2782 } 2783 2784 2795 public List getNewsSubscriptions(Criteria criteria) throws TorqueException 2796 { 2797 if (collNewsSubscriptions == null) 2798 { 2799 if (isNew()) 2800 { 2801 collNewsSubscriptions = new ArrayList (); 2802 } 2803 else 2804 { 2805 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId() ); 2806 collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria); 2807 } 2808 } 2809 else 2810 { 2811 if (!isNew()) 2813 { 2814 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2818 if (!lastNewsSubscriptionsCriteria.equals(criteria)) 2819 { 2820 collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria); 2821 } 2822 } 2823 } 2824 lastNewsSubscriptionsCriteria = criteria; 2825 2826 return collNewsSubscriptions; 2827 } 2828 2829 2837 public List getNewsSubscriptions(Connection con) throws TorqueException 2838 { 2839 if (collNewsSubscriptions == null) 2840 { 2841 collNewsSubscriptions = getNewsSubscriptions(new Criteria(10), con); 2842 } 2843 return collNewsSubscriptions; 2844 } 2845 2846 2858 public List getNewsSubscriptions(Criteria criteria, Connection con) 2859 throws TorqueException 2860 { 2861 if (collNewsSubscriptions == null) 2862 { 2863 if (isNew()) 2864 { 2865 collNewsSubscriptions = new ArrayList (); 2866 } 2867 else 2868 { 2869 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2870 collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria, con); 2871 } 2872 } 2873 else 2874 { 2875 if (!isNew()) 2877 { 2878 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2882 if (!lastNewsSubscriptionsCriteria.equals(criteria)) 2883 { 2884 collNewsSubscriptions = NewsSubscriptionPeer.doSelect(criteria, con); 2885 } 2886 } 2887 } 2888 lastNewsSubscriptionsCriteria = criteria; 2889 2890 return collNewsSubscriptions; 2891 } 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2914 protected List getNewsSubscriptionsJoinProject(Criteria criteria) 2915 throws TorqueException 2916 { 2917 if (collNewsSubscriptions == null) 2918 { 2919 if (isNew()) 2920 { 2921 collNewsSubscriptions = new ArrayList (); 2922 } 2923 else 2924 { 2925 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2926 collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProject(criteria); 2927 } 2928 } 2929 else 2930 { 2931 2935 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2936 if (!lastNewsSubscriptionsCriteria.equals(criteria)) 2937 { 2938 collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProject(criteria); 2939 } 2940 } 2941 lastNewsSubscriptionsCriteria = criteria; 2942 2943 return collNewsSubscriptions; 2944 } 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2965 protected List getNewsSubscriptionsJoinProduct(Criteria criteria) 2966 throws TorqueException 2967 { 2968 if (collNewsSubscriptions == null) 2969 { 2970 if (isNew()) 2971 { 2972 collNewsSubscriptions = new ArrayList (); 2973 } 2974 else 2975 { 2976 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2977 collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProduct(criteria); 2978 } 2979 } 2980 else 2981 { 2982 2986 criteria.add(NewsSubscriptionPeer.PRODUCT_ID, getProductId()); 2987 if (!lastNewsSubscriptionsCriteria.equals(criteria)) 2988 { 2989 collNewsSubscriptions = NewsSubscriptionPeer.doSelectJoinProduct(criteria); 2990 } 2991 } 2992 lastNewsSubscriptionsCriteria = criteria; 2993 2994 return collNewsSubscriptions; 2995 } 2996 2997 2998 2999 3000 3001 3004 protected List collNewslettersRelatedByProductId; 3005 3006 3011 protected void initNewslettersRelatedByProductId() 3012 { 3013 if (collNewslettersRelatedByProductId == null) 3014 { 3015 collNewslettersRelatedByProductId = new ArrayList (); 3016 } 3017 } 3018 3019 3026 public void addNewsletterRelatedByProductId(Newsletter l) throws TorqueException 3027 { 3028 getNewslettersRelatedByProductId().add(l); 3029 l.setProductRelatedByProductId((Product) this); 3030 } 3031 3032 3035 private Criteria lastNewslettersRelatedByProductIdCriteria = null; 3036 3037 3044 public List getNewslettersRelatedByProductId() throws TorqueException 3045 { 3046 if (collNewslettersRelatedByProductId == null) 3047 { 3048 collNewslettersRelatedByProductId = getNewslettersRelatedByProductId(new Criteria(10)); 3049 } 3050 return collNewslettersRelatedByProductId; 3051 } 3052 3053 3064 public List getNewslettersRelatedByProductId(Criteria criteria) throws TorqueException 3065 { 3066 if (collNewslettersRelatedByProductId == null) 3067 { 3068 if (isNew()) 3069 { 3070 collNewslettersRelatedByProductId = new ArrayList (); 3071 } 3072 else 3073 { 3074 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId() ); 3075 collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria); 3076 } 3077 } 3078 else 3079 { 3080 if (!isNew()) 3082 { 3083 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3087 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3088 { 3089 collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria); 3090 } 3091 } 3092 } 3093 lastNewslettersRelatedByProductIdCriteria = criteria; 3094 3095 return collNewslettersRelatedByProductId; 3096 } 3097 3098 3106 public List getNewslettersRelatedByProductId(Connection con) throws TorqueException 3107 { 3108 if (collNewslettersRelatedByProductId == null) 3109 { 3110 collNewslettersRelatedByProductId = getNewslettersRelatedByProductId(new Criteria(10), con); 3111 } 3112 return collNewslettersRelatedByProductId; 3113 } 3114 3115 3127 public List getNewslettersRelatedByProductId(Criteria criteria, Connection con) 3128 throws TorqueException 3129 { 3130 if (collNewslettersRelatedByProductId == null) 3131 { 3132 if (isNew()) 3133 { 3134 collNewslettersRelatedByProductId = new ArrayList (); 3135 } 3136 else 3137 { 3138 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3139 collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria, con); 3140 } 3141 } 3142 else 3143 { 3144 if (!isNew()) 3146 { 3147 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3151 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3152 { 3153 collNewslettersRelatedByProductId = NewsletterPeer.doSelect(criteria, con); 3154 } 3155 } 3156 } 3157 lastNewslettersRelatedByProductIdCriteria = criteria; 3158 3159 return collNewslettersRelatedByProductId; 3160 } 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3183 protected List getNewslettersRelatedByProductIdJoinCustomerCategory(Criteria criteria) 3184 throws TorqueException 3185 { 3186 if (collNewslettersRelatedByProductId == null) 3187 { 3188 if (isNew()) 3189 { 3190 collNewslettersRelatedByProductId = new ArrayList (); 3191 } 3192 else 3193 { 3194 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3195 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 3196 } 3197 } 3198 else 3199 { 3200 3204 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3205 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3206 { 3207 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 3208 } 3209 } 3210 lastNewslettersRelatedByProductIdCriteria = criteria; 3211 3212 return collNewslettersRelatedByProductId; 3213 } 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3234 protected List getNewslettersRelatedByProductIdJoinProjectRelatedByProjectId(Criteria criteria) 3235 throws TorqueException 3236 { 3237 if (collNewslettersRelatedByProductId == null) 3238 { 3239 if (isNew()) 3240 { 3241 collNewslettersRelatedByProductId = new ArrayList (); 3242 } 3243 else 3244 { 3245 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3246 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 3247 } 3248 } 3249 else 3250 { 3251 3255 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3256 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3257 { 3258 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 3259 } 3260 } 3261 lastNewslettersRelatedByProductIdCriteria = criteria; 3262 3263 return collNewslettersRelatedByProductId; 3264 } 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3293 protected List getNewslettersRelatedByProductIdJoinProjectRelatedByRelProjectId(Criteria criteria) 3294 throws TorqueException 3295 { 3296 if (collNewslettersRelatedByProductId == null) 3297 { 3298 if (isNew()) 3299 { 3300 collNewslettersRelatedByProductId = new ArrayList (); 3301 } 3302 else 3303 { 3304 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3305 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 3306 } 3307 } 3308 else 3309 { 3310 3314 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3315 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3316 { 3317 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 3318 } 3319 } 3320 lastNewslettersRelatedByProductIdCriteria = criteria; 3321 3322 return collNewslettersRelatedByProductId; 3323 } 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3344 protected List getNewslettersRelatedByProductIdJoinProductRelatedByRelProductId(Criteria criteria) 3345 throws TorqueException 3346 { 3347 if (collNewslettersRelatedByProductId == null) 3348 { 3349 if (isNew()) 3350 { 3351 collNewslettersRelatedByProductId = new ArrayList (); 3352 } 3353 else 3354 { 3355 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3356 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria); 3357 } 3358 } 3359 else 3360 { 3361 3365 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3366 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3367 { 3368 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria); 3369 } 3370 } 3371 lastNewslettersRelatedByProductIdCriteria = criteria; 3372 3373 return collNewslettersRelatedByProductId; 3374 } 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3395 protected List getNewslettersRelatedByProductIdJoinCountry(Criteria criteria) 3396 throws TorqueException 3397 { 3398 if (collNewslettersRelatedByProductId == null) 3399 { 3400 if (isNew()) 3401 { 3402 collNewslettersRelatedByProductId = new ArrayList (); 3403 } 3404 else 3405 { 3406 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3407 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCountry(criteria); 3408 } 3409 } 3410 else 3411 { 3412 3416 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3417 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3418 { 3419 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinCountry(criteria); 3420 } 3421 } 3422 lastNewslettersRelatedByProductIdCriteria = criteria; 3423 3424 return collNewslettersRelatedByProductId; 3425 } 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3446 protected List getNewslettersRelatedByProductIdJoinLanguageRelatedByCustLanguageId(Criteria criteria) 3447 throws TorqueException 3448 { 3449 if (collNewslettersRelatedByProductId == null) 3450 { 3451 if (isNew()) 3452 { 3453 collNewslettersRelatedByProductId = new ArrayList (); 3454 } 3455 else 3456 { 3457 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3458 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 3459 } 3460 } 3461 else 3462 { 3463 3467 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3468 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3469 { 3470 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 3471 } 3472 } 3473 lastNewslettersRelatedByProductIdCriteria = criteria; 3474 3475 return collNewslettersRelatedByProductId; 3476 } 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3497 protected List getNewslettersRelatedByProductIdJoinLanguageRelatedByLanguageId(Criteria criteria) 3498 throws TorqueException 3499 { 3500 if (collNewslettersRelatedByProductId == null) 3501 { 3502 if (isNew()) 3503 { 3504 collNewslettersRelatedByProductId = new ArrayList (); 3505 } 3506 else 3507 { 3508 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3509 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 3510 } 3511 } 3512 else 3513 { 3514 3518 criteria.add(NewsletterPeer.PRODUCT_ID, getProductId()); 3519 if (!lastNewslettersRelatedByProductIdCriteria.equals(criteria)) 3520 { 3521 collNewslettersRelatedByProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 3522 } 3523 } 3524 lastNewslettersRelatedByProductIdCriteria = criteria; 3525 3526 return collNewslettersRelatedByProductId; 3527 } 3528 3529 3530 3531 3532 3533 3536 protected List collNewslettersRelatedByRelProductId; 3537 3538 3543 protected void initNewslettersRelatedByRelProductId() 3544 { 3545 if (collNewslettersRelatedByRelProductId == null) 3546 { 3547 collNewslettersRelatedByRelProductId = new ArrayList (); 3548 } 3549 } 3550 3551 3558 public void addNewsletterRelatedByRelProductId(Newsletter l) throws TorqueException 3559 { 3560 getNewslettersRelatedByRelProductId().add(l); 3561 l.setProductRelatedByRelProductId((Product) this); 3562 } 3563 3564 3567 private Criteria lastNewslettersRelatedByRelProductIdCriteria = null; 3568 3569 3576 public List getNewslettersRelatedByRelProductId() throws TorqueException 3577 { 3578 if (collNewslettersRelatedByRelProductId == null) 3579 { 3580 collNewslettersRelatedByRelProductId = getNewslettersRelatedByRelProductId(new Criteria(10)); 3581 } 3582 return collNewslettersRelatedByRelProductId; 3583 } 3584 3585 3596 public List getNewslettersRelatedByRelProductId(Criteria criteria) throws TorqueException 3597 { 3598 if (collNewslettersRelatedByRelProductId == null) 3599 { 3600 if (isNew()) 3601 { 3602 collNewslettersRelatedByRelProductId = new ArrayList (); 3603 } 3604 else 3605 { 3606 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId() ); 3607 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria); 3608 } 3609 } 3610 else 3611 { 3612 if (!isNew()) 3614 { 3615 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3619 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3620 { 3621 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria); 3622 } 3623 } 3624 } 3625 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3626 3627 return collNewslettersRelatedByRelProductId; 3628 } 3629 3630 3638 public List getNewslettersRelatedByRelProductId(Connection con) throws TorqueException 3639 { 3640 if (collNewslettersRelatedByRelProductId == null) 3641 { 3642 collNewslettersRelatedByRelProductId = getNewslettersRelatedByRelProductId(new Criteria(10), con); 3643 } 3644 return collNewslettersRelatedByRelProductId; 3645 } 3646 3647 3659 public List getNewslettersRelatedByRelProductId(Criteria criteria, Connection con) 3660 throws TorqueException 3661 { 3662 if (collNewslettersRelatedByRelProductId == null) 3663 { 3664 if (isNew()) 3665 { 3666 collNewslettersRelatedByRelProductId = new ArrayList (); 3667 } 3668 else 3669 { 3670 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3671 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria, con); 3672 } 3673 } 3674 else 3675 { 3676 if (!isNew()) 3678 { 3679 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3683 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3684 { 3685 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelect(criteria, con); 3686 } 3687 } 3688 } 3689 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3690 3691 return collNewslettersRelatedByRelProductId; 3692 } 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3715 protected List getNewslettersRelatedByRelProductIdJoinCustomerCategory(Criteria criteria) 3716 throws TorqueException 3717 { 3718 if (collNewslettersRelatedByRelProductId == null) 3719 { 3720 if (isNew()) 3721 { 3722 collNewslettersRelatedByRelProductId = new ArrayList (); 3723 } 3724 else 3725 { 3726 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3727 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 3728 } 3729 } 3730 else 3731 { 3732 3736 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3737 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3738 { 3739 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 3740 } 3741 } 3742 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3743 3744 return collNewslettersRelatedByRelProductId; 3745 } 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3766 protected List getNewslettersRelatedByRelProductIdJoinProjectRelatedByProjectId(Criteria criteria) 3767 throws TorqueException 3768 { 3769 if (collNewslettersRelatedByRelProductId == null) 3770 { 3771 if (isNew()) 3772 { 3773 collNewslettersRelatedByRelProductId = new ArrayList (); 3774 } 3775 else 3776 { 3777 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3778 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 3779 } 3780 } 3781 else 3782 { 3783 3787 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3788 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3789 { 3790 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 3791 } 3792 } 3793 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3794 3795 return collNewslettersRelatedByRelProductId; 3796 } 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3817 protected List getNewslettersRelatedByRelProductIdJoinProductRelatedByProductId(Criteria criteria) 3818 throws TorqueException 3819 { 3820 if (collNewslettersRelatedByRelProductId == null) 3821 { 3822 if (isNew()) 3823 { 3824 collNewslettersRelatedByRelProductId = new ArrayList (); 3825 } 3826 else 3827 { 3828 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3829 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria); 3830 } 3831 } 3832 else 3833 { 3834 3838 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3839 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3840 { 3841 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria); 3842 } 3843 } 3844 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3845 3846 return collNewslettersRelatedByRelProductId; 3847 } 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3868 protected List getNewslettersRelatedByRelProductIdJoinProjectRelatedByRelProjectId(Criteria criteria) 3869 throws TorqueException 3870 { 3871 if (collNewslettersRelatedByRelProductId == null) 3872 { 3873 if (isNew()) 3874 { 3875 collNewslettersRelatedByRelProductId = new ArrayList (); 3876 } 3877 else 3878 { 3879 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3880 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 3881 } 3882 } 3883 else 3884 { 3885 3889 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3890 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3891 { 3892 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 3893 } 3894 } 3895 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3896 3897 return collNewslettersRelatedByRelProductId; 3898 } 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3927 protected List getNewslettersRelatedByRelProductIdJoinCountry(Criteria criteria) 3928 throws TorqueException 3929 { 3930 if (collNewslettersRelatedByRelProductId == null) 3931 { 3932 if (isNew()) 3933 { 3934 collNewslettersRelatedByRelProductId = new ArrayList (); 3935 } 3936 else 3937 { 3938 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3939 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCountry(criteria); 3940 } 3941 } 3942 else 3943 { 3944 3948 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3949 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 3950 { 3951 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinCountry(criteria); 3952 } 3953 } 3954 lastNewslettersRelatedByRelProductIdCriteria = criteria; 3955 3956 return collNewslettersRelatedByRelProductId; 3957 } 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3978 protected List getNewslettersRelatedByRelProductIdJoinLanguageRelatedByCustLanguageId(Criteria criteria) 3979 throws TorqueException 3980 { 3981 if (collNewslettersRelatedByRelProductId == null) 3982 { 3983 if (isNew()) 3984 { 3985 collNewslettersRelatedByRelProductId = new ArrayList (); 3986 } 3987 else 3988 { 3989 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 3990 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 3991 } 3992 } 3993 else 3994 { 3995 3999 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 4000 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 4001 { 4002 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 4003 } 4004 } 4005 lastNewslettersRelatedByRelProductIdCriteria = criteria; 4006 4007 return collNewslettersRelatedByRelProductId; 4008 } 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4029 protected List getNewslettersRelatedByRelProductIdJoinLanguageRelatedByLanguageId(Criteria criteria) 4030 throws TorqueException 4031 { 4032 if (collNewslettersRelatedByRelProductId == null) 4033 { 4034 if (isNew()) 4035 { 4036 collNewslettersRelatedByRelProductId = new ArrayList (); 4037 } 4038 else 4039 { 4040 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 4041 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 4042 } 4043 } 4044 else 4045 { 4046 4050 criteria.add(NewsletterPeer.REL_PRODUCT_ID, getProductId()); 4051 if (!lastNewslettersRelatedByRelProductIdCriteria.equals(criteria)) 4052 { 4053 collNewslettersRelatedByRelProductId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 4054 } 4055 } 4056 lastNewslettersRelatedByRelProductIdCriteria = criteria; 4057 4058 return collNewslettersRelatedByRelProductId; 4059 } 4060 4061 4062 4063 4064 4065 4068 protected List collSorderItems; 4069 4070 4075 protected void initSorderItems() 4076 { 4077 if (collSorderItems == null) 4078 { 4079 collSorderItems = new ArrayList (); 4080 } 4081 } 4082 4083 4090 public void addSorderItem(SorderItem l) throws TorqueException 4091 { 4092 getSorderItems().add(l); 4093 l.setProduct((Product) this); 4094 } 4095 4096 4099 private Criteria lastSorderItemsCriteria = null; 4100 4101 4108 public List getSorderItems() throws TorqueException 4109 { 4110 if (collSorderItems == null) 4111 { 4112 collSorderItems = getSorderItems(new Criteria(10)); 4113 } 4114 return collSorderItems; 4115 } 4116 4117 4128 public List getSorderItems(Criteria criteria) throws TorqueException 4129 { 4130 if (collSorderItems == null) 4131 { 4132 if (isNew()) 4133 { 4134 collSorderItems = new ArrayList (); 4135 } 4136 else 4137 { 4138 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId() ); 4139 collSorderItems = SorderItemPeer.doSelect(criteria); 4140 } 4141 } 4142 else 4143 { 4144 if (!isNew()) 4146 { 4147 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4151 if (!lastSorderItemsCriteria.equals(criteria)) 4152 { 4153 collSorderItems = SorderItemPeer.doSelect(criteria); 4154 } 4155 } 4156 } 4157 lastSorderItemsCriteria = criteria; 4158 4159 return collSorderItems; 4160 } 4161 4162 4170 public List getSorderItems(Connection con) throws TorqueException 4171 { 4172 if (collSorderItems == null) 4173 { 4174 collSorderItems = getSorderItems(new Criteria(10), con); 4175 } 4176 return collSorderItems; 4177 } 4178 4179 4191 public List getSorderItems(Criteria criteria, Connection con) 4192 throws TorqueException 4193 { 4194 if (collSorderItems == null) 4195 { 4196 if (isNew()) 4197 { 4198 collSorderItems = new ArrayList (); 4199 } 4200 else 4201 { 4202 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4203 collSorderItems = SorderItemPeer.doSelect(criteria, con); 4204 } 4205 } 4206 else 4207 { 4208 if (!isNew()) 4210 { 4211 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4215 if (!lastSorderItemsCriteria.equals(criteria)) 4216 { 4217 collSorderItems = SorderItemPeer.doSelect(criteria, con); 4218 } 4219 } 4220 } 4221 lastSorderItemsCriteria = criteria; 4222 4223 return collSorderItems; 4224 } 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4247 protected List getSorderItemsJoinSorder(Criteria criteria) 4248 throws TorqueException 4249 { 4250 if (collSorderItems == null) 4251 { 4252 if (isNew()) 4253 { 4254 collSorderItems = new ArrayList (); 4255 } 4256 else 4257 { 4258 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4259 collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria); 4260 } 4261 } 4262 else 4263 { 4264 4268 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4269 if (!lastSorderItemsCriteria.equals(criteria)) 4270 { 4271 collSorderItems = SorderItemPeer.doSelectJoinSorder(criteria); 4272 } 4273 } 4274 lastSorderItemsCriteria = criteria; 4275 4276 return collSorderItems; 4277 } 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4298 protected List getSorderItemsJoinProduct(Criteria criteria) 4299 throws TorqueException 4300 { 4301 if (collSorderItems == null) 4302 { 4303 if (isNew()) 4304 { 4305 collSorderItems = new ArrayList (); 4306 } 4307 else 4308 { 4309 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4310 collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria); 4311 } 4312 } 4313 else 4314 { 4315 4319 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4320 if (!lastSorderItemsCriteria.equals(criteria)) 4321 { 4322 collSorderItems = SorderItemPeer.doSelectJoinProduct(criteria); 4323 } 4324 } 4325 lastSorderItemsCriteria = criteria; 4326 4327 return collSorderItems; 4328 } 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4349 protected List getSorderItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 4350 throws TorqueException 4351 { 4352 if (collSorderItems == null) 4353 { 4354 if (isNew()) 4355 { 4356 collSorderItems = new ArrayList (); 4357 } 4358 else 4359 { 4360 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4361 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4362 } 4363 } 4364 else 4365 { 4366 4370 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4371 if (!lastSorderItemsCriteria.equals(criteria)) 4372 { 4373 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 4374 } 4375 } 4376 lastSorderItemsCriteria = criteria; 4377 4378 return collSorderItems; 4379 } 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4400 protected List getSorderItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 4401 throws TorqueException 4402 { 4403 if (collSorderItems == null) 4404 { 4405 if (isNew()) 4406 { 4407 collSorderItems = new ArrayList (); 4408 } 4409 else 4410 { 4411 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4412 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4413 } 4414 } 4415 else 4416 { 4417 4421 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4422 if (!lastSorderItemsCriteria.equals(criteria)) 4423 { 4424 collSorderItems = SorderItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 4425 } 4426 } 4427 lastSorderItemsCriteria = criteria; 4428 4429 return collSorderItems; 4430 } 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4451 protected List getSorderItemsJoinProject(Criteria criteria) 4452 throws TorqueException 4453 { 4454 if (collSorderItems == null) 4455 { 4456 if (isNew()) 4457 { 4458 collSorderItems = new ArrayList (); 4459 } 4460 else 4461 { 4462 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4463 collSorderItems = SorderItemPeer.doSelectJoinProject(criteria); 4464 } 4465 } 4466 else 4467 { 4468 4472 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4473 if (!lastSorderItemsCriteria.equals(criteria)) 4474 { 4475 collSorderItems = SorderItemPeer.doSelectJoinProject(criteria); 4476 } 4477 } 4478 lastSorderItemsCriteria = criteria; 4479 4480 return collSorderItems; 4481 } 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4502 protected List getSorderItemsJoinCurrency(Criteria criteria) 4503 throws TorqueException 4504 { 4505 if (collSorderItems == null) 4506 { 4507 if (isNew()) 4508 { 4509 collSorderItems = new ArrayList (); 4510 } 4511 else 4512 { 4513 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4514 collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria); 4515 } 4516 } 4517 else 4518 { 4519 4523 criteria.add(SorderItemPeer.PRODUCT_ID, getProductId()); 4524 if (!lastSorderItemsCriteria.equals(criteria)) 4525 { 4526 collSorderItems = SorderItemPeer.doSelectJoinCurrency(criteria); 4527 } 4528 } 4529 lastSorderItemsCriteria = criteria; 4530 4531 return collSorderItems; 4532 } 4533 4534 4535 4536 4537 4538 4541 protected List collPaymentItems; 4542 4543 4548 protected void initPaymentItems() 4549 { 4550 if (collPaymentItems == null) 4551 { 4552 collPaymentItems = new ArrayList (); 4553 } 4554 } 4555 4556 4563 public void addPaymentItem(PaymentItem l) throws TorqueException 4564 { 4565 getPaymentItems().add(l); 4566 l.setProduct((Product) this); 4567 } 4568 4569 4572 private Criteria lastPaymentItemsCriteria = null; 4573 4574 4581 public List getPaymentItems() throws TorqueException 4582 { 4583 if (collPaymentItems == null) 4584 { 4585 collPaymentItems = getPaymentItems(new Criteria(10)); 4586 } 4587 return collPaymentItems; 4588 } 4589 4590 4601 public List getPaymentItems(Criteria criteria) throws TorqueException 4602 { 4603 if (collPaymentItems == null) 4604 { 4605 if (isNew()) 4606 { 4607 collPaymentItems = new ArrayList (); 4608 } 4609 else 4610 { 4611 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId() ); 4612 collPaymentItems = PaymentItemPeer.doSelect(criteria); 4613 } 4614 } 4615 else 4616 { 4617 if (!isNew()) 4619 { 4620 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4624 if (!lastPaymentItemsCriteria.equals(criteria)) 4625 { 4626 collPaymentItems = PaymentItemPeer.doSelect(criteria); 4627 } 4628 } 4629 } 4630 lastPaymentItemsCriteria = criteria; 4631 4632 return collPaymentItems; 4633 } 4634 4635 4643 public List getPaymentItems(Connection con) throws TorqueException 4644 { 4645 if (collPaymentItems == null) 4646 { 4647 collPaymentItems = getPaymentItems(new Criteria(10), con); 4648 } 4649 return collPaymentItems; 4650 } 4651 4652 4664 public List getPaymentItems(Criteria criteria, Connection con) 4665 throws TorqueException 4666 { 4667 if (collPaymentItems == null) 4668 { 4669 if (isNew()) 4670 { 4671 collPaymentItems = new ArrayList (); 4672 } 4673 else 4674 { 4675 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4676 collPaymentItems = PaymentItemPeer.doSelect(criteria, con); 4677 } 4678 } 4679 else 4680 { 4681 if (!isNew()) 4683 { 4684 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4688 if (!lastPaymentItemsCriteria.equals(criteria)) 4689 { 4690 collPaymentItems = PaymentItemPeer.doSelect(criteria, con); 4691 } 4692 } 4693 } 4694 lastPaymentItemsCriteria = criteria; 4695 4696 return collPaymentItems; 4697 } 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4720 protected List getPaymentItemsJoinPayment(Criteria criteria) 4721 throws TorqueException 4722 { 4723 if (collPaymentItems == null) 4724 { 4725 if (isNew()) 4726 { 4727 collPaymentItems = new ArrayList (); 4728 } 4729 else 4730 { 4731 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4732 collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria); 4733 } 4734 } 4735 else 4736 { 4737 4741 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4742 if (!lastPaymentItemsCriteria.equals(criteria)) 4743 { 4744 collPaymentItems = PaymentItemPeer.doSelectJoinPayment(criteria); 4745 } 4746 } 4747 lastPaymentItemsCriteria = criteria; 4748 4749 return collPaymentItems; 4750 } 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4771 protected List getPaymentItemsJoinSorder(Criteria criteria) 4772 throws TorqueException 4773 { 4774 if (collPaymentItems == null) 4775 { 4776 if (isNew()) 4777 { 4778 collPaymentItems = new ArrayList (); 4779 } 4780 else 4781 { 4782 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4783 collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria); 4784 } 4785 } 4786 else 4787 { 4788 4792 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4793 if (!lastPaymentItemsCriteria.equals(criteria)) 4794 { 4795 collPaymentItems = PaymentItemPeer.doSelectJoinSorder(criteria); 4796 } 4797 } 4798 lastPaymentItemsCriteria = criteria; 4799 4800 return collPaymentItems; 4801 } 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4822 protected List getPaymentItemsJoinProduct(Criteria criteria) 4823 throws TorqueException 4824 { 4825 if (collPaymentItems == null) 4826 { 4827 if (isNew()) 4828 { 4829 collPaymentItems = new ArrayList (); 4830 } 4831 else 4832 { 4833 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4834 collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria); 4835 } 4836 } 4837 else 4838 { 4839 4843 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4844 if (!lastPaymentItemsCriteria.equals(criteria)) 4845 { 4846 collPaymentItems = PaymentItemPeer.doSelectJoinProduct(criteria); 4847 } 4848 } 4849 lastPaymentItemsCriteria = criteria; 4850 4851 return collPaymentItems; 4852 } 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4873 protected List getPaymentItemsJoinCurrency(Criteria criteria) 4874 throws TorqueException 4875 { 4876 if (collPaymentItems == null) 4877 { 4878 if (isNew()) 4879 { 4880 collPaymentItems = new ArrayList (); 4881 } 4882 else 4883 { 4884 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4885 collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria); 4886 } 4887 } 4888 else 4889 { 4890 4894 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4895 if (!lastPaymentItemsCriteria.equals(criteria)) 4896 { 4897 collPaymentItems = PaymentItemPeer.doSelectJoinCurrency(criteria); 4898 } 4899 } 4900 lastPaymentItemsCriteria = criteria; 4901 4902 return collPaymentItems; 4903 } 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4924 protected List getPaymentItemsJoinCustomer(Criteria criteria) 4925 throws TorqueException 4926 { 4927 if (collPaymentItems == null) 4928 { 4929 if (isNew()) 4930 { 4931 collPaymentItems = new ArrayList (); 4932 } 4933 else 4934 { 4935 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4936 collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria); 4937 } 4938 } 4939 else 4940 { 4941 4945 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4946 if (!lastPaymentItemsCriteria.equals(criteria)) 4947 { 4948 collPaymentItems = PaymentItemPeer.doSelectJoinCustomer(criteria); 4949 } 4950 } 4951 lastPaymentItemsCriteria = criteria; 4952 4953 return collPaymentItems; 4954 } 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4975 protected List getPaymentItemsJoinProject(Criteria criteria) 4976 throws TorqueException 4977 { 4978 if (collPaymentItems == null) 4979 { 4980 if (isNew()) 4981 { 4982 collPaymentItems = new ArrayList (); 4983 } 4984 else 4985 { 4986 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4987 collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria); 4988 } 4989 } 4990 else 4991 { 4992 4996 criteria.add(PaymentItemPeer.PRODUCT_ID, getProductId()); 4997 if (!lastPaymentItemsCriteria.equals(criteria)) 4998 { 4999 collPaymentItems = PaymentItemPeer.doSelectJoinProject(criteria); 5000 } 5001 } 5002 lastPaymentItemsCriteria = criteria; 5003 5004 return collPaymentItems; 5005 } 5006 5007 5008 5009 5010 5011 5014 protected List collShipmentItems; 5015 5016 5021 protected void initShipmentItems() 5022 { 5023 if (collShipmentItems == null) 5024 { 5025 collShipmentItems = new ArrayList (); 5026 } 5027 } 5028 5029 5036 public void addShipmentItem(ShipmentItem l) throws TorqueException 5037 { 5038 getShipmentItems().add(l); 5039 l.setProduct((Product) this); 5040 } 5041 5042 5045 private Criteria lastShipmentItemsCriteria = null; 5046 5047 5054 public List getShipmentItems() throws TorqueException 5055 { 5056 if (collShipmentItems == null) 5057 { 5058 collShipmentItems = getShipmentItems(new Criteria(10)); 5059 } 5060 return collShipmentItems; 5061 } 5062 5063 5074 public List getShipmentItems(Criteria criteria) throws TorqueException 5075 { 5076 if (collShipmentItems == null) 5077 { 5078 if (isNew()) 5079 { 5080 collShipmentItems = new ArrayList (); 5081 } 5082 else 5083 { 5084 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId() ); 5085 collShipmentItems = ShipmentItemPeer.doSelect(criteria); 5086 } 5087 } 5088 else 5089 { 5090 if (!isNew()) 5092 { 5093 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5097 if (!lastShipmentItemsCriteria.equals(criteria)) 5098 { 5099 collShipmentItems = ShipmentItemPeer.doSelect(criteria); 5100 } 5101 } 5102 } 5103 lastShipmentItemsCriteria = criteria; 5104 5105 return collShipmentItems; 5106 } 5107 5108 5116 public List getShipmentItems(Connection con) throws TorqueException 5117 { 5118 if (collShipmentItems == null) 5119 { 5120 collShipmentItems = getShipmentItems(new Criteria(10), con); 5121 } 5122 return collShipmentItems; 5123 } 5124 5125 5137 public List getShipmentItems(Criteria criteria, Connection con) 5138 throws TorqueException 5139 { 5140 if (collShipmentItems == null) 5141 { 5142 if (isNew()) 5143 { 5144 collShipmentItems = new ArrayList (); 5145 } 5146 else 5147 { 5148 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5149 collShipmentItems = ShipmentItemPeer.doSelect(criteria, con); 5150 } 5151 } 5152 else 5153 { 5154 if (!isNew()) 5156 { 5157 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5161 if (!lastShipmentItemsCriteria.equals(criteria)) 5162 { 5163 collShipmentItems = ShipmentItemPeer.doSelect(criteria, con); 5164 } 5165 } 5166 } 5167 lastShipmentItemsCriteria = criteria; 5168 5169 return collShipmentItems; 5170 } 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5193 protected List getShipmentItemsJoinShipment(Criteria criteria) 5194 throws TorqueException 5195 { 5196 if (collShipmentItems == null) 5197 { 5198 if (isNew()) 5199 { 5200 collShipmentItems = new ArrayList (); 5201 } 5202 else 5203 { 5204 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5205 collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria); 5206 } 5207 } 5208 else 5209 { 5210 5214 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5215 if (!lastShipmentItemsCriteria.equals(criteria)) 5216 { 5217 collShipmentItems = ShipmentItemPeer.doSelectJoinShipment(criteria); 5218 } 5219 } 5220 lastShipmentItemsCriteria = criteria; 5221 5222 return collShipmentItems; 5223 } 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5244 protected List getShipmentItemsJoinSorder(Criteria criteria) 5245 throws TorqueException 5246 { 5247 if (collShipmentItems == null) 5248 { 5249 if (isNew()) 5250 { 5251 collShipmentItems = new ArrayList (); 5252 } 5253 else 5254 { 5255 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5256 collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria); 5257 } 5258 } 5259 else 5260 { 5261 5265 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5266 if (!lastShipmentItemsCriteria.equals(criteria)) 5267 { 5268 collShipmentItems = ShipmentItemPeer.doSelectJoinSorder(criteria); 5269 } 5270 } 5271 lastShipmentItemsCriteria = criteria; 5272 5273 return collShipmentItems; 5274 } 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5295 protected List getShipmentItemsJoinProduct(Criteria criteria) 5296 throws TorqueException 5297 { 5298 if (collShipmentItems == null) 5299 { 5300 if (isNew()) 5301 { 5302 collShipmentItems = new ArrayList (); 5303 } 5304 else 5305 { 5306 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5307 collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria); 5308 } 5309 } 5310 else 5311 { 5312 5316 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5317 if (!lastShipmentItemsCriteria.equals(criteria)) 5318 { 5319 collShipmentItems = ShipmentItemPeer.doSelectJoinProduct(criteria); 5320 } 5321 } 5322 lastShipmentItemsCriteria = criteria; 5323 5324 return collShipmentItems; 5325 } 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5346 protected List getShipmentItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 5347 throws TorqueException 5348 { 5349 if (collShipmentItems == null) 5350 { 5351 if (isNew()) 5352 { 5353 collShipmentItems = new ArrayList (); 5354 } 5355 else 5356 { 5357 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5358 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 5359 } 5360 } 5361 else 5362 { 5363 5367 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5368 if (!lastShipmentItemsCriteria.equals(criteria)) 5369 { 5370 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 5371 } 5372 } 5373 lastShipmentItemsCriteria = criteria; 5374 5375 return collShipmentItems; 5376 } 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5397 protected List getShipmentItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 5398 throws TorqueException 5399 { 5400 if (collShipmentItems == null) 5401 { 5402 if (isNew()) 5403 { 5404 collShipmentItems = new ArrayList (); 5405 } 5406 else 5407 { 5408 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5409 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 5410 } 5411 } 5412 else 5413 { 5414 5418 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5419 if (!lastShipmentItemsCriteria.equals(criteria)) 5420 { 5421 collShipmentItems = ShipmentItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 5422 } 5423 } 5424 lastShipmentItemsCriteria = criteria; 5425 5426 return collShipmentItems; 5427 } 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5448 protected List getShipmentItemsJoinProject(Criteria criteria) 5449 throws TorqueException 5450 { 5451 if (collShipmentItems == null) 5452 { 5453 if (isNew()) 5454 { 5455 collShipmentItems = new ArrayList (); 5456 } 5457 else 5458 { 5459 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5460 collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria); 5461 } 5462 } 5463 else 5464 { 5465 5469 criteria.add(ShipmentItemPeer.PRODUCT_ID, getProductId()); 5470 if (!lastShipmentItemsCriteria.equals(criteria)) 5471 { 5472 collShipmentItems = ShipmentItemPeer.doSelectJoinProject(criteria); 5473 } 5474 } 5475 lastShipmentItemsCriteria = criteria; 5476 5477 return collShipmentItems; 5478 } 5479 5480 5481 5482 5483 5484 5487 protected List collServiceItems; 5488 5489 5494 protected void initServiceItems() 5495 { 5496 if (collServiceItems == null) 5497 { 5498 collServiceItems = new ArrayList (); 5499 } 5500 } 5501 5502 5509 public void addServiceItem(ServiceItem l) throws TorqueException 5510 { 5511 getServiceItems().add(l); 5512 l.setProduct((Product) this); 5513 } 5514 5515 5518 private Criteria lastServiceItemsCriteria = null; 5519 5520 5527 public List getServiceItems() throws TorqueException 5528 { 5529 if (collServiceItems == null) 5530 { 5531 collServiceItems = getServiceItems(new Criteria(10)); 5532 } 5533 return collServiceItems; 5534 } 5535 5536 5547 public List getServiceItems(Criteria criteria) throws TorqueException 5548 { 5549 if (collServiceItems == null) 5550 { 5551 if (isNew()) 5552 { 5553 collServiceItems = new ArrayList (); 5554 } 5555 else 5556 { 5557 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId() ); 5558 collServiceItems = ServiceItemPeer.doSelect(criteria); 5559 } 5560 } 5561 else 5562 { 5563 if (!isNew()) 5565 { 5566 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5570 if (!lastServiceItemsCriteria.equals(criteria)) 5571 { 5572 collServiceItems = ServiceItemPeer.doSelect(criteria); 5573 } 5574 } 5575 } 5576 lastServiceItemsCriteria = criteria; 5577 5578 return collServiceItems; 5579 } 5580 5581 5589 public List getServiceItems(Connection con) throws TorqueException 5590 { 5591 if (collServiceItems == null) 5592 { 5593 collServiceItems = getServiceItems(new Criteria(10), con); 5594 } 5595 return collServiceItems; 5596 } 5597 5598 5610 public List getServiceItems(Criteria criteria, Connection con) 5611 throws TorqueException 5612 { 5613 if (collServiceItems == null) 5614 { 5615 if (isNew()) 5616 { 5617 collServiceItems = new ArrayList (); 5618 } 5619 else 5620 { 5621 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5622 collServiceItems = ServiceItemPeer.doSelect(criteria, con); 5623 } 5624 } 5625 else 5626 { 5627 if (!isNew()) 5629 { 5630 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5634 if (!lastServiceItemsCriteria.equals(criteria)) 5635 { 5636 collServiceItems = ServiceItemPeer.doSelect(criteria, con); 5637 } 5638 } 5639 } 5640 lastServiceItemsCriteria = criteria; 5641 5642 return collServiceItems; 5643 } 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5666 protected List getServiceItemsJoinService(Criteria criteria) 5667 throws TorqueException 5668 { 5669 if (collServiceItems == null) 5670 { 5671 if (isNew()) 5672 { 5673 collServiceItems = new ArrayList (); 5674 } 5675 else 5676 { 5677 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5678 collServiceItems = ServiceItemPeer.doSelectJoinService(criteria); 5679 } 5680 } 5681 else 5682 { 5683 5687 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5688 if (!lastServiceItemsCriteria.equals(criteria)) 5689 { 5690 collServiceItems = ServiceItemPeer.doSelectJoinService(criteria); 5691 } 5692 } 5693 lastServiceItemsCriteria = criteria; 5694 5695 return collServiceItems; 5696 } 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5717 protected List getServiceItemsJoinSorder(Criteria criteria) 5718 throws TorqueException 5719 { 5720 if (collServiceItems == null) 5721 { 5722 if (isNew()) 5723 { 5724 collServiceItems = new ArrayList (); 5725 } 5726 else 5727 { 5728 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5729 collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria); 5730 } 5731 } 5732 else 5733 { 5734 5738 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5739 if (!lastServiceItemsCriteria.equals(criteria)) 5740 { 5741 collServiceItems = ServiceItemPeer.doSelectJoinSorder(criteria); 5742 } 5743 } 5744 lastServiceItemsCriteria = criteria; 5745 5746 return collServiceItems; 5747 } 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5768 protected List getServiceItemsJoinProduct(Criteria criteria) 5769 throws TorqueException 5770 { 5771 if (collServiceItems == null) 5772 { 5773 if (isNew()) 5774 { 5775 collServiceItems = new ArrayList (); 5776 } 5777 else 5778 { 5779 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5780 collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria); 5781 } 5782 } 5783 else 5784 { 5785 5789 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5790 if (!lastServiceItemsCriteria.equals(criteria)) 5791 { 5792 collServiceItems = ServiceItemPeer.doSelectJoinProduct(criteria); 5793 } 5794 } 5795 lastServiceItemsCriteria = criteria; 5796 5797 return collServiceItems; 5798 } 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5819 protected List getServiceItemsJoinCustomerRelatedByCustomerId(Criteria criteria) 5820 throws TorqueException 5821 { 5822 if (collServiceItems == null) 5823 { 5824 if (isNew()) 5825 { 5826 collServiceItems = new ArrayList (); 5827 } 5828 else 5829 { 5830 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5831 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 5832 } 5833 } 5834 else 5835 { 5836 5840 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5841 if (!lastServiceItemsCriteria.equals(criteria)) 5842 { 5843 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByCustomerId(criteria); 5844 } 5845 } 5846 lastServiceItemsCriteria = criteria; 5847 5848 return collServiceItems; 5849 } 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5870 protected List getServiceItemsJoinCustomerRelatedByRecipientId(Criteria criteria) 5871 throws TorqueException 5872 { 5873 if (collServiceItems == null) 5874 { 5875 if (isNew()) 5876 { 5877 collServiceItems = new ArrayList (); 5878 } 5879 else 5880 { 5881 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5882 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 5883 } 5884 } 5885 else 5886 { 5887 5891 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5892 if (!lastServiceItemsCriteria.equals(criteria)) 5893 { 5894 collServiceItems = ServiceItemPeer.doSelectJoinCustomerRelatedByRecipientId(criteria); 5895 } 5896 } 5897 lastServiceItemsCriteria = criteria; 5898 5899 return collServiceItems; 5900 } 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5921 protected List getServiceItemsJoinProject(Criteria criteria) 5922 throws TorqueException 5923 { 5924 if (collServiceItems == null) 5925 { 5926 if (isNew()) 5927 { 5928 collServiceItems = new ArrayList (); 5929 } 5930 else 5931 { 5932 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5933 collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria); 5934 } 5935 } 5936 else 5937 { 5938 5942 criteria.add(ServiceItemPeer.PRODUCT_ID, getProductId()); 5943 if (!lastServiceItemsCriteria.equals(criteria)) 5944 { 5945 collServiceItems = ServiceItemPeer.doSelectJoinProject(criteria); 5946 } 5947 } 5948 lastServiceItemsCriteria = criteria; 5949 5950 return collServiceItems; 5951 } 5952 5953 5954 5955 5956 private static List fieldNames = null; 5957 5958 5963 public static synchronized List getFieldNames() 5964 { 5965 if (fieldNames == null) 5966 { 5967 fieldNames = new ArrayList (); 5968 fieldNames.add("ProductId"); 5969 fieldNames.add("ProductCode"); 5970 fieldNames.add("Status"); 5971 fieldNames.add("Priority"); 5972 fieldNames.add("ProductType"); 5973 fieldNames.add("ProductCatId"); 5974 fieldNames.add("ProductDescription"); 5975 fieldNames.add("ProductDisplay"); 5976 fieldNames.add("BasePrice"); 5977 fieldNames.add("UomId"); 5978 fieldNames.add("WebUrl"); 5979 fieldNames.add("ShowOnPricelist"); 5980 fieldNames.add("VendorId"); 5981 fieldNames.add("VendorsCode"); 5982 fieldNames.add("EanUpcCode"); 5983 fieldNames.add("Location"); 5984 fieldNames.add("Custom1"); 5985 fieldNames.add("Custom2"); 5986 fieldNames.add("Custom3"); 5987 fieldNames.add("Custom4"); 5988 fieldNames.add("Custom5"); 5989 fieldNames.add("Custom6"); 5990 fieldNames.add("Notes"); 5991 fieldNames.add("Created"); 5992 fieldNames.add("Modified"); 5993 fieldNames.add("CreatedBy"); 5994 fieldNames.add("ModifiedBy"); 5995 fieldNames = Collections.unmodifiableList(fieldNames); 5996 } 5997 return fieldNames; 5998 } 5999 6000 6006 public Object getByName(String name) 6007 { 6008 if (name.equals("ProductId")) 6009 { 6010 return new Integer (getProductId()); 6011 } 6012 if (name.equals("ProductCode")) 6013 { 6014 return getProductCode(); 6015 } 6016 if (name.equals("Status")) 6017 { 6018 return new Integer (getStatus()); 6019 } 6020 if (name.equals("Priority")) 6021 { 6022 return new Integer (getPriority()); 6023 } 6024 if (name.equals("ProductType")) 6025 { 6026 return new Integer (getProductType()); 6027 } 6028 if (name.equals("ProductCatId")) 6029 { 6030 return new Integer (getProductCatId()); 6031 } 6032 if (name.equals("ProductDescription")) 6033 { 6034 return getProductDescription(); 6035 } 6036 if (name.equals("ProductDisplay")) 6037 { 6038 return getProductDisplay(); 6039 } 6040 if (name.equals("BasePrice")) 6041 { 6042 return new Double (getBasePrice()); 6043 } 6044 if (name.equals("UomId")) 6045 { 6046 return new Integer (getUomId()); 6047 } 6048 if (name.equals("WebUrl")) 6049 { 6050 return getWebUrl(); 6051 } 6052 if (name.equals("ShowOnPricelist")) 6053 { 6054 return new Integer (getShowOnPricelist()); 6055 } 6056 if (name.equals("VendorId")) 6057 { 6058 return new Integer (getVendorId()); 6059 } 6060 if (name.equals("VendorsCode")) 6061 { 6062 return getVendorsCode(); 6063 } 6064 if (name.equals("EanUpcCode")) 6065 { 6066 return getEanUpcCode(); 6067 } 6068 if (name.equals("Location")) 6069 { 6070 return getLocation(); 6071 } 6072 if (name.equals("Custom1")) 6073 { 6074 return getCustom1(); 6075 } 6076 if (name.equals("Custom2")) 6077 { 6078 return getCustom2(); 6079 } 6080 if (name.equals("Custom3")) 6081 { 6082 return getCustom3(); 6083 } 6084 if (name.equals("Custom4")) 6085 { 6086 return getCustom4(); 6087 } 6088 if (name.equals("Custom5")) 6089 { 6090 return getCustom5(); 6091 } 6092 if (name.equals("Custom6")) 6093 { 6094 return getCustom6(); 6095 } 6096 if (name.equals("Notes")) 6097 { 6098 return getNotes(); 6099 } 6100 if (name.equals("Created")) 6101 { 6102 return getCreated(); 6103 } 6104 if (name.equals("Modified")) 6105 { 6106 return getModified(); 6107 } 6108 if (name.equals("CreatedBy")) 6109 { 6110 return getCreatedBy(); 6111 } 6112 if (name.equals("ModifiedBy")) 6113 { 6114 return getModifiedBy(); 6115 } 6116 return null; 6117 } 6118 6119 6127 public Object getByPeerName(String name) 6128 { 6129 if (name.equals(ProductPeer.PRODUCT_ID)) 6130 { 6131 return new Integer (getProductId()); 6132 } 6133 if (name.equals(ProductPeer.PRODUCT_CODE)) 6134 { 6135 return getProductCode(); 6136 } 6137 if (name.equals(ProductPeer.STATUS)) 6138 { 6139 return new Integer (getStatus()); 6140 } 6141 if (name.equals(ProductPeer.PRIORITY)) 6142 { 6143 return new Integer (getPriority()); 6144 } 6145 if (name.equals(ProductPeer.PRODUCT_TYPE)) 6146 { 6147 return new Integer (getProductType()); 6148 } 6149 if (name.equals(ProductPeer.PRODUCT_CAT_ID)) 6150 { 6151 return new Integer (getProductCatId()); 6152 } 6153 if (name.equals(ProductPeer.PRODUCT_DESCRIPTION)) 6154 { 6155 return getProductDescription(); 6156 } 6157 if (name.equals(ProductPeer.PRODUCT_DISPLAY)) 6158 { 6159 return getProductDisplay(); 6160 } 6161 if (name.equals(ProductPeer.BASE_PRICE)) 6162 { 6163 return new Double (getBasePrice()); 6164 } 6165 if (name.equals(ProductPeer.UOM_ID)) 6166 { 6167 return new Integer (getUomId()); 6168 } 6169 if (name.equals(ProductPeer.WEB_URL)) 6170 { 6171 return getWebUrl(); 6172 } 6173 if (name.equals(ProductPeer.SHOW_ON_PRICELIST)) 6174 { 6175 return new Integer (getShowOnPricelist()); 6176 } 6177 if (name.equals(ProductPeer.VENDOR_ID)) 6178 { 6179 return new Integer (getVendorId()); 6180 } 6181 if (name.equals(ProductPeer.VENDORS_CODE)) 6182 { 6183 return getVendorsCode(); 6184 } 6185 if (name.equals(ProductPeer.EAN_UPC_CODE)) 6186 { 6187 return getEanUpcCode(); 6188 } 6189 if (name.equals(ProductPeer.LOCATION)) 6190 { 6191 return getLocation(); 6192 } 6193 if (name.equals(ProductPeer.CUSTOM_1)) 6194 { 6195 return getCustom1(); 6196 } 6197 if (name.equals(ProductPeer.CUSTOM_2)) 6198 { 6199 return getCustom2(); 6200 } 6201 if (name.equals(ProductPeer.CUSTOM_3)) 6202 { 6203 return getCustom3(); 6204 } 6205 if (name.equals(ProductPeer.CUSTOM_4)) 6206 { 6207 return getCustom4(); 6208 } 6209 if (name.equals(ProductPeer.CUSTOM_5)) 6210 { 6211 return getCustom5(); 6212 } 6213 if (name.equals(ProductPeer.CUSTOM_6)) 6214 { 6215 return getCustom6(); 6216 } 6217 if (name.equals(ProductPeer.NOTES)) 6218 { 6219 return getNotes(); 6220 } 6221 if (name.equals(ProductPeer.CREATED)) 6222 { 6223 return getCreated(); 6224 } 6225 if (name.equals(ProductPeer.MODIFIED)) 6226 { 6227 return getModified(); 6228 } 6229 if (name.equals(ProductPeer.CREATED_BY)) 6230 { 6231 return getCreatedBy(); 6232 } 6233 if (name.equals(ProductPeer.MODIFIED_BY)) 6234 { 6235 return getModifiedBy(); 6236 } 6237 return null; 6238 } 6239 6240 6247 public Object getByPosition(int pos) 6248 { 6249 if (pos == 0) 6250 { 6251 return new Integer (getProductId()); 6252 } 6253 if (pos == 1) 6254 { 6255 return getProductCode(); 6256 } 6257 if (pos == 2) 6258 { 6259 return new Integer (getStatus()); 6260 } 6261 if (pos == 3) 6262 { 6263 return new Integer (getPriority()); 6264 } 6265 if (pos == 4) 6266 { 6267 return new Integer (getProductType()); 6268 } 6269 if (pos == 5) 6270 { 6271 return new Integer (getProductCatId()); 6272 } 6273 if (pos == 6) 6274 { 6275 return getProductDescription(); 6276 } 6277 if (pos == 7) 6278 { 6279 return getProductDisplay(); 6280 } 6281 if (pos == 8) 6282 { 6283 return new Double (getBasePrice()); 6284 } 6285 if (pos == 9) 6286 { 6287 return new Integer (getUomId()); 6288 } 6289 if (pos == 10) 6290 { 6291 return getWebUrl(); 6292 } 6293 if (pos == 11) 6294 { 6295 return new Integer (getShowOnPricelist()); 6296 } 6297 if (pos == 12) 6298 { 6299 return new Integer (getVendorId()); 6300 } 6301 if (pos == 13) 6302 { 6303 return getVendorsCode(); 6304 } 6305 if (pos == 14) 6306 { 6307 return getEanUpcCode(); 6308 } 6309 if (pos == 15) 6310 { 6311 return getLocation(); 6312 } 6313 if (pos == 16) 6314 { 6315 return getCustom1(); 6316 } 6317 if (pos == 17) 6318 { 6319 return getCustom2(); 6320 } 6321 if (pos == 18) 6322 { 6323 return getCustom3(); 6324 } 6325 if (pos == 19) 6326 { 6327 return getCustom4(); 6328 } 6329 if (pos == 20) 6330 { 6331 return getCustom5(); 6332 } 6333 if (pos == 21) 6334 { 6335 return getCustom6(); 6336 } 6337 if (pos == 22) 6338 { 6339 return getNotes(); 6340 } 6341 if (pos == 23) 6342 { 6343 return getCreated(); 6344 } 6345 if (pos == 24) 6346 { 6347 return getModified(); 6348 } 6349 if (pos == 25) 6350 { 6351 return getCreatedBy(); 6352 } 6353 if (pos == 26) 6354 { 6355 return getModifiedBy(); 6356 } 6357 return null; 6358 } 6359 6360 6366 public void save() throws Exception 6367 { 6368 save(ProductPeer.getMapBuilder() 6369 .getDatabaseMap().getName()); 6370 } 6371 6372 6382 public void save(String dbName) throws TorqueException 6383 { 6384 Connection con = null; 6385 try 6386 { 6387 con = Transaction.begin(dbName); 6388 save(con); 6389 Transaction.commit(con); 6390 } 6391 catch(TorqueException e) 6392 { 6393 Transaction.safeRollback(con); 6394 throw e; 6395 } 6396 } 6397 6398 6400 private boolean alreadyInSave = false; 6401 6411 public void save(Connection con) throws TorqueException 6412 { 6413 if (!alreadyInSave) 6414 { 6415 alreadyInSave = true; 6416 6417 6418 6419 if (isModified()) 6421 { 6422 if (isNew()) 6423 { 6424 ProductPeer.doInsert((Product) this, con); 6425 setNew(false); 6426 } 6427 else 6428 { 6429 ProductPeer.doUpdate((Product) this, con); 6430 } 6431 } 6432 6433 6434 6435 if (collPrintSubscriptions != null) 6436 { 6437 for (int i = 0; i < collPrintSubscriptions.size(); i++) 6438 { 6439 ((PrintSubscription) collPrintSubscriptions.get(i)).save(con); 6440 } 6441 } 6442 6443 6444 if (collOnlineSubscriptions != null) 6445 { 6446 for (int i = 0; i < collOnlineSubscriptions.size(); i++) 6447 { 6448 ((OnlineSubscription) collOnlineSubscriptions.get(i)).save(con); 6449 } 6450 } 6451 6452 6453 if (collInboxEvents != null) 6454 { 6455 for (int i = 0; i < collInboxEvents.size(); i++) 6456 { 6457 ((InboxEvent) collInboxEvents.get(i)).save(con); 6458 } 6459 } 6460 6461 6462 if (collOutboxEvents != null) 6463 { 6464 for (int i = 0; i < collOutboxEvents.size(); i++) 6465 { 6466 ((OutboxEvent) collOutboxEvents.get(i)).save(con); 6467 } 6468 } 6469 6470 6471 if (collNewsSubscriptions != null) 6472 { 6473 for (int i = 0; i < collNewsSubscriptions.size(); i++) 6474 { 6475 ((NewsSubscription) collNewsSubscriptions.get(i)).save(con); 6476 } 6477 } 6478 6479 6480 if (collNewslettersRelatedByProductId != null) 6481 { 6482 for (int i = 0; i < collNewslettersRelatedByProductId.size(); i++) 6483 { 6484 ((Newsletter) collNewslettersRelatedByProductId.get(i)).save(con); 6485 } 6486 } 6487 6488 6489 if (collNewslettersRelatedByRelProductId != null) 6490 { 6491 for (int i = 0; i < collNewslettersRelatedByRelProductId.size(); i++) 6492 { 6493 ((Newsletter) collNewslettersRelatedByRelProductId.get(i)).save(con); 6494 } 6495 } 6496 6497 6498 if (collSorderItems != null) 6499 { 6500 for (int i = 0; i < collSorderItems.size(); i++) 6501 { 6502 ((SorderItem) collSorderItems.get(i)).save(con); 6503 } 6504 } 6505 6506 6507 if (collPaymentItems != null) 6508 { 6509 for (int i = 0; i < collPaymentItems.size(); i++) 6510 { 6511 ((PaymentItem) collPaymentItems.get(i)).save(con); 6512 } 6513 } 6514 6515 6516 if (collShipmentItems != null) 6517 { 6518 for (int i = 0; i < collShipmentItems.size(); i++) 6519 { 6520 ((ShipmentItem) collShipmentItems.get(i)).save(con); 6521 } 6522 } 6523 6524 6525 if (collServiceItems != null) 6526 { 6527 for (int i = 0; i < collServiceItems.size(); i++) 6528 { 6529 ((ServiceItem) collServiceItems.get(i)).save(con); 6530 } 6531 } 6532 alreadyInSave = false; 6533 } 6534 } 6535 6536 6537 6542 public void setPrimaryKey(ObjectKey key) 6543 throws TorqueException 6544 { 6545 setProductId(((NumberKey) key).intValue()); 6546 } 6547 6548 6553 public void setPrimaryKey(String key) throws TorqueException 6554 { 6555 setProductId(Integer.parseInt(key)); 6556 } 6557 6558 6559 6563 public ObjectKey getPrimaryKey() 6564 { 6565 return SimpleKey.keyFor(getProductId()); 6566 } 6567 6568 6572 public String getQueryKey() 6573 { 6574 if (getPrimaryKey() == null) 6575 { 6576 return ""; 6577 } 6578 else 6579 { 6580 return getPrimaryKey().toString(); 6581 } 6582 } 6583 6584 6588 public void setQueryKey(String key) 6589 throws TorqueException 6590 { 6591 setPrimaryKey(key); 6592 } 6593 6594 6600 public Product copy() throws TorqueException 6601 { 6602 return copyInto(new Product()); 6603 } 6604 6605 protected Product copyInto(Product copyObj) throws TorqueException 6606 { 6607 copyObj.setProductId(productId); 6608 copyObj.setProductCode(productCode); 6609 copyObj.setStatus(status); 6610 copyObj.setPriority(priority); 6611 copyObj.setProductType(productType); 6612 copyObj.setProductCatId(productCatId); 6613 copyObj.setProductDescription(productDescription); 6614 copyObj.setProductDisplay(productDisplay); 6615 copyObj.setBasePrice(basePrice); 6616 copyObj.setUomId(uomId); 6617 copyObj.setWebUrl(webUrl); 6618 copyObj.setShowOnPricelist(showOnPricelist); 6619 copyObj.setVendorId(vendorId); 6620 copyObj.setVendorsCode(vendorsCode); 6621 copyObj.setEanUpcCode(eanUpcCode); 6622 copyObj.setLocation(location); 6623 copyObj.setCustom1(custom1); 6624 copyObj.setCustom2(custom2); 6625 copyObj.setCustom3(custom3); 6626 copyObj.setCustom4(custom4); 6627 copyObj.setCustom5(custom5); 6628 copyObj.setCustom6(custom6); 6629 copyObj.setNotes(notes); 6630 copyObj.setCreated(created); 6631 copyObj.setModified(modified); 6632 copyObj.setCreatedBy(createdBy); 6633 copyObj.setModifiedBy(modifiedBy); 6634 6635 copyObj.setProductId( 0); 6636 6637 6638 6639 List v = getPrintSubscriptions(); 6640 for (int i = 0; i < v.size(); i++) 6641 { 6642 PrintSubscription obj = (PrintSubscription) v.get(i); 6643 copyObj.addPrintSubscription(obj.copy()); 6644 } 6645 6646 6647 v = getOnlineSubscriptions(); 6648 for (int i = 0; i < v.size(); i++) 6649 { 6650 OnlineSubscription obj = (OnlineSubscription) v.get(i); 6651 copyObj.addOnlineSubscription(obj.copy()); 6652 } 6653 6654 6655 v = getInboxEvents(); 6656 for (int i = 0; i < v.size(); i++) 6657 { 6658 InboxEvent obj = (InboxEvent) v.get(i); 6659 copyObj.addInboxEvent(obj.copy()); 6660 } 6661 6662 6663 v = getOutboxEvents(); 6664 for (int i = 0; i < v.size(); i++) 6665 { 6666 OutboxEvent obj = (OutboxEvent) v.get(i); 6667 copyObj.addOutboxEvent(obj.copy()); 6668 } 6669 6670 6671 v = getNewsSubscriptions(); 6672 for (int i = 0; i < v.size(); i++) 6673 { 6674 NewsSubscription obj = (NewsSubscription) v.get(i); 6675 copyObj.addNewsSubscription(obj.copy()); 6676 } 6677 6678 6679 v = getNewslettersRelatedByProductId(); 6680 for (int i = 0; i < v.size(); i++) 6681 { 6682 Newsletter obj = (Newsletter) v.get(i); 6683 copyObj.addNewsletterRelatedByProductId(obj.copy()); 6684 } 6685 6686 6687 v = getNewslettersRelatedByRelProductId(); 6688 for (int i = 0; i < v.size(); i++) 6689 { 6690 Newsletter obj = (Newsletter) v.get(i); 6691 copyObj.addNewsletterRelatedByRelProductId(obj.copy()); 6692 } 6693 6694 6695 v = getSorderItems(); 6696 for (int i = 0; i < v.size(); i++) 6697 { 6698 SorderItem obj = (SorderItem) v.get(i); 6699 copyObj.addSorderItem(obj.copy()); 6700 } 6701 6702 6703 v = getPaymentItems(); 6704 for (int i = 0; i < v.size(); i++) 6705 { 6706 PaymentItem obj = (PaymentItem) v.get(i); 6707 copyObj.addPaymentItem(obj.copy()); 6708 } 6709 6710 6711 v = getShipmentItems(); 6712 for (int i = 0; i < v.size(); i++) 6713 { 6714 ShipmentItem obj = (ShipmentItem) v.get(i); 6715 copyObj.addShipmentItem(obj.copy()); 6716 } 6717 6718 6719 v = getServiceItems(); 6720 for (int i = 0; i < v.size(); i++) 6721 { 6722 ServiceItem obj = (ServiceItem) v.get(i); 6723 copyObj.addServiceItem(obj.copy()); 6724 } 6725 return copyObj; 6726 } 6727 6728 6734 public ProductPeer getPeer() 6735 { 6736 return peer; 6737 } 6738 6739 public String toString() 6740 { 6741 StringBuffer str = new StringBuffer (); 6742 str.append("Product:\n"); 6743 str.append("ProductId = ") 6744 .append(getProductId()) 6745 .append("\n"); 6746 str.append("ProductCode = ") 6747 .append(getProductCode()) 6748 .append("\n"); 6749 str.append("Status = ") 6750 .append(getStatus()) 6751 .append("\n"); 6752 str.append("Priority = ") 6753 .append(getPriority()) 6754 .append("\n"); 6755 str.append("ProductType = ") 6756 .append(getProductType()) 6757 .append("\n"); 6758 str.append("ProductCatId = ") 6759 .append(getProductCatId()) 6760 .append("\n"); 6761 str.append("ProductDescription = ") 6762 .append(getProductDescription()) 6763 .append("\n"); 6764 str.append("ProductDisplay = ") 6765 .append(getProductDisplay()) 6766 .append("\n"); 6767 str.append("BasePrice = ") 6768 .append(getBasePrice()) 6769 .append("\n"); 6770 str.append("UomId = ") 6771 .append(getUomId()) 6772 .append("\n"); 6773 str.append("WebUrl = ") 6774 .append(getWebUrl()) 6775 .append("\n"); 6776 str.append("ShowOnPricelist = ") 6777 .append(getShowOnPricelist()) 6778 .append("\n"); 6779 str.append("VendorId = ") 6780 .append(getVendorId()) 6781 .append("\n"); 6782 str.append("VendorsCode = ") 6783 .append(getVendorsCode()) 6784 .append("\n"); 6785 str.append("EanUpcCode = ") 6786 .append(getEanUpcCode()) 6787 .append("\n"); 6788 str.append("Location = ") 6789 .append(getLocation()) 6790 .append("\n"); 6791 str.append("Custom1 = ") 6792 .append(getCustom1()) 6793 .append("\n"); 6794 str.append("Custom2 = ") 6795 .append(getCustom2()) 6796 .append("\n"); 6797 str.append("Custom3 = ") 6798 .append(getCustom3()) 6799 .append("\n"); 6800 str.append("Custom4 = ") 6801 .append(getCustom4()) 6802 .append("\n"); 6803 str.append("Custom5 = ") 6804 .append(getCustom5()) 6805 .append("\n"); 6806 str.append("Custom6 = ") 6807 .append(getCustom6()) 6808 .append("\n"); 6809 str.append("Notes = ") 6810 .append(getNotes()) 6811 .append("\n"); 6812 str.append("Created = ") 6813 .append(getCreated()) 6814 .append("\n"); 6815 str.append("Modified = ") 6816 .append(getModified()) 6817 .append("\n"); 6818 str.append("CreatedBy = ") 6819 .append(getCreatedBy()) 6820 .append("\n"); 6821 str.append("ModifiedBy = ") 6822 .append(getModifiedBy()) 6823 .append("\n"); 6824 return(str.toString()); 6825 } 6826} 6827 | Popular Tags |