Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23110 ashik.ali 1
package com.spice.profitmandi.dao.entity.transaction;
2
 
3
import java.io.Serializable;
23819 govind 4
import java.text.SimpleDateFormat;
23110 ashik.ali 5
import java.time.LocalDateTime;
23819 govind 6
import java.time.format.DateTimeFormatter;
7
import java.util.Date;
23110 ashik.ali 8
 
9
import javax.persistence.Column;
10
import javax.persistence.Convert;
11
import javax.persistence.Entity;
12
import javax.persistence.GeneratedValue;
13
import javax.persistence.GenerationType;
14
import javax.persistence.Id;
15
import javax.persistence.Table;
23819 govind 16
import javax.persistence.Temporal;
17
import javax.persistence.TemporalType;
23110 ashik.ali 18
 
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
20
 
21
/**
23819 govind 22
 * This class basically contains details
23110 ashik.ali 23
 * 
24
 * @author ashikali
25
 *
26
 */
27
@Entity
23819 govind 28
@Table(name = "transaction.price_drop", schema = "transaction")
29
public class PriceDrop implements Serializable {
30
 
23110 ashik.ali 31
	private static final long serialVersionUID = 1L;
23819 govind 32
 
23110 ashik.ali 33
	public PriceDrop() {
34
	}
23819 govind 35
 
23110 ashik.ali 36
	@Id
23819 govind 37
	@Column(name = "id")
23110 ashik.ali 38
	@GeneratedValue(strategy = GenerationType.IDENTITY)
39
	private int id;
23819 govind 40
 
23110 ashik.ali 41
	@Column(name = "item_id")
42
	private int itemId;
23819 govind 43
 
23110 ashik.ali 44
	@Column(name = "amount")
45
	private float amount;
23819 govind 46
 
47
	@Column(name = "credit_note_number")
48
	private String creditNoteNumber;
49
 
23110 ashik.ali 50
	@Convert(converter = LocalDateTimeAttributeConverter.class)
51
	@Column(name = "process_timestamp")
23819 govind 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();
68
 
23110 ashik.ali 69
	public int getId() {
70
		return id;
71
	}
23819 govind 72
 
23110 ashik.ali 73
	public void setId(int id) {
74
		this.id = id;
75
	}
23819 govind 76
 
23110 ashik.ali 77
	public int getItemId() {
78
		return itemId;
79
	}
23819 govind 80
 
23110 ashik.ali 81
	public void setItemId(int itemId) {
82
		this.itemId = itemId;
83
	}
23819 govind 84
 
23110 ashik.ali 85
	public float getAmount() {
86
		return amount;
87
	}
23819 govind 88
 
23110 ashik.ali 89
	public void setAmount(float amount) {
90
		this.amount = amount;
91
	}
23819 govind 92
 
23110 ashik.ali 93
	public LocalDateTime getProcessTimestamp() {
94
		return processTimestamp;
95
	}
23819 govind 96
 
23110 ashik.ali 97
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
98
		this.processTimestamp = processTimestamp;
99
	}
23819 govind 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
 
23110 ashik.ali 117
 
23819 govind 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
 
23110 ashik.ali 149
	@Override
150
	public int hashCode() {
151
		final int prime = 31;
152
		int result = 1;
153
		result = prime * result + id;
154
		return result;
155
	}
23819 govind 156
 
23110 ashik.ali 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
		PriceDrop other = (PriceDrop) obj;
166
		if (id != other.id)
167
			return false;
168
		return true;
169
	}
23819 govind 170
 
23110 ashik.ali 171
	@Override
172
	public String toString() {
23819 govind 173
		return "PriceDrop [id=" + id + ", itemId=" + itemId + ", amount=" + amount + ", creditNoteNumber="
174
				+ creditNoteNumber + ", processTimestamp=" + processTimestamp + ", cashbackAmount=" + cashbackAmount
175
				+ ", createdOn=" + createdOn + ", affectedon=" + affectedon + ", creditNoteDate=" + creditNoteDate
176
				+ "]";
23110 ashik.ali 177
	}
23819 govind 178
 
23110 ashik.ali 179
}