01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.domain;
05:
06: import java.io.Serializable;
07:
08: public class PromotionId implements Serializable {
09: private Long customerId;
10:
11: private Long giftId;
12:
13: public PromotionId() {
14: super ();
15: }
16:
17: public PromotionId(Long customerId, Long giftId) {
18: this .customerId = customerId;
19: this .giftId = giftId;
20: }
21:
22: public boolean equals(Object obj) {
23: if ((obj != null) && (obj instanceof PromotionId)) {
24: PromotionId id = (PromotionId) obj;
25: return (customerId.equals(id.customerId))
26: && (giftId.equals(id.giftId));
27: } else {
28: return false;
29: }
30: }
31:
32: public Long getCustomerId() {
33: return customerId;
34: }
35:
36: public void setCustomerId(Long customerId) {
37: this .customerId = customerId;
38: }
39:
40: public Long getGiftId() {
41: return giftId;
42: }
43:
44: public void setGiftId(Long giftId) {
45: this .giftId = giftId;
46: }
47:
48: public int hashCode() {
49: return customerId.hashCode() + giftId.hashCode();
50: }
51:
52: public String toString() {
53: return "promotionId.customerId: " + customerId
54: + ", promotionId.giftId: " + giftId;
55: }
56: }
|