Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23418 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
import javax.persistence.UniqueConstraint;
15
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
18
@Entity
19
@Table(name="fofo.prebooking_order", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"item_id", "customer_mobile_number"})})
20
public class PrebookingOrder implements Serializable{
21
 
22
	private static final long serialVersionUID = 1L;
23
 
24
	@Id
25
	@Column(name = "id")
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
27
	private int id;
28
 
29
	@Column(name = "fofo_id")
30
	private int fofoId;
31
 
32
	@Column(name = "customer_name")
33
	private String customerName;
34
 
35
	@Column(name = "customer_mobile_number")
36
	private String customerMobileNumber;
37
 
38
	@Column(name = "customer_email_id")
39
	private String customerEmailId;
40
 
41
	@Column(name = "item_id")
42
	private int itemId;
43
 
44
	@Column(name = "quantity")
45
	private int quantity;
46
 
47
	@Column(name = "available_quantity")
48
	private int availableQuantity;
49
 
50
	@Convert(converter = LocalDateTimeAttributeConverter.class)
51
	@Column(name = "complete_timestamp")
52
	private LocalDateTime completeTimestamp = null;
53
 
54
	@Convert(converter = LocalDateTimeAttributeConverter.class)
55
	@Column(name = "create_timestamp")
56
	private LocalDateTime createTimestamp = LocalDateTime.now();
57
 
23580 govind 58
	@Convert(converter = LocalDateTimeAttributeConverter.class)
59
	@Column(name = "notify_timestamp")
60
	private LocalDateTime notifyTimeStamp = null;
61
 
62
	public LocalDateTime getNotifyTimeStamp() {
63
		return notifyTimeStamp;
64
	}
65
 
66
	public void setNotifyTimeStamp(LocalDateTime notifyTimeStamp) {
67
		this.notifyTimeStamp = notifyTimeStamp;
68
	}
69
 
23418 ashik.ali 70
	public int getId() {
71
		return id;
72
	}
73
 
74
	public void setId(int id) {
75
		this.id = id;
76
	}
77
 
78
	public int getFofoId() {
79
		return fofoId;
80
	}
81
 
82
	public void setFofoId(int fofoId) {
83
		this.fofoId = fofoId;
84
	}
85
 
86
	public String getCustomerName() {
87
		return customerName;
88
	}
89
 
90
	public void setCustomerName(String customerName) {
91
		this.customerName = customerName;
92
	}
93
 
94
	public String getCustomerMobileNumber() {
95
		return customerMobileNumber;
96
	}
97
 
98
	public void setCustomerMobileNumber(String customerMobileNumber) {
99
		this.customerMobileNumber = customerMobileNumber;
100
	}
101
 
102
	public String getCustomerEmailId() {
103
		return customerEmailId;
104
	}
105
 
106
	public void setCustomerEmailId(String customerEmailId) {
107
		this.customerEmailId = customerEmailId;
108
	}
109
 
110
	public int getItemId() {
111
		return itemId;
112
	}
113
 
114
	public void setItemId(int itemId) {
115
		this.itemId = itemId;
116
	}
117
 
118
	public int getQuantity() {
119
		return quantity;
120
	}
121
 
122
	public void setQuantity(int quantity) {
123
		this.quantity = quantity;
124
	}
125
 
126
	public int getAvailableQuantity() {
127
		return availableQuantity;
128
	}
129
 
130
	public void setAvailableQuantity(int availableQuantity) {
131
		this.availableQuantity = availableQuantity;
132
	}
133
 
134
	public LocalDateTime getCompleteTimestamp() {
135
		return completeTimestamp;
136
	}
137
 
138
	public void setCompleteTimestamp(LocalDateTime completeTimestamp) {
139
		this.completeTimestamp = completeTimestamp;
140
	}
141
 
142
	public LocalDateTime getCreateTimestamp() {
143
		return createTimestamp;
144
	}
145
 
146
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
147
		this.createTimestamp = createTimestamp;
148
	}
149
 
150
	public String getFormattedCreateTimestamp(){
151
		if(createTimestamp == null){
152
			return null;
153
		}
154
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
155
		return createTimestamp.format(formatter);
156
    }
157
 
158
	@Override
159
	public int hashCode() {
160
		final int prime = 31;
161
		int result = 1;
162
		result = prime * result + id;
163
		return result;
164
	}
165
 
166
	@Override
167
	public boolean equals(Object obj) {
168
		if (this == obj)
169
			return true;
170
		if (obj == null)
171
			return false;
172
		if (getClass() != obj.getClass())
173
			return false;
174
		PrebookingOrder other = (PrebookingOrder) obj;
175
		if (id != other.id)
176
			return false;
177
		return true;
178
	}
179
 
180
	@Override
181
	public String toString() {
182
		return "PrebookingOrder [id=" + id + ", fofoId=" + fofoId + ", customerName=" + customerName
183
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
184
				+ ", itemId=" + itemId + ", quantity=" + quantity + ", availableQuantity=" + availableQuantity
185
				+ ", completeTimestamp=" + completeTimestamp + ", createTimestamp=" + createTimestamp + "]";
186
	}
187
 
188
}