Subversion Repositories SmartDukaan

Rev

Rev 29515 | Rev 32671 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29515 tejbeer 1
package com.spice.profitmandi.dao.entity.dtr;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
import javax.persistence.Transient;
15
 
16
import com.spice.profitmandi.dao.enumuration.inventory.ScratchedGift;
17
 
18
@Entity
31860 tejbeer 19
@Table(name = "dtr.scratch_offer")
29515 tejbeer 20
public class ScratchOffer implements Serializable {
21
 
22
	/**
23
	 * 
24
	 */
25
	private static final long serialVersionUID = 1L;
26
 
27
	@Id
28
	@Column(name = "id", unique = true, updatable = false)
29
	@GeneratedValue(strategy = GenerationType.IDENTITY)
30
	private int id;
31
 
32
	@Column(name = "invoice_number")
33
	private String invoiceNumber;
34
 
35
	@Column(name = "customer_id")
36
	private int customerId;
37
 
38
	@Column(name = "offer_name")
39
	@Enumerated(EnumType.STRING)
40
	private ScratchedGift offerName;
41
 
42
	@Column(name = "scratched")
43
	private boolean scratched;
44
 
45
	@Column(name = "created_timestamp")
46
	private LocalDateTime createdTimestamp;
47
 
48
	@Column(name = "unlocked_at")
49
	private LocalDateTime unlockedAt;
50
 
51
	@Column(name = "scracthed_at")
52
	private LocalDateTime scracthedAt;
53
 
54
	public LocalDateTime getScracthedAt() {
55
		return scracthedAt;
56
	}
57
 
58
	public void setScracthedAt(LocalDateTime scracthedAt) {
59
		this.scracthedAt = scracthedAt;
60
	}
61
 
62
	@Transient
63
	private boolean unlocked;
64
 
65
	@Transient
66
	private LocalDateTime expiredTimestamp;
67
 
68
	public LocalDateTime getExpiredTimestamp() {
69
		return expiredTimestamp;
70
	}
71
 
72
	public void setExpiredTimestamp(LocalDateTime expiredTimestamp) {
73
		this.expiredTimestamp = expiredTimestamp;
74
	}
75
 
76
	public boolean isUnlocked() {
77
		return unlocked;
78
	}
79
 
80
	public void setUnlocked(boolean unlocked) {
81
		this.unlocked = unlocked;
82
	}
83
 
84
	public LocalDateTime getUnlockedAt() {
85
		return unlockedAt;
86
	}
87
 
88
	public void setUnlockedAt(LocalDateTime unlockedAt) {
89
		this.unlockedAt = unlockedAt;
90
	}
91
 
92
	public int getId() {
93
		return id;
94
	}
95
 
96
	public void setId(int id) {
97
		this.id = id;
98
	}
99
 
100
	public int getCustomerId() {
101
		return customerId;
102
	}
103
 
104
	public void setCustomerId(int customerId) {
105
		this.customerId = customerId;
106
	}
107
 
108
	public String getInvoiceNumber() {
109
		return invoiceNumber;
110
	}
111
 
112
	public void setInvoiceNumber(String invoiceNumber) {
113
		this.invoiceNumber = invoiceNumber;
114
	}
115
 
116
	public ScratchedGift getOfferName() {
117
		return offerName;
118
	}
119
 
120
	public void setOfferName(ScratchedGift offerName) {
121
		this.offerName = offerName;
122
	}
123
 
124
	public boolean isScratched() {
125
		return scratched;
126
	}
127
 
128
	public void setScratched(boolean scratched) {
129
		this.scratched = scratched;
130
	}
131
 
132
	public LocalDateTime getCreatedTimestamp() {
133
		return createdTimestamp;
134
	}
135
 
136
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
137
		this.createdTimestamp = createdTimestamp;
138
	}
139
 
140
	@Override
141
	public int hashCode() {
142
		final int prime = 31;
143
		int result = 1;
144
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
145
		result = prime * result + customerId;
146
		result = prime * result + ((expiredTimestamp == null) ? 0 : expiredTimestamp.hashCode());
147
		result = prime * result + id;
148
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
149
		result = prime * result + ((offerName == null) ? 0 : offerName.hashCode());
150
		result = prime * result + ((scracthedAt == null) ? 0 : scracthedAt.hashCode());
151
		result = prime * result + (scratched ? 1231 : 1237);
152
		result = prime * result + (unlocked ? 1231 : 1237);
153
		result = prime * result + ((unlockedAt == null) ? 0 : unlockedAt.hashCode());
154
		return result;
155
	}
156
 
157
	@Override
158
	public boolean equals(Object obj) {
159
		if (this == obj)
160
			return true;
161
		if (obj == null)
162
			return false;
163
		if (getClass() != obj.getClass())
164
			return false;
165
		ScratchOffer other = (ScratchOffer) obj;
166
		if (createdTimestamp == null) {
167
			if (other.createdTimestamp != null)
168
				return false;
169
		} else if (!createdTimestamp.equals(other.createdTimestamp))
170
			return false;
171
		if (customerId != other.customerId)
172
			return false;
173
		if (expiredTimestamp == null) {
174
			if (other.expiredTimestamp != null)
175
				return false;
176
		} else if (!expiredTimestamp.equals(other.expiredTimestamp))
177
			return false;
178
		if (id != other.id)
179
			return false;
180
		if (invoiceNumber == null) {
181
			if (other.invoiceNumber != null)
182
				return false;
183
		} else if (!invoiceNumber.equals(other.invoiceNumber))
184
			return false;
185
		if (offerName != other.offerName)
186
			return false;
187
		if (scracthedAt == null) {
188
			if (other.scracthedAt != null)
189
				return false;
190
		} else if (!scracthedAt.equals(other.scracthedAt))
191
			return false;
192
		if (scratched != other.scratched)
193
			return false;
194
		if (unlocked != other.unlocked)
195
			return false;
196
		if (unlockedAt == null) {
197
			if (other.unlockedAt != null)
198
				return false;
199
		} else if (!unlockedAt.equals(other.unlockedAt))
200
			return false;
201
		return true;
202
	}
203
 
204
	@Override
205
	public String toString() {
206
		return "ScratchOffer [id=" + id + ", invoiceNumber=" + invoiceNumber + ", customerId=" + customerId
207
				+ ", offerName=" + offerName + ", scratched=" + scratched + ", createdTimestamp=" + createdTimestamp
208
				+ ", unlockedAt=" + unlockedAt + ", scracthedAt=" + scracthedAt + ", unlocked=" + unlocked
209
				+ ", expiredTimestamp=" + expiredTimestamp + "]";
210
	}
211
 
212
}