1 package org.tigris.scarab.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.fulcrum.intake.Retrievable; 13 import org.apache.torque.TorqueException; 14 import org.apache.torque.om.BaseObject; 15 import org.apache.torque.om.ComboKey; 16 import org.apache.torque.om.DateKey; 17 import org.apache.torque.om.NumberKey; 18 import org.apache.torque.om.ObjectKey; 19 import org.apache.torque.om.SimpleKey; 20 import org.apache.torque.om.StringKey; 21 import org.apache.torque.om.Persistent; 22 import org.apache.torque.util.Criteria; 23 import org.apache.torque.util.Transaction; 24 25 26 27 28 29 30 31 32 33 34 35 39 public abstract class BaseActivity extends BaseObject 40 implements org.apache.fulcrum.intake.Retrievable 41 { 42 43 private static final ActivityPeer peer = 44 new ActivityPeer(); 45 46 47 48 private Long activityId; 49 50 51 private Long issueId; 52 53 54 private Integer attributeId; 55 56 57 private Long transactionId; 58 59 60 private Integer oldNumericValue; 61 62 63 private Integer newNumericValue; 64 65 66 private Integer oldUserId; 67 68 69 private Integer newUserId; 70 71 72 private Integer oldOptionId; 73 74 75 private Integer newOptionId; 76 77 78 private String oldValue; 79 80 81 private String newValue; 82 83 84 private Integer dependId; 85 86 87 private String description; 88 89 90 private Date endDate; 91 92 93 private Long attachmentId; 94 95 96 101 public Long getActivityId() 102 { 103 return activityId; 104 } 105 106 107 112 public void setActivityId(Long v) 113 { 114 115 if (!ObjectUtils.equals(this.activityId, v)) 116 { 117 this.activityId = v; 118 setModified(true); 119 } 120 121 122 } 123 124 129 public Long getIssueId() 130 { 131 return issueId; 132 } 133 134 135 140 public void setIssueId(Long v) throws TorqueException 141 { 142 143 if (!ObjectUtils.equals(this.issueId, v)) 144 { 145 this.issueId = v; 146 setModified(true); 147 } 148 149 150 if (aIssue != null && !ObjectUtils.equals(aIssue.getIssueId(), v)) 151 { 152 aIssue = null; 153 } 154 155 } 156 157 162 public Integer getAttributeId() 163 { 164 return attributeId; 165 } 166 167 168 173 public void setAttributeId(Integer v) throws TorqueException 174 { 175 176 if (!ObjectUtils.equals(this.attributeId, v)) 177 { 178 this.attributeId = v; 179 setModified(true); 180 } 181 182 183 if (aAttribute != null && !ObjectUtils.equals(aAttribute.getAttributeId(), v)) 184 { 185 aAttribute = null; 186 } 187 188 } 189 190 195 public Long getTransactionId() 196 { 197 return transactionId; 198 } 199 200 201 206 public void setTransactionId(Long v) throws TorqueException 207 { 208 209 if (!ObjectUtils.equals(this.transactionId, v)) 210 { 211 this.transactionId = v; 212 setModified(true); 213 } 214 215 216 if (aActivitySet != null && !ObjectUtils.equals(aActivitySet.getActivitySetId(), v)) 217 { 218 aActivitySet = null; 219 } 220 221 } 222 223 228 public Integer getOldNumericValue() 229 { 230 return oldNumericValue; 231 } 232 233 234 239 public void setOldNumericValue(Integer v) 240 { 241 242 if (!ObjectUtils.equals(this.oldNumericValue, v)) 243 { 244 this.oldNumericValue = v; 245 setModified(true); 246 } 247 248 249 } 250 251 256 public Integer getNewNumericValue() 257 { 258 return newNumericValue; 259 } 260 261 262 267 public void setNewNumericValue(Integer v) 268 { 269 270 if (!ObjectUtils.equals(this.newNumericValue, v)) 271 { 272 this.newNumericValue = v; 273 setModified(true); 274 } 275 276 277 } 278 279 284 public Integer getOldUserId() 285 { 286 return oldUserId; 287 } 288 289 290 295 public void setOldUserId(Integer v) throws TorqueException 296 { 297 298 if (!ObjectUtils.equals(this.oldUserId, v)) 299 { 300 this.oldUserId = v; 301 setModified(true); 302 } 303 304 305 if (aScarabUserRelatedByOldUserId != null && !ObjectUtils.equals(aScarabUserRelatedByOldUserId.getUserId(), v)) 306 { 307 aScarabUserRelatedByOldUserId = null; 308 } 309 310 } 311 312 317 public Integer getNewUserId() 318 { 319 return newUserId; 320 } 321 322 323 328 public void setNewUserId(Integer v) throws TorqueException 329 { 330 331 if (!ObjectUtils.equals(this.newUserId, v)) 332 { 333 this.newUserId = v; 334 setModified(true); 335 } 336 337 338 if (aScarabUserRelatedByNewUserId != null && !ObjectUtils.equals(aScarabUserRelatedByNewUserId.getUserId(), v)) 339 { 340 aScarabUserRelatedByNewUserId = null; 341 } 342 343 } 344 345 350 public Integer getOldOptionId() 351 { 352 return oldOptionId; 353 } 354 355 356 361 public void setOldOptionId(Integer v) throws TorqueException 362 { 363 364 if (!ObjectUtils.equals(this.oldOptionId, v)) 365 { 366 this.oldOptionId = v; 367 setModified(true); 368 } 369 370 371 if (aAttributeOptionRelatedByOldOptionId != null && !ObjectUtils.equals(aAttributeOptionRelatedByOldOptionId.getOptionId(), v)) 372 { 373 aAttributeOptionRelatedByOldOptionId = null; 374 } 375 376 } 377 378 383 public Integer getNewOptionId() 384 { 385 return newOptionId; 386 } 387 388 389 394 public void setNewOptionId(Integer v) throws TorqueException 395 { 396 397 if (!ObjectUtils.equals(this.newOptionId, v)) 398 { 399 this.newOptionId = v; 400 setModified(true); 401 } 402 403 404 if (aAttributeOptionRelatedByNewOptionId != null && !ObjectUtils.equals(aAttributeOptionRelatedByNewOptionId.getOptionId(), v)) 405 { 406 aAttributeOptionRelatedByNewOptionId = null; 407 } 408 409 } 410 411 416 public String getOldValue() 417 { 418 return oldValue; 419 } 420 421 422 427 public void setOldValue(String v) 428 { 429 430 if (!ObjectUtils.equals(this.oldValue, v)) 431 { 432 this.oldValue = v; 433 setModified(true); 434 } 435 436 437 } 438 439 444 public String getNewValue() 445 { 446 return newValue; 447 } 448 449 450 455 public void setNewValue(String v) 456 { 457 458 if (!ObjectUtils.equals(this.newValue, v)) 459 { 460 this.newValue = v; 461 setModified(true); 462 } 463 464 465 } 466 467 472 public Integer getDependId() 473 { 474 return dependId; 475 } 476 477 478 483 public void setDependId(Integer v) throws TorqueException 484 { 485 486 if (!ObjectUtils.equals(this.dependId, v)) 487 { 488 this.dependId = v; 489 setModified(true); 490 } 491 492 493 if (aDepend != null && !ObjectUtils.equals(aDepend.getDependId(), v)) 494 { 495 aDepend = null; 496 } 497 498 } 499 500 505 public String getDescription() 506 { 507 return description; 508 } 509 510 511 516 public void setDescription(String v) 517 { 518 519 if (!ObjectUtils.equals(this.description, v)) 520 { 521 this.description = v; 522 setModified(true); 523 } 524 525 526 } 527 528 533 public Date getEndDate() 534 { 535 return endDate; 536 } 537 538 539 544 public void setEndDate(Date v) 545 { 546 547 if (!ObjectUtils.equals(this.endDate, v)) 548 { 549 this.endDate = v; 550 setModified(true); 551 } 552 553 554 } 555 556 561 public Long getAttachmentId() 562 { 563 return attachmentId; 564 } 565 566 567 572 public void setAttachmentId(Long v) throws TorqueException 573 { 574 575 if (!ObjectUtils.equals(this.attachmentId, v)) 576 { 577 this.attachmentId = v; 578 setModified(true); 579 } 580 581 582 if (aAttachment != null && !ObjectUtils.equals(aAttachment.getAttachmentId(), v)) 583 { 584 aAttachment = null; 585 } 586 587 } 588 589 590 591 592 private Issue aIssue; 593 594 600 public void setIssue(Issue v) throws TorqueException 601 { 602 if (v == null) 603 { 604 setIssueId((Long ) null); 605 } 606 else 607 { 608 setIssueId(v.getIssueId()); 609 } 610 aIssue = v; 611 } 612 613 614 620 public Issue getIssue() throws TorqueException 621 { 622 if ( !ObjectUtils.equals(getIssueId(), null) ) 623 { 624 return IssueManager.getInstance(SimpleKey.keyFor(getIssueId())); 625 } 626 return aIssue; 627 } 628 629 635 public void setIssueKey(ObjectKey key) throws TorqueException 636 { 637 638 setIssueId(new Long (((NumberKey) key).longValue())); 639 } 640 641 642 643 private Attribute aAttribute; 644 645 651 public void setAttribute(Attribute v) throws TorqueException 652 { 653 if (v == null) 654 { 655 setAttributeId((Integer ) null); 656 } 657 else 658 { 659 setAttributeId(v.getAttributeId()); 660 } 661 aAttribute = v; 662 } 663 664 665 671 public Attribute getAttribute() throws TorqueException 672 { 673 if ( !ObjectUtils.equals(getAttributeId(), null) ) 674 { 675 return AttributeManager.getInstance(SimpleKey.keyFor(getAttributeId())); 676 } 677 return aAttribute; 678 } 679 680 686 public void setAttributeKey(ObjectKey key) throws TorqueException 687 { 688 689 setAttributeId(new Integer (((NumberKey) key).intValue())); 690 } 691 692 693 694 private ActivitySet aActivitySet; 695 696 702 public void setActivitySet(ActivitySet v) throws TorqueException 703 { 704 if (v == null) 705 { 706 setTransactionId((Long ) null); 707 } 708 else 709 { 710 setTransactionId(v.getActivitySetId()); 711 } 712 aActivitySet = v; 713 } 714 715 716 722 public ActivitySet getActivitySet() throws TorqueException 723 { 724 if ( !ObjectUtils.equals(getTransactionId(), null) ) 725 { 726 return ActivitySetManager.getInstance(SimpleKey.keyFor(getTransactionId())); 727 } 728 return aActivitySet; 729 } 730 731 737 public void setActivitySetKey(ObjectKey key) throws TorqueException 738 { 739 740 setTransactionId(new Long (((NumberKey) key).longValue())); 741 } 742 743 744 745 private ScarabUser aScarabUserRelatedByOldUserId; 746 747 753 public void setScarabUserRelatedByOldUserId(ScarabUser v) throws TorqueException 754 { 755 if (v == null) 756 { 757 setOldUserId((Integer ) null); 758 } 759 else 760 { 761 setOldUserId(v.getUserId()); 762 } 763 aScarabUserRelatedByOldUserId = v; 764 } 765 766 767 773 public ScarabUser getScarabUserRelatedByOldUserId() throws TorqueException 774 { 775 if ( !ObjectUtils.equals(getOldUserId(), null) ) 776 { 777 return ScarabUserManager.getInstance(SimpleKey.keyFor(getOldUserId())); 778 } 779 return aScarabUserRelatedByOldUserId; 780 } 781 782 788 public void setScarabUserRelatedByOldUserIdKey(ObjectKey key) throws TorqueException 789 { 790 791 setOldUserId(new Integer (((NumberKey) key).intValue())); 792 } 793 794 795 796 private ScarabUser aScarabUserRelatedByNewUserId; 797 798 804 public void setScarabUserRelatedByNewUserId(ScarabUser v) throws TorqueException 805 { 806 if (v == null) 807 { 808 setNewUserId((Integer ) null); 809 } 810 else 811 { 812 setNewUserId(v.getUserId()); 813 } 814 aScarabUserRelatedByNewUserId = v; 815 } 816 817 818 824 public ScarabUser getScarabUserRelatedByNewUserId() throws TorqueException 825 { 826 if ( !ObjectUtils.equals(getNewUserId(), null) ) 827 { 828 return ScarabUserManager.getInstance(SimpleKey.keyFor(getNewUserId())); 829 } 830 return aScarabUserRelatedByNewUserId; 831 } 832 833 839 public void setScarabUserRelatedByNewUserIdKey(ObjectKey key) throws TorqueException 840 { 841 842 setNewUserId(new Integer (((NumberKey) key).intValue())); 843 } 844 845 846 847 private AttributeOption aAttributeOptionRelatedByOldOptionId; 848 849 855 public void setAttributeOptionRelatedByOldOptionId(AttributeOption v) throws TorqueException 856 { 857 if (v == null) 858 { 859 setOldOptionId((Integer ) null); 860 } 861 else 862 { 863 setOldOptionId(v.getOptionId()); 864 } 865 aAttributeOptionRelatedByOldOptionId = v; 866 } 867 868 869 875 public AttributeOption getAttributeOptionRelatedByOldOptionId() throws TorqueException 876 { 877 if ( !ObjectUtils.equals(getOldOptionId(), null) ) 878 { 879 return AttributeOptionManager.getInstance(SimpleKey.keyFor(getOldOptionId())); 880 } 881 return aAttributeOptionRelatedByOldOptionId; 882 } 883 884 890 public void setAttributeOptionRelatedByOldOptionIdKey(ObjectKey key) throws TorqueException 891 { 892 893 setOldOptionId(new Integer (((NumberKey) key).intValue())); 894 } 895 896 897 898 private AttributeOption aAttributeOptionRelatedByNewOptionId; 899 900 906 public void setAttributeOptionRelatedByNewOptionId(AttributeOption v) throws TorqueException 907 { 908 if (v == null) 909 { 910 setNewOptionId((Integer ) null); 911 } 912 else 913 { 914 setNewOptionId(v.getOptionId()); 915 } 916 aAttributeOptionRelatedByNewOptionId = v; 917 } 918 919 920 926 public AttributeOption getAttributeOptionRelatedByNewOptionId() throws TorqueException 927 { 928 if ( !ObjectUtils.equals(getNewOptionId(), null) ) 929 { 930 return AttributeOptionManager.getInstance(SimpleKey.keyFor(getNewOptionId())); 931 } 932 return aAttributeOptionRelatedByNewOptionId; 933 } 934 935 941 public void setAttributeOptionRelatedByNewOptionIdKey(ObjectKey key) throws TorqueException 942 { 943 944 setNewOptionId(new Integer (((NumberKey) key).intValue())); 945 } 946 947 948 949 private Attachment aAttachment; 950 951 957 public void setAttachment(Attachment v) throws TorqueException 958 { 959 if (v == null) 960 { 961 setAttachmentId((Long ) null); 962 } 963 else 964 { 965 setAttachmentId(v.getAttachmentId()); 966 } 967 aAttachment = v; 968 } 969 970 971 977 public Attachment getAttachment() throws TorqueException 978 { 979 if ( !ObjectUtils.equals(getAttachmentId(), null) ) 980 { 981 return AttachmentManager.getInstance(SimpleKey.keyFor(getAttachmentId())); 982 } 983 return aAttachment; 984 } 985 986 992 public void setAttachmentKey(ObjectKey key) throws TorqueException 993 { 994 995 setAttachmentId(new Long (((NumberKey) key).longValue())); 996 } 997 998 999 1000 private Depend aDepend; 1001 1002 1008 public void setDepend(Depend v) throws TorqueException 1009 { 1010 if (v == null) 1011 { 1012 setDependId((Integer ) null); 1013 } 1014 else 1015 { 1016 setDependId(v.getDependId()); 1017 } 1018 aDepend = v; 1019 } 1020 1021 1022 1028 public Depend getDepend() throws TorqueException 1029 { 1030 if ( !ObjectUtils.equals(getDependId(), null) ) 1031 { 1032 return DependManager.getInstance(SimpleKey.keyFor(getDependId())); 1033 } 1034 return aDepend; 1035 } 1036 1037 1043 public void setDependKey(ObjectKey key) throws TorqueException 1044 { 1045 1046 setDependId(new Integer (((NumberKey) key).intValue())); 1047 } 1048 1049 1050 private static List fieldNames = null; 1051 1052 1057 public static synchronized List getFieldNames() 1058 { 1059 if (fieldNames == null) 1060 { 1061 fieldNames = new ArrayList (); 1062 fieldNames.add("ActivityId"); 1063 fieldNames.add("IssueId"); 1064 fieldNames.add("AttributeId"); 1065 fieldNames.add("TransactionId"); 1066 fieldNames.add("OldNumericValue"); 1067 fieldNames.add("NewNumericValue"); 1068 fieldNames.add("OldUserId"); 1069 fieldNames.add("NewUserId"); 1070 fieldNames.add("OldOptionId"); 1071 fieldNames.add("NewOptionId"); 1072 fieldNames.add("OldValue"); 1073 fieldNames.add("NewValue"); 1074 fieldNames.add("DependId"); 1075 fieldNames.add("Description"); 1076 fieldNames.add("EndDate"); 1077 fieldNames.add("AttachmentId"); 1078 fieldNames = Collections.unmodifiableList(fieldNames); 1079 } 1080 return fieldNames; 1081 } 1082 1083 1089 public Object getByName(String name) 1090 { 1091 if (name.equals("ActivityId")) 1092 { 1093 return getActivityId(); 1094 } 1095 if (name.equals("IssueId")) 1096 { 1097 return getIssueId(); 1098 } 1099 if (name.equals("AttributeId")) 1100 { 1101 return getAttributeId(); 1102 } 1103 if (name.equals("TransactionId")) 1104 { 1105 return getTransactionId(); 1106 } 1107 if (name.equals("OldNumericValue")) 1108 { 1109 return getOldNumericValue(); 1110 } 1111 if (name.equals("NewNumericValue")) 1112 { 1113 return getNewNumericValue(); 1114 } 1115 if (name.equals("OldUserId")) 1116 { 1117 return getOldUserId(); 1118 } 1119 if (name.equals("NewUserId")) 1120 { 1121 return getNewUserId(); 1122 } 1123 if (name.equals("OldOptionId")) 1124 { 1125 return getOldOptionId(); 1126 } 1127 if (name.equals("NewOptionId")) 1128 { 1129 return getNewOptionId(); 1130 } 1131 if (name.equals("OldValue")) 1132 { 1133 return getOldValue(); 1134 } 1135 if (name.equals("NewValue")) 1136 { 1137 return getNewValue(); 1138 } 1139 if (name.equals("DependId")) 1140 { 1141 return getDependId(); 1142 } 1143 if (name.equals("Description")) 1144 { 1145 return getDescription(); 1146 } 1147 if (name.equals("EndDate")) 1148 { 1149 return getEndDate(); 1150 } 1151 if (name.equals("AttachmentId")) 1152 { 1153 return getAttachmentId(); 1154 } 1155 return null; 1156 } 1157 1158 1166 public Object getByPeerName(String name) 1167 { 1168 if (name.equals(ActivityPeer.ACTIVITY_ID)) 1169 { 1170 return getActivityId(); 1171 } 1172 if (name.equals(ActivityPeer.ISSUE_ID)) 1173 { 1174 return getIssueId(); 1175 } 1176 if (name.equals(ActivityPeer.ATTRIBUTE_ID)) 1177 { 1178 return getAttributeId(); 1179 } 1180 if (name.equals(ActivityPeer.TRANSACTION_ID)) 1181 { 1182 return getTransactionId(); 1183 } 1184 if (name.equals(ActivityPeer.OLD_NUMERIC_VALUE)) 1185 { 1186 return getOldNumericValue(); 1187 } 1188 if (name.equals(ActivityPeer.NEW_NUMERIC_VALUE)) 1189 { 1190 return getNewNumericValue(); 1191 } 1192 if (name.equals(ActivityPeer.OLD_USER_ID)) 1193 { 1194 return getOldUserId(); 1195 } 1196 if (name.equals(ActivityPeer.NEW_USER_ID)) 1197 { 1198 return getNewUserId(); 1199 } 1200 if (name.equals(ActivityPeer.OLD_OPTION_ID)) 1201 { 1202 return getOldOptionId(); 1203 } 1204 if (name.equals(ActivityPeer.NEW_OPTION_ID)) 1205 { 1206 return getNewOptionId(); 1207 } 1208 if (name.equals(ActivityPeer.OLD_VALUE)) 1209 { 1210 return getOldValue(); 1211 } 1212 if (name.equals(ActivityPeer.NEW_VALUE)) 1213 { 1214 return getNewValue(); 1215 } 1216 if (name.equals(ActivityPeer.DEPEND_ID)) 1217 { 1218 return getDependId(); 1219 } 1220 if (name.equals(ActivityPeer.DESCRIPTION)) 1221 { 1222 return getDescription(); 1223 } 1224 if (name.equals(ActivityPeer.END_DATE)) 1225 { 1226 return getEndDate(); 1227 } 1228 if (name.equals(ActivityPeer.ATTACHMENT_ID)) 1229 { 1230 return getAttachmentId(); 1231 } 1232 return null; 1233 } 1234 1235 1242 public Object getByPosition(int pos) 1243 { 1244 if (pos == 0) 1245 { 1246 return getActivityId(); 1247 } 1248 if (pos == 1) 1249 { 1250 return getIssueId(); 1251 } 1252 if (pos == 2) 1253 { 1254 return getAttributeId(); 1255 } 1256 if (pos == 3) 1257 { 1258 return getTransactionId(); 1259 } 1260 if (pos == 4) 1261 { 1262 return getOldNumericValue(); 1263 } 1264 if (pos == 5) 1265 { 1266 return getNewNumericValue(); 1267 } 1268 if (pos == 6) 1269 { 1270 return getOldUserId(); 1271 } 1272 if (pos == 7) 1273 { 1274 return getNewUserId(); 1275 } 1276 if (pos == 8) 1277 { 1278 return getOldOptionId(); 1279 } 1280 if (pos == 9) 1281 { 1282 return getNewOptionId(); 1283 } 1284 if (pos == 10) 1285 { 1286 return getOldValue(); 1287 } 1288 if (pos == 11) 1289 { 1290 return getNewValue(); 1291 } 1292 if (pos == 12) 1293 { 1294 return getDependId(); 1295 } 1296 if (pos == 13) 1297 { 1298 return getDescription(); 1299 } 1300 if (pos == 14) 1301 { 1302 return getEndDate(); 1303 } 1304 if (pos == 15) 1305 { 1306 return getAttachmentId(); 1307 } 1308 return null; 1309 } 1310 1311 1317 public void save() throws Exception 1318 { 1319 save(ActivityPeer.getMapBuilder() 1320 .getDatabaseMap().getName()); 1321 } 1322 1323 1333 public void save(String dbName) throws TorqueException 1334 { 1335 Connection con = null; 1336 try 1337 { 1338 con = Transaction.begin(dbName); 1339 save(con); 1340 Transaction.commit(con); 1341 } 1342 catch(TorqueException e) 1343 { 1344 Transaction.safeRollback(con); 1345 throw e; 1346 } 1347 } 1348 1349 1351 private boolean alreadyInSave = false; 1352 1362 public void save(Connection con) throws TorqueException 1363 { 1364 if (!alreadyInSave) 1365 { 1366 alreadyInSave = true; 1367 1368 1369 1370 if (isModified()) 1372 { 1373 if (isNew()) 1374 { 1375 ActivityPeer.doInsert((Activity)this, con); 1376 setNew(false); 1377 } 1378 else 1379 { 1380 ActivityPeer.doUpdate((Activity)this, con); 1381 } 1382 1383 if (isCacheOnSave()) 1384 { 1385 ActivityManager.putInstance(this); 1386 } 1387 } 1388 1389 alreadyInSave = false; 1390 } 1391 } 1392 1393 1397 protected boolean isCacheOnSave() 1398 { 1399 return true; 1400 } 1401 1402 1403 1408 public void setPrimaryKey(ObjectKey activityId) 1409 { 1410 setActivityId(new Long (((NumberKey)activityId).longValue())); 1411 } 1412 1413 1418 public void setPrimaryKey(String key) 1419 { 1420 setActivityId(new Long (key)); 1421 } 1422 1423 1424 1428 public ObjectKey getPrimaryKey() 1429 { 1430 return SimpleKey.keyFor(getActivityId()); 1431 } 1432 1433 1437 public String getQueryKey() 1438 { 1439 if (getPrimaryKey() == null) 1440 { 1441 return ""; 1442 } 1443 else 1444 { 1445 return getPrimaryKey().toString(); 1446 } 1447 } 1448 1449 1453 public void setQueryKey(String key) 1454 throws TorqueException 1455 { 1456 setPrimaryKey(key); 1457 } 1458 1459 1465 public Activity copy() throws TorqueException 1466 { 1467 Activity copyObj = new Activity(); 1468 copyObj.setActivityId(activityId); 1469 copyObj.setIssueId(issueId); 1470 copyObj.setAttributeId(attributeId); 1471 copyObj.setTransactionId(transactionId); 1472 copyObj.setOldNumericValue(oldNumericValue); 1473 copyObj.setNewNumericValue(newNumericValue); 1474 copyObj.setOldUserId(oldUserId); 1475 copyObj.setNewUserId(newUserId); 1476 copyObj.setOldOptionId(oldOptionId); 1477 copyObj.setNewOptionId(newOptionId); 1478 copyObj.setOldValue(oldValue); 1479 copyObj.setNewValue(newValue); 1480 copyObj.setDependId(dependId); 1481 copyObj.setDescription(description); 1482 copyObj.setEndDate(endDate); 1483 copyObj.setAttachmentId(attachmentId); 1484 1485 copyObj.setActivityId((Long )null); 1486 1487 return copyObj; 1488 } 1489 1490 1496 public ActivityPeer getPeer() 1497 { 1498 return peer; 1499 } 1500 1501 public String toString() 1502 { 1503 StringBuffer str = new StringBuffer (); 1504 str.append("Activity:\n"); 1505 str.append("ActivityId = ") 1506 .append(getActivityId()) 1507 .append("\n"); 1508 str.append("IssueId = ") 1509 .append(getIssueId()) 1510 .append("\n"); 1511 str.append("AttributeId = ") 1512 .append(getAttributeId()) 1513 .append("\n"); 1514 str.append("TransactionId = ") 1515 .append(getTransactionId()) 1516 .append("\n"); 1517 str.append("OldNumericValue = ") 1518 .append(getOldNumericValue()) 1519 .append("\n"); 1520 str.append("NewNumericValue = ") 1521 .append(getNewNumericValue()) 1522 .append("\n"); 1523 str.append("OldUserId = ") 1524 .append(getOldUserId()) 1525 .append("\n"); 1526 str.append("NewUserId = ") 1527 .append(getNewUserId()) 1528 .append("\n"); 1529 str.append("OldOptionId = ") 1530 .append(getOldOptionId()) 1531 .append("\n"); 1532 str.append("NewOptionId = ") 1533 .append(getNewOptionId()) 1534 .append("\n"); 1535 str.append("OldValue = ") 1536 .append(getOldValue()) 1537 .append("\n"); 1538 str.append("NewValue = ") 1539 .append(getNewValue()) 1540 .append("\n"); 1541 str.append("DependId = ") 1542 .append(getDependId()) 1543 .append("\n"); 1544 str.append("Description = ") 1545 .append(getDescription()) 1546 .append("\n"); 1547 str.append("EndDate = ") 1548 .append(getEndDate()) 1549 .append("\n"); 1550 str.append("AttachmentId = ") 1551 .append(getAttachmentId()) 1552 .append("\n"); 1553 return(str.toString()); 1554 } 1555} 1556 | Popular Tags |