Subversion Repositories SmartDukaan

Rev

Rev 23110 | Rev 23823 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23110 Rev 23819
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.transaction;
1
package com.spice.profitmandi.dao.entity.transaction;
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
-
 
4
import java.text.SimpleDateFormat;
4
import java.time.LocalDateTime;
5
import java.time.LocalDateTime;
-
 
6
import java.time.format.DateTimeFormatter;
-
 
7
import java.util.Date;
5
 
8
 
6
import javax.persistence.Column;
9
import javax.persistence.Column;
7
import javax.persistence.Convert;
10
import javax.persistence.Convert;
8
import javax.persistence.Entity;
11
import javax.persistence.Entity;
9
import javax.persistence.GeneratedValue;
12
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
13
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
14
import javax.persistence.Id;
12
import javax.persistence.Table;
15
import javax.persistence.Table;
-
 
16
import javax.persistence.Temporal;
-
 
17
import javax.persistence.TemporalType;
13
 
18
 
14
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
 
20
 
16
/**
21
/**
17
 * This class basically contains  details
22
 * This class basically contains details
18
 * 
23
 * 
19
 * @author ashikali
24
 * @author ashikali
20
 *
25
 *
21
 */
26
 */
22
@Entity
27
@Entity
23
@Table(name="transaction.price_drop", schema = "transaction")
28
@Table(name = "transaction.price_drop", schema = "transaction")
24
public class PriceDrop implements Serializable{
29
public class PriceDrop implements Serializable {
25
	
30
 
26
	private static final long serialVersionUID = 1L;
31
	private static final long serialVersionUID = 1L;
27
	
32
 
28
	public PriceDrop() {
33
	public PriceDrop() {
29
	}
34
	}
30
	
35
 
31
	@Id
36
	@Id
32
	@Column(name="id")
37
	@Column(name = "id")
33
	@GeneratedValue(strategy = GenerationType.IDENTITY)
38
	@GeneratedValue(strategy = GenerationType.IDENTITY)
34
	private int id;
39
	private int id;
35
	
40
 
36
	@Column(name = "item_id")
41
	@Column(name = "item_id")
37
	private int itemId;
42
	private int itemId;
38
	
43
 
39
	@Column(name = "amount")
44
	@Column(name = "amount")
40
	private float amount;
45
	private float amount;
-
 
46
 
-
 
47
	@Column(name = "credit_note_number")
-
 
48
	private String creditNoteNumber;
41
	
49
 
42
	@Convert(converter = LocalDateTimeAttributeConverter.class)
50
	@Convert(converter = LocalDateTimeAttributeConverter.class)
43
	@Column(name = "process_timestamp")
51
	@Column(name = "process_timestamp")
44
	private LocalDateTime processTimestamp = LocalDateTime.now();	
52
	private LocalDateTime processTimestamp = LocalDateTime.now();
-
 
53
 
-
 
54
	@Column(name = "cashback_amount")
-
 
55
	private int cashbackAmount;
-
 
56
 
-
 
57
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
58
	@Column(name = "created_on")
-
 
59
	private LocalDateTime createdOn = LocalDateTime.now();
-
 
60
 
-
 
61
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
62
	@Column(name = "affected_on")
-
 
63
	private LocalDateTime affectedon = LocalDateTime.now();
-
 
64
 
-
 
65
	@Convert(converter = LocalDateTimeAttributeConverter.class)
-
 
66
	@Column(name = "credit_note_date")
-
 
67
	private LocalDateTime creditNoteDate = LocalDateTime.now();
45
	
68
 
46
	public int getId() {
69
	public int getId() {
47
		return id;
70
		return id;
48
	}
71
	}
-
 
72
 
49
	public void setId(int id) {
73
	public void setId(int id) {
50
		this.id = id;
74
		this.id = id;
51
	}
75
	}
52
	
76
 
53
	public int getItemId() {
77
	public int getItemId() {
54
		return itemId;
78
		return itemId;
55
	}
79
	}
56
	
80
 
57
	public void setItemId(int itemId) {
81
	public void setItemId(int itemId) {
58
		this.itemId = itemId;
82
		this.itemId = itemId;
59
	}
83
	}
60
	
84
 
61
	public float getAmount() {
85
	public float getAmount() {
62
		return amount;
86
		return amount;
63
	}
87
	}
-
 
88
 
64
	public void setAmount(float amount) {
89
	public void setAmount(float amount) {
65
		this.amount = amount;
90
		this.amount = amount;
66
	}
91
	}
67
	
92
 
68
	public LocalDateTime getProcessTimestamp() {
93
	public LocalDateTime getProcessTimestamp() {
69
		return processTimestamp;
94
		return processTimestamp;
70
	}
95
	}
-
 
96
 
71
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
97
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
72
		this.processTimestamp = processTimestamp;
98
		this.processTimestamp = processTimestamp;
73
	}
99
	}
