Subversion Repositories SmartDukaan

Rev

Rev 33680 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33680 Rev 34474
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.dtr;
1
package com.spice.profitmandi.dao.entity.dtr;
2
 
2
 
3
import com.spice.profitmandi.dao.enumuration.inventory.ScratchedGift;
-
 
4
 
-
 
5
import javax.persistence.*;
3
import javax.persistence.*;
6
import java.io.Serializable;
4
import java.io.Serializable;
7
import java.time.LocalDateTime;
5
import java.time.LocalDateTime;
-
 
6
import java.util.Objects;
8
 
7
 
9
@Entity
8
@Entity
10
@Table(name = "dtr.scratch_offer")
9
@Table(name = "dtr.scratch_offer")
11
@NamedQueries({@NamedQuery(name = "ScratchOffer.selectAllCountOfOffer",
10
@NamedQueries({@NamedQuery(name = "ScratchOffer.selectAllCountOfOffer",
12
		query = "SELECT so.offerName, COUNT(so) FROM ScratchOffer so " +
11
		query = "SELECT so.offerName, COUNT(so) FROM ScratchOffer so " +
Line 30... Line 29...
30
 
29
 
31
	@Column(name = "customer_id")
30
	@Column(name = "customer_id")
32
	private int customerId;
31
	private int customerId;
33
 
32
 
34
	@Column(name = "offer_name")
33
	@Column(name = "offer_name")
35
	@Enumerated(EnumType.STRING)
-
 
36
	private ScratchedGift offerName;
34
	private String offerName;
37
 
35
 
38
	@Column(name = "scratched")
36
	@Column(name = "scratched")
39
	private boolean scratched;
37
	private boolean scratched;
40
 
38
 
41
	@Column(name = "created_timestamp")
39
	@Column(name = "created_timestamp")
Line 45... Line 43...
45
	private LocalDateTime unlockedAt;
43
	private LocalDateTime unlockedAt;
46
 
44
 
47
	@Column(name = "scracthed_at")
45
	@Column(name = "scracthed_at")
48
	private LocalDateTime scracthedAt;
46
	private LocalDateTime scracthedAt;
49
 
47
 
-
 
48
	@Column(name = "offer_id")
-
 
49
	private int offerId;
-
 
50
 
-
 
51
	@Column(name = "gift_id")
-
 
52
	private int giftId;
-
 
53
 
50
	public LocalDateTime getScracthedAt() {
54
	public LocalDateTime getScracthedAt() {
51
		return scracthedAt;
55
		return scracthedAt;
52
	}
56
	}
53
 
57
 
54
	public void setScracthedAt(LocalDateTime scracthedAt) {
58
	public void setScracthedAt(LocalDateTime scracthedAt) {
Line 118... Line 122...
118
 
122
 
119
	public void setInvoiceNumber(String invoiceNumber) {
123
	public void setInvoiceNumber(String invoiceNumber) {
120
		this.invoiceNumber = invoiceNumber;
124
		this.invoiceNumber = invoiceNumber;
121
	}
125
	}
122
 
126
 
123
	public ScratchedGift getOfferName() {
127
	public String getOfferName() {
124
		return offerName;
128
		return offerName;
125
	}
129
	}
126
 
130
 
127
	public void setOfferName(ScratchedGift offerName) {
131
	public void setOfferName(String offerName) {
128
		this.offerName = offerName;
132
		this.offerName = offerName;
129
	}
133
	}
130
 
134
 
131
	public boolean isScratched() {
135
	public boolean isScratched() {
132
		return scratched;
136
		return scratched;
Line 142... Line 146...
142
 
146
 
143
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
147
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
144
		this.createdTimestamp = createdTimestamp;
148
		this.createdTimestamp = createdTimestamp;
145
	}
149
	}
146
 
150
 
-
 
151
	public int getOfferId() {
-
 
152
		return offerId;
-
 
153
	}
-
 
154
 
-
 
155
	public void setOfferId(int offerId) {
-
 
156
		this.offerId = offerId;
-
 
157
	}
-
 
158
 
-
 
159
	public int getGiftId() {
-
 
160
		return giftId;
-
 
161
	}
-
 
162
 
-
 
163
	public void setGiftId(int giftId) {
-
 
164
		this.giftId = giftId;
-
 
165
	}
-
 
166
 
147
	@Override
167
	@Override
148
	public int hashCode() {
168
	public int hashCode() {
149
		final int prime = 31;
169
		final int prime = 31;
150
		int result = 1;
170
		int result = 1;
151
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
171
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
Line 187... Line 207...
187
		if (invoiceNumber == null) {
207
		if (invoiceNumber == null) {
188
			if (other.invoiceNumber != null)
208
			if (other.invoiceNumber != null)
189
				return false;
209
				return false;
190
		} else if (!invoiceNumber.equals(other.invoiceNumber))
210
		} else if (!invoiceNumber.equals(other.invoiceNumber))
191
			return false;
211
			return false;
192
		if (offerName != other.offerName)
212
		if (!Objects.equals(offerName, other.offerName))
193
			return false;
213
			return false;
194
		if (scracthedAt == null) {
214
		if (scracthedAt == null) {
195
			if (other.scracthedAt != null)
215
			if (other.scracthedAt != null)
196
				return false;
216
				return false;
197
		} else if (!scracthedAt.equals(other.scracthedAt))
217
		} else if (!scracthedAt.equals(other.scracthedAt))
Line 211... Line 231...
211
	@Override
231
	@Override
212
	public String toString() {
232
	public String toString() {
213
		return "ScratchOffer [id=" + id + ", invoiceNumber=" + invoiceNumber + ", customerId=" + customerId
233
		return "ScratchOffer [id=" + id + ", invoiceNumber=" + invoiceNumber + ", customerId=" + customerId
214
				+ ", offerName=" + offerName + ", scratched=" + scratched + ", createdTimestamp=" + createdTimestamp
234
				+ ", offerName=" + offerName + ", scratched=" + scratched + ", createdTimestamp=" + createdTimestamp
215
				+ ", unlockedAt=" + unlockedAt + ", scracthedAt=" + scracthedAt + ", unlocked=" + unlocked
235
				+ ", unlockedAt=" + unlockedAt + ", scracthedAt=" + scracthedAt + ", unlocked=" + unlocked
-
 
236
				+ ", offerId=" + offerId + ", giftId=" + giftId
216
				+ ", expiredTimestamp=" + expiredTimestamp + "]";
237
				+ ", expiredTimestamp=" + expiredTimestamp + "]";
217
	}
238
	}
218
 
239
 
219
}
240
}