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 34 public abstract class BaseCustomerCategory extends BaseObject 35 implements org.apache.turbine.om.Retrievable 36 { 37 38 private static final CustomerCategoryPeer peer = 39 new CustomerCategoryPeer(); 40 41 42 43 private int customerCatId; 44 45 46 private String customerCatName; 47 48 49 54 public int getCustomerCatId() 55 { 56 return customerCatId; 57 } 58 59 60 65 public void setCustomerCatId(int v) throws TorqueException 66 { 67 68 if (this.customerCatId != v) 69 { 70 this.customerCatId = v; 71 setModified(true); 72 } 73 74 75 76 if (collCustomers != null) 78 { 79 for (int i = 0; i < collCustomers.size(); i++) 80 { 81 ((Customer) collCustomers.get(i)) 82 .setCustomerCatId(v); 83 } 84 } 85 86 if (collNewsletters != null) 88 { 89 for (int i = 0; i < collNewsletters.size(); i++) 90 { 91 ((Newsletter) collNewsletters.get(i)) 92 .setCustomerCatId(v); 93 } 94 } 95 } 96 97 102 public String getCustomerCatName() 103 { 104 return customerCatName; 105 } 106 107 108 113 public void setCustomerCatName(String v) 114 { 115 116 if (!ObjectUtils.equals(this.customerCatName, v)) 117 { 118 this.customerCatName = v; 119 setModified(true); 120 } 121 122 123 } 124 125 126 127 128 131 protected List collCustomers; 132 133 138 protected void initCustomers() 139 { 140 if (collCustomers == null) 141 { 142 collCustomers = new ArrayList (); 143 } 144 } 145 146 153 public void addCustomer(Customer l) throws TorqueException 154 { 155 getCustomers().add(l); 156 l.setCustomerCategory((CustomerCategory) this); 157 } 158 159 162 private Criteria lastCustomersCriteria = null; 163 164 171 public List getCustomers() throws TorqueException 172 { 173 if (collCustomers == null) 174 { 175 collCustomers = getCustomers(new Criteria(10)); 176 } 177 return collCustomers; 178 } 179 180 191 public List getCustomers(Criteria criteria) throws TorqueException 192 { 193 if (collCustomers == null) 194 { 195 if (isNew()) 196 { 197 collCustomers = new ArrayList (); 198 } 199 else 200 { 201 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId() ); 202 collCustomers = CustomerPeer.doSelect(criteria); 203 } 204 } 205 else 206 { 207 if (!isNew()) 209 { 210 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 214 if (!lastCustomersCriteria.equals(criteria)) 215 { 216 collCustomers = CustomerPeer.doSelect(criteria); 217 } 218 } 219 } 220 lastCustomersCriteria = criteria; 221 222 return collCustomers; 223 } 224 225 233 public List getCustomers(Connection con) throws TorqueException 234 { 235 if (collCustomers == null) 236 { 237 collCustomers = getCustomers(new Criteria(10), con); 238 } 239 return collCustomers; 240 } 241 242 254 public List getCustomers(Criteria criteria, Connection con) 255 throws TorqueException 256 { 257 if (collCustomers == null) 258 { 259 if (isNew()) 260 { 261 collCustomers = new ArrayList (); 262 } 263 else 264 { 265 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 266 collCustomers = CustomerPeer.doSelect(criteria, con); 267 } 268 } 269 else 270 { 271 if (!isNew()) 273 { 274 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 278 if (!lastCustomersCriteria.equals(criteria)) 279 { 280 collCustomers = CustomerPeer.doSelect(criteria, con); 281 } 282 } 283 } 284 lastCustomersCriteria = criteria; 285 286 return collCustomers; 287 } 288 289 290 291 292 293 294 295 296 297 298 299 310 protected List getCustomersJoinCustomerCategory(Criteria criteria) 311 throws TorqueException 312 { 313 if (collCustomers == null) 314 { 315 if (isNew()) 316 { 317 collCustomers = new ArrayList (); 318 } 319 else 320 { 321 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 322 collCustomers = CustomerPeer.doSelectJoinCustomerCategory(criteria); 323 } 324 } 325 else 326 { 327 331 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 332 if (!lastCustomersCriteria.equals(criteria)) 333 { 334 collCustomers = CustomerPeer.doSelectJoinCustomerCategory(criteria); 335 } 336 } 337 lastCustomersCriteria = criteria; 338 339 return collCustomers; 340 } 341 342 343 344 345 346 347 348 349 350 361 protected List getCustomersJoinCountry(Criteria criteria) 362 throws TorqueException 363 { 364 if (collCustomers == null) 365 { 366 if (isNew()) 367 { 368 collCustomers = new ArrayList (); 369 } 370 else 371 { 372 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 373 collCustomers = CustomerPeer.doSelectJoinCountry(criteria); 374 } 375 } 376 else 377 { 378 382 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 383 if (!lastCustomersCriteria.equals(criteria)) 384 { 385 collCustomers = CustomerPeer.doSelectJoinCountry(criteria); 386 } 387 } 388 lastCustomersCriteria = criteria; 389 390 return collCustomers; 391 } 392 393 394 395 396 397 398 399 400 401 412 protected List getCustomersJoinRegion(Criteria criteria) 413 throws TorqueException 414 { 415 if (collCustomers == null) 416 { 417 if (isNew()) 418 { 419 collCustomers = new ArrayList (); 420 } 421 else 422 { 423 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 424 collCustomers = CustomerPeer.doSelectJoinRegion(criteria); 425 } 426 } 427 else 428 { 429 433 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 434 if (!lastCustomersCriteria.equals(criteria)) 435 { 436 collCustomers = CustomerPeer.doSelectJoinRegion(criteria); 437 } 438 } 439 lastCustomersCriteria = criteria; 440 441 return collCustomers; 442 } 443 444 445 446 447 448 449 450 451 452 463 protected List getCustomersJoinLanguage(Criteria criteria) 464 throws TorqueException 465 { 466 if (collCustomers == null) 467 { 468 if (isNew()) 469 { 470 collCustomers = new ArrayList (); 471 } 472 else 473 { 474 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 475 collCustomers = CustomerPeer.doSelectJoinLanguage(criteria); 476 } 477 } 478 else 479 { 480 484 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 485 if (!lastCustomersCriteria.equals(criteria)) 486 { 487 collCustomers = CustomerPeer.doSelectJoinLanguage(criteria); 488 } 489 } 490 lastCustomersCriteria = criteria; 491 492 return collCustomers; 493 } 494 495 496 497 498 499 500 501 502 503 514 protected List getCustomersJoinEducationCategory(Criteria criteria) 515 throws TorqueException 516 { 517 if (collCustomers == null) 518 { 519 if (isNew()) 520 { 521 collCustomers = new ArrayList (); 522 } 523 else 524 { 525 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 526 collCustomers = CustomerPeer.doSelectJoinEducationCategory(criteria); 527 } 528 } 529 else 530 { 531 535 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 536 if (!lastCustomersCriteria.equals(criteria)) 537 { 538 collCustomers = CustomerPeer.doSelectJoinEducationCategory(criteria); 539 } 540 } 541 lastCustomersCriteria = criteria; 542 543 return collCustomers; 544 } 545 546 547 548 549 550 551 552 553 554 565 protected List getCustomersJoinHouseholdCategory(Criteria criteria) 566 throws TorqueException 567 { 568 if (collCustomers == null) 569 { 570 if (isNew()) 571 { 572 collCustomers = new ArrayList (); 573 } 574 else 575 { 576 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 577 collCustomers = CustomerPeer.doSelectJoinHouseholdCategory(criteria); 578 } 579 } 580 else 581 { 582 586 criteria.add(CustomerPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 587 if (!lastCustomersCriteria.equals(criteria)) 588 { 589 collCustomers = CustomerPeer.doSelectJoinHouseholdCategory(criteria); 590 } 591 } 592 lastCustomersCriteria = criteria; 593 594 return collCustomers; 595 } 596 597 598 599 600 601 604 protected List collNewsletters; 605 606 611 protected void initNewsletters() 612 { 613 if (collNewsletters == null) 614 { 615 collNewsletters = new ArrayList (); 616 } 617 } 618 619 626 public void addNewsletter(Newsletter l) throws TorqueException 627 { 628 getNewsletters().add(l); 629 l.setCustomerCategory((CustomerCategory) this); 630 } 631 632 635 private Criteria lastNewslettersCriteria = null; 636 637 644 public List getNewsletters() throws TorqueException 645 { 646 if (collNewsletters == null) 647 { 648 collNewsletters = getNewsletters(new Criteria(10)); 649 } 650 return collNewsletters; 651 } 652 653 664 public List getNewsletters(Criteria criteria) throws TorqueException 665 { 666 if (collNewsletters == null) 667 { 668 if (isNew()) 669 { 670 collNewsletters = new ArrayList (); 671 } 672 else 673 { 674 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId() ); 675 collNewsletters = NewsletterPeer.doSelect(criteria); 676 } 677 } 678 else 679 { 680 if (!isNew()) 682 { 683 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 687 if (!lastNewslettersCriteria.equals(criteria)) 688 { 689 collNewsletters = NewsletterPeer.doSelect(criteria); 690 } 691 } 692 } 693 lastNewslettersCriteria = criteria; 694 695 return collNewsletters; 696 } 697 698 706 public List getNewsletters(Connection con) throws TorqueException 707 { 708 if (collNewsletters == null) 709 { 710 collNewsletters = getNewsletters(new Criteria(10), con); 711 } 712 return collNewsletters; 713 } 714 715 727 public List getNewsletters(Criteria criteria, Connection con) 728 throws TorqueException 729 { 730 if (collNewsletters == null) 731 { 732 if (isNew()) 733 { 734 collNewsletters = new ArrayList (); 735 } 736 else 737 { 738 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 739 collNewsletters = NewsletterPeer.doSelect(criteria, con); 740 } 741 } 742 else 743 { 744 if (!isNew()) 746 { 747 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 751 if (!lastNewslettersCriteria.equals(criteria)) 752 { 753 collNewsletters = NewsletterPeer.doSelect(criteria, con); 754 } 755 } 756 } 757 lastNewslettersCriteria = criteria; 758 759 return collNewsletters; 760 } 761 762 763 764 765 766 767 768 769 770 771 772 783 protected List getNewslettersJoinCustomerCategory(Criteria criteria) 784 throws TorqueException 785 { 786 if (collNewsletters == null) 787 { 788 if (isNew()) 789 { 790 collNewsletters = new ArrayList (); 791 } 792 else 793 { 794 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 795 collNewsletters = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 796 } 797 } 798 else 799 { 800 804 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 805 if (!lastNewslettersCriteria.equals(criteria)) 806 { 807 collNewsletters = NewsletterPeer.doSelectJoinCustomerCategory(criteria); 808 } 809 } 810 lastNewslettersCriteria = criteria; 811 812 return collNewsletters; 813 } 814 815 816 817 818 819 820 821 822 823 834 protected List getNewslettersJoinProjectRelatedByProjectId(Criteria criteria) 835 throws TorqueException 836 { 837 if (collNewsletters == null) 838 { 839 if (isNew()) 840 { 841 collNewsletters = new ArrayList (); 842 } 843 else 844 { 845 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 846 collNewsletters = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 847 } 848 } 849 else 850 { 851 855 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 856 if (!lastNewslettersCriteria.equals(criteria)) 857 { 858 collNewsletters = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria); 859 } 860 } 861 lastNewslettersCriteria = criteria; 862 863 return collNewsletters; 864 } 865 866 867 868 869 870 871 872 873 874 885 protected List getNewslettersJoinProductRelatedByProductId(Criteria criteria) 886 throws TorqueException 887 { 888 if (collNewsletters == null) 889 { 890 if (isNew()) 891 { 892 collNewsletters = new ArrayList (); 893 } 894 else 895 { 896 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 897 collNewsletters = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria); 898 } 899 } 900 else 901 { 902 906 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 907 if (!lastNewslettersCriteria.equals(criteria)) 908 { 909 collNewsletters = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria); 910 } 911 } 912 lastNewslettersCriteria = criteria; 913 914 return collNewsletters; 915 } 916 917 918 919 920 921 922 923 924 925 936 protected List getNewslettersJoinProjectRelatedByRelProjectId(Criteria criteria) 937 throws TorqueException 938 { 939 if (collNewsletters == null) 940 { 941 if (isNew()) 942 { 943 collNewsletters = new ArrayList (); 944 } 945 else 946 { 947 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 948 collNewsletters = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 949 } 950 } 951 else 952 { 953 957 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 958 if (!lastNewslettersCriteria.equals(criteria)) 959 { 960 collNewsletters = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria); 961 } 962 } 963 lastNewslettersCriteria = criteria; 964 965 return collNewsletters; 966 } 967 968 969 970 971 972 973 974 975 976 987 protected List getNewslettersJoinProductRelatedByRelProductId(Criteria criteria) 988 throws TorqueException 989 { 990 if (collNewsletters == null) 991 { 992 if (isNew()) 993 { 994 collNewsletters = new ArrayList (); 995 } 996 else 997 { 998 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 999 collNewsletters = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria); 1000 } 1001 } 1002 else 1003 { 1004 1008 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1009 if (!lastNewslettersCriteria.equals(criteria)) 1010 { 1011 collNewsletters = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria); 1012 } 1013 } 1014 lastNewslettersCriteria = criteria; 1015 1016 return collNewsletters; 1017 } 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1038 protected List getNewslettersJoinCountry(Criteria criteria) 1039 throws TorqueException 1040 { 1041 if (collNewsletters == null) 1042 { 1043 if (isNew()) 1044 { 1045 collNewsletters = new ArrayList (); 1046 } 1047 else 1048 { 1049 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1050 collNewsletters = NewsletterPeer.doSelectJoinCountry(criteria); 1051 } 1052 } 1053 else 1054 { 1055 1059 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1060 if (!lastNewslettersCriteria.equals(criteria)) 1061 { 1062 collNewsletters = NewsletterPeer.doSelectJoinCountry(criteria); 1063 } 1064 } 1065 lastNewslettersCriteria = criteria; 1066 1067 return collNewsletters; 1068 } 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1089 protected List getNewslettersJoinLanguageRelatedByCustLanguageId(Criteria criteria) 1090 throws TorqueException 1091 { 1092 if (collNewsletters == null) 1093 { 1094 if (isNew()) 1095 { 1096 collNewsletters = new ArrayList (); 1097 } 1098 else 1099 { 1100 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1101 collNewsletters = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 1102 } 1103 } 1104 else 1105 { 1106 1110 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1111 if (!lastNewslettersCriteria.equals(criteria)) 1112 { 1113 collNewsletters = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria); 1114 } 1115 } 1116 lastNewslettersCriteria = criteria; 1117 1118 return collNewsletters; 1119 } 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1140 protected List getNewslettersJoinLanguageRelatedByLanguageId(Criteria criteria) 1141 throws TorqueException 1142 { 1143 if (collNewsletters == null) 1144 { 1145 if (isNew()) 1146 { 1147 collNewsletters = new ArrayList (); 1148 } 1149 else 1150 { 1151 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1152 collNewsletters = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 1153 } 1154 } 1155 else 1156 { 1157 1161 criteria.add(NewsletterPeer.CUSTOMER_CAT_ID, getCustomerCatId()); 1162 if (!lastNewslettersCriteria.equals(criteria)) 1163 { 1164 collNewsletters = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria); 1165 } 1166 } 1167 lastNewslettersCriteria = criteria; 1168 1169 return collNewsletters; 1170 } 1171 1172 1173 1174 1175 private static List fieldNames = null; 1176 1177 1182 public static synchronized List getFieldNames() 1183 { 1184 if (fieldNames == null) 1185 { 1186 fieldNames = new ArrayList (); 1187 fieldNames.add("CustomerCatId"); 1188 fieldNames.add("CustomerCatName"); 1189 fieldNames = Collections.unmodifiableList(fieldNames); 1190 } 1191 return fieldNames; 1192 } 1193 1194 1200 public Object getByName(String name) 1201 { 1202 if (name.equals("CustomerCatId")) 1203 { 1204 return new Integer (getCustomerCatId()); 1205 } 1206 if (name.equals("CustomerCatName")) 1207 { 1208 return getCustomerCatName(); 1209 } 1210 return null; 1211 } 1212 1213 1221 public Object getByPeerName(String name) 1222 { 1223 if (name.equals(CustomerCategoryPeer.CUSTOMER_CAT_ID)) 1224 { 1225 return new Integer (getCustomerCatId()); 1226 } 1227 if (name.equals(CustomerCategoryPeer.CUSTOMER_CAT_NAME)) 1228 { 1229 return getCustomerCatName(); 1230 } 1231 return null; 1232 } 1233 1234 1241 public Object getByPosition(int pos) 1242 { 1243 if (pos == 0) 1244 { 1245 return new Integer (getCustomerCatId()); 1246 } 1247 if (pos == 1) 1248 { 1249 return getCustomerCatName(); 1250 } 1251 return null; 1252 } 1253 1254 1260 public void save() throws Exception  1261 { 1262 save(CustomerCategoryPeer.getMapBuilder() 1263 .getDatabaseMap().getName()); 1264 } 1265 1266 1276 public void save(String dbName) throws TorqueException 1277 { 1278 Connection con = null; 1279 try 1280 { 1281 con = Transaction.begin(dbName); 1282 save(con); 1283 Transaction.commit(con); 1284 } 1285 catch(TorqueException e) 1286 { 1287 Transaction.safeRollback(con); 1288 throw e; 1289 } 1290 } 1291 1292 1294 private boolean alreadyInSave = false; 1295 1305 public void save(Connection con) throws TorqueException 1306 { 1307 if (!alreadyInSave) 1308 { 1309 alreadyInSave = true; 1310 1311 1312 1313 if (isModified()) 1315 { 1316 if (isNew()) 1317 { 1318 CustomerCategoryPeer.doInsert((CustomerCategory) this, con); 1319 setNew(false); 1320 } 1321 else 1322 { 1323 CustomerCategoryPeer.doUpdate((CustomerCategory) this, con); 1324 } 1325 } 1326 1327 1328 1329 if (collCustomers != null) 1330 { 1331 for (int i = 0; i < collCustomers.size(); i++) 1332 { 1333 ((Customer) collCustomers.get(i)).save(con); 1334 } 1335 } 1336 1337 1338 if (collNewsletters != null) 1339 { 1340 for (int i = 0; i < collNewsletters.size(); i++) 1341 { 1342 ((Newsletter) collNewsletters.get(i)).save(con); 1343 } 1344 } 1345 alreadyInSave = false; 1346 } 1347 } 1348 1349 1350 1355 public void setPrimaryKey(ObjectKey key) 1356 throws TorqueException 1357 { 1358 setCustomerCatId(((NumberKey) key).intValue()); 1359 } 1360 1361 1366 public void setPrimaryKey(String key) throws TorqueException 1367 { 1368 setCustomerCatId(Integer.parseInt(key)); 1369 } 1370 1371 1372 1376 public ObjectKey getPrimaryKey() 1377 { 1378 return SimpleKey.keyFor(getCustomerCatId()); 1379 } 1380 1381 1385 public String getQueryKey() 1386 { 1387 if (getPrimaryKey() == null) 1388 { 1389 return ""; 1390 } 1391 else 1392 { 1393 return getPrimaryKey().toString(); 1394 } 1395 } 1396 1397 1401 public void setQueryKey(String key) 1402 throws TorqueException 1403 { 1404 setPrimaryKey(key); 1405 } 1406 1407 1413 public CustomerCategory copy() throws TorqueException 1414 { 1415 return copyInto(new CustomerCategory()); 1416 } 1417 1418 protected CustomerCategory copyInto(CustomerCategory copyObj) throws TorqueException 1419 { 1420 copyObj.setCustomerCatId(customerCatId); 1421 copyObj.setCustomerCatName(customerCatName); 1422 1423 copyObj.setCustomerCatId( 0); 1424 1425 1426 1427 List v = getCustomers(); 1428 for (int i = 0; i < v.size(); i++) 1429 { 1430 Customer obj = (Customer) v.get(i); 1431 copyObj.addCustomer(obj.copy()); 1432 } 1433 1434 1435 v = getNewsletters(); 1436 for (int i = 0; i < v.size(); i++) 1437 { 1438 Newsletter obj = (Newsletter) v.get(i); 1439 copyObj.addNewsletter(obj.copy()); 1440 } 1441 return copyObj; 1442 } 1443 1444 1450 public CustomerCategoryPeer getPeer() 1451 { 1452 return peer; 1453 } 1454 1455 public String toString() 1456 { 1457 StringBuffer str = new StringBuffer (); 1458 str.append("CustomerCategory:\n"); 1459 str.append("CustomerCatId = ") 1460 .append(getCustomerCatId()) 1461 .append("\n"); 1462 str.append("CustomerCatName = ") 1463 .append(getCustomerCatName()) 1464 .append("\n"); 1465 return(str.toString()); 1466 } 1467} 1468
| Popular Tags
|