-
 
100
 
-
 
101
	public String getCreditNoteNumber() {
-
 
102
		return creditNoteNumber;
-
 
103
	}
-
 
104
 
-
 
105
	public void setCreditNoteNumber(String creditNoteNumber) {
-
 
106
		this.creditNoteNumber = creditNoteNumber;
-
 
107
	}
-
 
108
 
-
 
109
	public LocalDateTime getCreatedOn() {
-
 
110
		return createdOn;
-
 
111
	}
-
 
112
 
-
 
113
	public void setCreatedOn(LocalDateTime createdOn) {
-
 
114
		this.createdOn = createdOn;
-
 
115
	}
-
 
116
 
74
	
117
	
-
 
118
 
-
 
119
	public LocalDateTime getAffectedon() {
-
 
120
		return affectedon;
-
 
121
	}
-
 
122
 
-
 
123
	public void setAffectedon(LocalDateTime affectedon) {
-
 
124
		this.affectedon = affectedon;
-
 
125
	}
-
 
126
 
-
 
127
	public LocalDateTime getCreditNoteDate() {
-
 
128
		return creditNoteDate;
-
 
129
	}
-
 
130
 
-
 
131
	public void setCreditNoteDate(LocalDateTime creditNoteDate) {
-
 
132
		this.creditNoteDate = creditNoteDate;
-
 
133
	}
-
 
134
 
-
 
135
	public int getCashbackAmount() {
-
 
136
		return cashbackAmount;
-
 
137
	}
-
 
138
 
-
 
139
	public void setCashbackAmount(int cashbackAmount) {
-
 
140
		this.cashbackAmount = cashbackAmount;
-
 
141
	}
-
 
142
 
-
 
143
	public String getDate(LocalDateTime ldt) {
-
 
144
		DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-
 
145
		String s = dtf.format(ldt);
-
 
146
		return s;
-
 
147
	}
-
 
148
 
75
	@Override
149
	@Override
76
	public int hashCode() {
150
	public int hashCode() {
77
		final int prime = 31;
151
		final int prime = 31;
78
		int result = 1;
152
		int result = 1;
79
		result = prime * result + id;
153
		result = prime * result + id;
80
		return result;
154
		return result;
81
	}
155
	}
-
 
156
 
82
	@Override
157
	@Override
83
	public boolean equals(Object obj) {
158
	public boolean equals(Object obj) {
84
		if (this == obj)
159
		if (this == obj)
85
			return true;
160
			return true;
86
		if (obj == null)
161
		if (obj == null)
Line 90... Line 165...
90
		PriceDrop other = (PriceDrop) obj;
165
		PriceDrop other = (PriceDrop) obj;
91
		if (id != other.id)
166
		if (id != other.id)
92
			return false;
167
			return false;
93
		return true;
168
		return true;
94
	}
169
	}
-
 
170
 
95
	@Override
171
	@Override
96
	public String toString() {
172
	public String toString() {
97
		return "PriceDrop [id=" + id + ", itemId=" + itemId + ", amount=" + amount + ", processTimestamp="
173
		return "PriceDrop [id=" + id + ", itemId=" + itemId + ", amount=" + amount + ", creditNoteNumber="
-
 
174
				+ creditNoteNumber + ", processTimestamp=" + processTimestamp + ", cashbackAmount=" + cashbackAmount
-
 
175
				+ ", createdOn=" + createdOn + ", affectedon=" + affectedon + ", creditNoteDate=" + creditNoteDate
98
				+ processTimestamp + "]";
176
				+ "]";
99
	}
177
	}
100
	
-
 
101
	
178
 
102
}
179
}
103
180